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