cdadb0db4d
This method captures all application/pdf streams, loads the viewer and passes the stream to the PDF.js viewer. This commit shows a proof of concept using the chrome.streamsPrivate API. Advantages of new method: - Access to the response body of the original request, thus fewer network requests. - PDFs from non-GET requests (e.g. POST) are now supported. - FTP files are also supported. Possible improvements: - Use declared content scripts instead of dynamic chrome.tabs.executeScript. This allows the extension to render the viewer in frames when the extension is disallowed to run executeScript for the top URL. - Use chrome.declarativeWebRequest instead of webRequest, and replace background page with event page (don't forget to profile the difference & will the background/event page still work as intended?). |
||
---|---|---|
.. | ||
.gitignore | ||
chrome.tabs.executeScriptInFrame.js | ||
extension-router.js | ||
icon16.png | ||
icon19.png | ||
icon38.png | ||
icon48.png | ||
icon128.png | ||
manifest.json | ||
nothing.js | ||
pageActionPopup.html | ||
pageActionPopup.js | ||
patch-worker.js | ||
pdfHandler-v2.js | ||
pdfHandler.html | ||
pdfHandler.js |