Navigate Forward & Backward through Page History?

Hi there,

Is it possible to navigate forwards and backwards through page history when using a floating webview, via keyboard shortcut, like you can in normal web browsers?

Eg in chrome and safari:

  • Cmd/Ctrl + [ : goes back
  • Cmd/Ctrl + ]: goes forward

I'm a total noob.

I've been playing around with the very helpful ExampleBrowser preset.
https://share.folivora.ai/sharedPreset/f2b8dd5d-6c4e-4c18-913b-109349f44450

If I could get this to work, it would be amazing.

Thanks for such an amazing tool!

you can use the predefined action "Execute Java Script in Web View Menu Item". Then call

window.history.back();

or

window.history.forward();

Thanks! This works!

Is it possible to make this work via keyboard shortcuts?

EG:

  • Cmd + [ : back
  • Cmd + ]: forward

you can assign the action to keyboard shortcuts. If you want them to be only active while the floating menu is visible you can use a conditional activation group with the “visible_floating_menu_identifiers” variable

Thanks! Thanks a bunch for your help!

Hey @Andreas_Hegenberg. Sorry for the super long delay. I've tried doing what you've listed here to assign the window.history.back(); event to a button.

When I do this, nothing happens. (The event does trigger when injecting via console in the webview's inspector). But the event doesn't trigger when assigned to the button.

Would you mind trying it on your end to make sure it works?

@Andreas_Hegenberg sorry to keep bugging. Any chance you can try to see if the button triggers the event on your end?

Same issue. I'd like to bind mouse gesture through BTT to navigate between history. But the approach using predefined action mentioned by Anfreas_Hegenberg does not work. Any insight?

1 Like

@RobRob could you share your preset? I tried with the standard "BrowserExample" preset, but it is working fine there. Is here maybe some whitespace in the menu name or something like this?
Possibly try with the UUID of the webview item instead (right-click the item to get that id)

1 Like

@Andreas_Hegenberg

Sure. Here's the preset I'm working in.

The button with the window.history.forward(); javascript is:

  • Menu Item: History Back

Thanks for your help!


BrowserExampleEDIT.bttpreset (44.9 KB)

your preset seems to work ok here, I just needed to change the

window.history.forward();

to

window.history.back();

Is there a reason you are using forward? (forward would only work if going back first)

@Andreas_Hegenberg Well... I feel stupid. It works! I was pushing a "forward" button the whole time. Switching the javascript to window.history.back(); works!

Thanks so much