-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Would it make sense to anyone else but me to use the Browser History API to "hijack" the browser's back and forward buttons to navigate to previously visited tiddlers? Especially together with mouse gestures, this could save a lot of time.
Basically, it could work like this, I think: A listener widget inside the main NavigatorWidget attaches an EventListener for popstate to the window that dispatches tm-navigate messages that bubble upwards whenever back or forward are clicked. That navigates to the tiddler that is saved in the browser history stack.
To get tiddlers into the browser history, an action widget could put it there. This widget would need to be called whenever a tiddler is to be added, by a button action or by intercepting tm-navigate messages in the PageTemplate (there have been discussions about how to do this here and on TalkTW) and writing into the browser history on navigation. Using pushState on the history object, we can save the navigation target tiddler there. This could be done without changing the URL (sort of the opposite of what PermaLink and PermaView do).
It would also be nice if the back button were not able to exit TW, as otherwise one careless click would cause users to have to reload the wiki. I'm sure there are ways to do that. Hopefully.