4773bf6fcb
This is *really* the best that we can do here, since other proposed solutions would interfere with (and break) the painstakingly implemented browsing history that's present in the default viewer. I'm still not convinced that this is a good idea in general, but this patch implements it in a way where it is possible to toggle[1] for users that wish to have this feature. In particular, there's a couple of reasons why I'm not finding this feature necessary/great: - It's already possible to easily obtain the current hash, by simply clicking on the `viewBookmark` button at any time. - Hash changes requires a bit of special handling[2], i.e. extra code, to prevent issues when the browser history is traversed (see `PDFHistory._popState`). Currently this is only necessary when the user has manually changed the hash, with this patch it will always be the case (assuming the feature is active). - It's not always possible to change the URL when updating the browser history. For example: In the Firefox built-in viewer, the URL cannot be modified for local files (i.e. those using the `file://` protocol). This leads to inconsistent behaviour, and may in some cases even result in errors being thrown and the history thus not updating, if the browser prevents changes to the URL during `pushState`/`replaceState` calls. --- [1] Using the `historyUpdateUrl` viewer preference. [2] This depends, to a great extent, on browsers always firing `popstate` events *before* `hashchange` events, which may or may not actually be guaranteed. |
||
---|---|---|
.. | ||
options | ||
pageAction | ||
.eslintrc | ||
.gitignore | ||
contentscript.js | ||
contentstyle.css | ||
extension-router.js | ||
icon16.png | ||
icon19.png | ||
icon38.png | ||
icon48.png | ||
icon128.png | ||
manifest.json | ||
pdfHandler-vcros.js | ||
pdfHandler.html | ||
pdfHandler.js | ||
preferences_schema.json | ||
preserve-referer.js | ||
restoretab.html | ||
restoretab.js | ||
suppress-update.js | ||
telemetry.js |