2011-10-19 02:43:43 +09:00
|
|
|
{
|
2012-09-06 14:52:17 +09:00
|
|
|
"manifest_version": 2,
|
2012-09-07 00:33:07 +09:00
|
|
|
"name": "PDF Viewer",
|
|
|
|
"version": "PDFJSSCRIPT_VERSION",
|
2013-08-22 01:11:35 +09:00
|
|
|
"description": "Uses HTML5 to display PDF files directly in the browser.",
|
2013-02-17 11:15:01 +09:00
|
|
|
"icons": {
|
|
|
|
"128": "icon128.png",
|
|
|
|
"48": "icon48.png",
|
|
|
|
"16": "icon16.png"
|
|
|
|
},
|
2011-10-19 02:43:43 +09:00
|
|
|
"permissions": [
|
2012-02-14 04:23:31 +09:00
|
|
|
"webRequest", "webRequestBlocking",
|
2013-04-04 07:28:45 +09:00
|
|
|
"<all_urls>",
|
2013-07-18 01:57:18 +09:00
|
|
|
"tabs",
|
2013-08-14 01:28:13 +09:00
|
|
|
"webNavigation",
|
2013-08-22 01:37:22 +09:00
|
|
|
"storage",
|
2013-08-14 01:28:13 +09:00
|
|
|
"streamsPrivate"
|
2011-10-19 02:43:43 +09:00
|
|
|
],
|
2013-04-04 07:28:45 +09:00
|
|
|
"content_scripts": [{
|
2013-12-05 19:16:14 +09:00
|
|
|
"matches": [
|
|
|
|
"http://*/*",
|
|
|
|
"https://*/*",
|
|
|
|
"ftp://*/*",
|
|
|
|
"file://*/*"
|
|
|
|
],
|
2013-10-02 05:16:28 +09:00
|
|
|
"js": ["nothing.js"]
|
2013-04-04 07:28:45 +09:00
|
|
|
}],
|
2013-08-14 01:28:13 +09:00
|
|
|
"mime_types": [
|
|
|
|
"application/pdf"
|
|
|
|
],
|
2012-09-06 14:52:17 +09:00
|
|
|
"background": {
|
|
|
|
"page": "pdfHandler.html"
|
2013-04-04 07:28:45 +09:00
|
|
|
},
|
2013-12-07 20:32:08 +09:00
|
|
|
"page_action": {
|
|
|
|
"default_icon": {
|
|
|
|
"19": "icon19.png",
|
|
|
|
"38": "icon38.png"
|
|
|
|
},
|
|
|
|
"default_title": "Show PDF URL",
|
|
|
|
"default_popup": "pageActionPopup.html"
|
|
|
|
},
|
2013-10-02 05:16:28 +09:00
|
|
|
"incognito": "split",
|
2013-04-04 07:28:45 +09:00
|
|
|
"web_accessible_resources": [
|
2013-10-02 05:16:28 +09:00
|
|
|
"getFrameId",
|
[CRX] Show nicely formatted URL in omnibox
Before commit:
chrome-extension://EXTENSIONID/content/web/viewer.html?file=http%3A%2F%2Fexample.com%2Ffile.pdf
After commit:
chrome-extension://EXTENSIONID/http://example/file.pdf
Technical details:
- The extension's background page uses the webRequest API to intercept
requests for <extension host>/<real path to pdf>, and redirect it to
the viewer's URL.
- viewer.js uses history.replaceState to rewrite the URL, so that it's
easier for users to recognize and copy-paste URLs.
- The fake paths /http:, /https:, /file:, etc. have been added to the
web_accessible_resources section of the manifest file, in order to
avoid seeing chrome-extension://invalid/ instead of the actual URL
when using history back/forward to navigate from/to the PDF viewer.
- Since the relative path resolving doesn't work because relative URLs
are inaccurate, a <base> tag has been added. This method has already
been proven to work in the Firefox add-on.
Notes:
- This commit has been cherry-picked from crx-using-streams-api.
- Need to merge https://github.com/mozilla/pdf.js/pull/3582 to deal with
a bug in Chrome <=30
- In Chrome, getting the contents of a FTP file is not possible, so
there's no support for FTP files, even though the extension router
recognizes the ftp: scheme.
2013-08-16 05:47:30 +09:00
|
|
|
"content/web/viewer.html",
|
|
|
|
"http:/*",
|
|
|
|
"https:/*",
|
|
|
|
"ftp:/*",
|
|
|
|
"file:/*",
|
|
|
|
"chrome-extension:/*"
|
2013-04-04 07:28:45 +09:00
|
|
|
]
|
2011-10-19 02:43:43 +09:00
|
|
|
}
|