1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Merge pull request #4191 from Rob--W/crx-chrome-os

Register PDF Viewer as PDF handler in Chrome OS's file browser
This commit is contained in:
Yury Delendik 2014-02-11 12:51:36 -06:00
commit 4563f6cd58
6 changed files with 145 additions and 30 deletions

View file

@ -145,7 +145,9 @@ var PDFHistory = {
// window.history.pushState(stateObj, '');
//#endif
//#if CHROME
// chrome.runtime.sendMessage('showPageAction');
// if (top === window) {
// chrome.runtime.sendMessage('showPageAction');
// }
//#endif
}
},

View file

@ -1572,15 +1572,13 @@ var DocumentOutlineView = function documentOutlineView(outline) {
//(function rewriteUrlClosure() {
// // Run this code outside DOMContentLoaded to make sure that the URL
// // is rewritten as soon as possible.
// if (location.origin + '/' !== chrome.extension.getURL('/')) {
// DEFAULT_URL = window.location.href.split('#')[0];
// } else {
// var params = PDFView.parseQueryString(document.location.search.slice(1));
// DEFAULT_URL = params.file || DEFAULT_URL;
// var params = PDFView.parseQueryString(document.location.search.slice(1));
// DEFAULT_URL = params.file || DEFAULT_URL;
//
// // Example: chrome-extension://.../http://example.com/file.pdf
// var humanReadableUrl = '/' + DEFAULT_URL + location.hash;
// history.replaceState(history.state, '', humanReadableUrl);
// // Example: chrome-extension://.../http://example.com/file.pdf
// var humanReadableUrl = '/' + DEFAULT_URL + location.hash;
// history.replaceState(history.state, '', humanReadableUrl);
// if (top === window) {
// chrome.runtime.sendMessage('showPageAction');
// }
//})();
@ -1598,12 +1596,9 @@ document.addEventListener('DOMContentLoaded', function webViewerLoad(evt) {
//#endif
//#if CHROME
//var file = DEFAULT_URL;
//#endif
//#if CHROME
//if (location.protocol !== 'chrome-extension:') {
// file = location.href.split('#')[0];
//}
//// XHR cannot get data from drive:-URLs, so expand to filesystem: (Chrome OS)
//file = file.replace(/^drive:/i,
// 'filesystem:' + location.origin + '/external/');
//#endif
//#if !(FIREFOX || MOZCENTRAL || CHROME || B2G)