mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
[CRX] Add a pageAction to omnibox showing PDF URL
In Chromium extensions, the viewer's URL looks like this: chrome-extension://oemmndcbldboiebfnladdacbdfmadadm/http://example.com/file.pdf Furthermore, the PDF Viewer itself can also add something to the reference fragment: chrome-extension://oemmndcbldboiebfnladdacbdfmadadm/http://example.com/file.pdf#page=2 Consequently, it is difficult to copy a clean URL (e.g. for sharing over mail) without having to tidy-up the URL manually. This commit solves this issue by adding a button to the omnibox, which shows the clean PDF URL on click.
This commit is contained in:
parent
58807ec860
commit
8526d3c600
8 changed files with 137 additions and 8 deletions
|
@ -143,6 +143,9 @@ var PDFHistory = {
|
|||
window.history.pushState(stateObj, '', document.URL);
|
||||
//#else
|
||||
// window.history.pushState(stateObj, '');
|
||||
//#endif
|
||||
//#if CHROME
|
||||
// chrome.runtime.sendMessage('showPageAction');
|
||||
//#endif
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1530,6 +1530,7 @@ var DocumentOutlineView = function documentOutlineView(outline) {
|
|||
// // Example: chrome-extension://.../http://example.com/file.pdf
|
||||
// var humanReadableUrl = '/' + DEFAULT_URL + location.hash;
|
||||
// history.replaceState(history.state, '', humanReadableUrl);
|
||||
// chrome.runtime.sendMessage('showPageAction');
|
||||
// }
|
||||
//})();
|
||||
//#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue