32313b9149
This is needed for propagating the extension's permissions to the extension's iframe, in the rare event that the PDF is loaded in a sub frame, and the extension does not have access to the top frame. For instance, when a http:-PDF file is embedded in a local file, while "Allow access to local URLs" is disabled. Note: Propagating permissions by inserting content scripts is an undocumented feature (http://crbug.com/302548). Whenever it breaks, the issue (cross-domain permissions for XHR) can be solved by using a content script that gets the blob using the XMLHttpRequest API, followed by `postMessage` (via transferables) to efficiently pass the arraybuffer back to the PDF Viewer.
58 lines
1.6 KiB
JSON
58 lines
1.6 KiB
JSON
{
|
|
"manifest_version": 2,
|
|
"name": "PDF Viewer",
|
|
"version": "PDFJSSCRIPT_VERSION",
|
|
"description": "Uses HTML5 to display PDF files directly in the browser.",
|
|
"icons": {
|
|
"128": "icon128.png",
|
|
"48": "icon48.png",
|
|
"16": "icon16.png"
|
|
},
|
|
"permissions": [
|
|
"webRequest", "webRequestBlocking",
|
|
"<all_urls>",
|
|
"tabs",
|
|
"webNavigation",
|
|
"streamsPrivate"
|
|
],
|
|
/* FOR demo & debugging purposes only! This key is required to get access to the streams API.
|
|
* This key forces the extension ID to be gbkeegbaiigmenfmjfclcdgdpimamgkj (= Chrome Office Viewer)
|
|
* This comment has been added to prevent it from being uploaded to the Chrome Web Store.
|
|
* Remove it when the PDF.js extensionID is whitelisted for the streamsPrivate API.
|
|
*/
|
|
"key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4zyYTii0VTKI7W2U6fDeAvs3YCVZeAt7C62IC64IDCMHvWy7SKMpOPjfg5v1PgYkFm+fGsCsVLN8NaF7fzYMVtjLc5bqhqPAi56Qidrqh1HxPAAYhwFQd5BVGhZmh1fySHXFPE8VI2tIHwRrASOtx67jbSEk4nBAcJz6n+eGq8QIDAQAB",
|
|
"content_scripts": [{
|
|
"matches": [
|
|
"http://*/*",
|
|
"https://*/*",
|
|
"ftp://*/*",
|
|
"file://*/*"
|
|
],
|
|
"js": ["nothing.js"]
|
|
}],
|
|
"mime_types": [
|
|
"application/pdf"
|
|
],
|
|
"background": {
|
|
"page": "pdfHandler.html"
|
|
},
|
|
"page_action": {
|
|
"default_icon": {
|
|
"19": "icon19.png",
|
|
"38": "icon38.png"
|
|
},
|
|
"default_title": "Show PDF URL",
|
|
"default_popup": "pageActionPopup.html"
|
|
},
|
|
"incognito": "split",
|
|
"web_accessible_resources": [
|
|
"getFrameId",
|
|
"content/web/viewer.html",
|
|
"http:/*",
|
|
"https:/*",
|
|
"ftp:/*",
|
|
"file:/*",
|
|
"chrome-extension:/*"
|
|
]
|
|
}
|