[CRX] Re-initialize initialBookmark after URL rewrite
`PDFViewerApplication` reads from `location.hash` to initialize `initialBookmark`. But when extensions/chromium/pdfHandler.js prepares the redirect URL, the reference fragment is encoded instead of bare. `rewriteUrlClosure` in `chromecom.js` is responsible for decoding the URL, but that currently runs too late. To fix this, update `initialBookmark` after rewriting the URL. This was not a problem in the past because `rewriteUrlClosure` in `chromecom.js` executed before the initialization of `initialBookmark`.
This commit is contained in:
parent
2c74323e3d
commit
1d07ef401e
@ -42,6 +42,9 @@ if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("CHROME")) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AppOptions.set("defaultUrl", defaultUrl);
|
AppOptions.set("defaultUrl", defaultUrl);
|
||||||
|
// Ensure that PDFViewerApplication.initialBookmark reflects the current hash,
|
||||||
|
// in case the URL rewrite above results in a different hash.
|
||||||
|
PDFViewerApplication.initialBookmark = location.hash.slice(1);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
const ChromeCom = {
|
const ChromeCom = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user