#canGoBack() and canGoForward() when rendering web pages

12 messages · Page 1 of 1 (latest)

old sedge
#

https://www.electronjs.org/docs/latest/api/web-contents

do we have something similar on Tauri? I'm trying to implement back and forth arrow keys for navigation.

here's how i'm configuring my window to render the webpage in the first place

{
        "title": "Dimension",
        "label": "primary",
        "width": 1280,
        "height": 720,
        "url": "https://dimension.dev",
        "userAgent": "[REDACTED]",
        "hiddenTitle": true,
        "titleBarStyle": "Overlay",
        "visible": true,
        "transparent": true
      }

would appreciate help with the same, whether it's possible via js or rust.

Render and control web pages.

haughty oar
#

If you only need support for windows (and probably android) then the web api navigation.canGoBack should work.
Otherwise it's not supported out of the box (it should be possible to use the native webview bindings via with_webview to bridge the gap but that is not trivial.

#

Feel free to open a feature request on github :)

old sedge
#

would that work on macos as well?

#

the navigation.canGoBack?

#

also how would one go about using Command + ] and Command + [ to go back and forth respectively assuming navigation.canGoBack works as anticipated (or some other api for back and forward navigation)?

haughty oar
haughty oar
#

and on macos custom menu items maybe, to match stuff like copy & paste

old sedge
old sedge
#

created it here