mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 06:38:07 +02:00
- Replace DOM-based pdfHandler.html (background page) with background.js (extension service worker). - Adjust logic of background scripts to account for the fact that the scripts can execute repeatedly during a browser session. Primarily, register relevant extension event handlers at the top level and use in-memory storage.session API to keep track of initialization state. - Extension URL router: replace blocking webRequest with the service worker-specific "fetch" event. - PDF detection: replace blocking webRequest with declarativeNetRequest. This requires Chrome 128+. The next commit will add a fallback for earlier Chrome versions.
58 lines
1.3 KiB
JSON
58 lines
1.3 KiB
JSON
{
|
|
"minimum_chrome_version": "88",
|
|
"manifest_version": 3,
|
|
"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": [
|
|
"alarms",
|
|
"declarativeNetRequestWithHostAccess",
|
|
"webRequest",
|
|
"tabs",
|
|
"webNavigation",
|
|
"storage"
|
|
],
|
|
"host_permissions": ["<all_urls>"],
|
|
"content_scripts": [
|
|
{
|
|
"matches": ["http://*/*", "https://*/*", "file://*/*"],
|
|
"run_at": "document_start",
|
|
"all_frames": true,
|
|
"css": ["contentstyle.css"],
|
|
"js": ["contentscript.js"]
|
|
}
|
|
],
|
|
"storage": {
|
|
"managed_schema": "preferences_schema.json"
|
|
},
|
|
"options_ui": {
|
|
"page": "options/options.html"
|
|
},
|
|
"options_page": "options/options.html",
|
|
"background": {
|
|
"service_worker": "background.js"
|
|
},
|
|
"incognito": "split",
|
|
"web_accessible_resources": [
|
|
{
|
|
"resources": [
|
|
"content/web/viewer.html",
|
|
"http:/*",
|
|
"https:/*",
|
|
"file:/*",
|
|
"chrome-extension:/*",
|
|
"blob:*",
|
|
"data:*",
|
|
"filesystem:/*",
|
|
"drive:*"
|
|
],
|
|
"matches": ["<all_urls>"],
|
|
"extension_ids": ["*"]
|
|
}
|
|
]
|
|
}
|