mirror of
https://github.com/daniel-j/fimfic2epub.git
synced 2024-05-07 14:03:24 +12:00
manifest-v3
This commit is contained in:
parent
19ee93ab23
commit
15eafe6f3c
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"manifest_version": 3,
|
||||
|
||||
"name": "fimfic2epub",
|
||||
"short_name": "fimfic2epub",
|
||||
|
@ -11,8 +11,7 @@
|
|||
},
|
||||
|
||||
"background": {
|
||||
"scripts": ["build/eventPage.js"],
|
||||
"persistent": false
|
||||
"service_worker": "build/eventPage.js"
|
||||
},
|
||||
|
||||
"content_scripts": [
|
||||
|
@ -23,20 +22,25 @@
|
|||
}
|
||||
],
|
||||
|
||||
"page_action": {
|
||||
"action": {
|
||||
"default_icon": "fimfic2epub-logo.png"
|
||||
},
|
||||
|
||||
"web_accessible_resources": [
|
||||
"fimfic2epub-logo.png"
|
||||
{
|
||||
"resources": ["fimfic2epub-logo.png"],
|
||||
"matches": ["https://www.fimfiction.net/*"]
|
||||
}
|
||||
],
|
||||
|
||||
"permissions": [
|
||||
"storage"
|
||||
],
|
||||
"host_permissions": [
|
||||
"https://fimfiction.net/*",
|
||||
"https://*.fimfiction.net/*",
|
||||
"https://www.googleapis.com/*",
|
||||
"https://i.ytimg.com/*",
|
||||
"https://twemoji.maxcdn.com/*",
|
||||
"storage"
|
||||
"https://twemoji.maxcdn.com/*"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -15,6 +15,10 @@ if (typeof safari !== 'undefined') {
|
|||
})
|
||||
}, false)
|
||||
} else {
|
||||
chrome.runtime.onInstalled.addListener(() => {
|
||||
chrome.action.disable()
|
||||
})
|
||||
|
||||
const onMessage = chrome.extension.onMessage ? chrome.extension.onMessage : chrome.runtime.onMessage
|
||||
|
||||
onMessage.addListener(function (request, sender, sendResponse) {
|
||||
|
@ -28,11 +32,11 @@ if (typeof safari !== 'undefined') {
|
|||
// required for async
|
||||
return true
|
||||
} else if (request.showPageAction) {
|
||||
chrome.pageAction.show(sender.tab.id)
|
||||
chrome.action.enable(sender.tab.id)
|
||||
}
|
||||
})
|
||||
|
||||
chrome.pageAction.onClicked.addListener(function (tab) {
|
||||
chrome.action.onClicked.addListener(function (tab) {
|
||||
chrome.tabs.sendMessage(tab.id, 'pageAction')
|
||||
})
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ try {
|
|||
pageStoryId = document.location.pathname.match(/^\/story\/(\d*)/)[1]
|
||||
} catch (e) {}
|
||||
|
||||
const logoUrl = chrome.extension.getURL('fimfic2epub-logo.png')
|
||||
const logoUrl = chrome.runtime.getURL('fimfic2epub-logo.png')
|
||||
let ffc
|
||||
const stories = document.querySelectorAll('.story_container')
|
||||
|
||||
|
|
Loading…
Reference in a new issue