mirror of
https://github.com/bytedream/stream-bypass.git
synced 2025-06-06 08:54:12 +02:00
Refactor, complete past changes & change manifest back to version 2
This commit is contained in:
parent
923787bedb
commit
a55c455fcc
@ -5,10 +5,9 @@ async function main() {
|
||||
if (await getAllDisabled()) {
|
||||
return
|
||||
}
|
||||
const disabled = await getDisabled()
|
||||
|
||||
for (const match of matches) {
|
||||
if (disabled.some((v) => v == match) || !match.domains.some((v) => window.location.host.indexOf(v) !== -1)) {
|
||||
if (!match.domains.some((v) => window.location.host.indexOf(v) !== -1) || ((await getDisabled()).some((v) => v === match))) {
|
||||
continue
|
||||
}
|
||||
|
||||
@ -18,7 +17,7 @@ async function main() {
|
||||
}
|
||||
|
||||
const url = await match.match(re)
|
||||
location.assign(url.indexOf('.m3u8', url.length - 5) === -1 ? url : chrome.runtime.getURL(`ui/hls/hls.html?id=${match.id}&url=${encodeURIComponent(url)}`))
|
||||
location.assign(chrome.runtime.getURL(`ui/player/player.html?id=${match.id}&url=${encodeURIComponent(url)}`))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"manifest_version": 2,
|
||||
"name": "Stream Bypass",
|
||||
"author": "ByteDream",
|
||||
"description": "A multi-browser addon / extension for multiple streaming providers which redirects directly to the source video.",
|
||||
@ -34,25 +34,24 @@
|
||||
"run_at": "document_end"
|
||||
}
|
||||
],
|
||||
"background": {
|
||||
"scripts": [
|
||||
"background.js"
|
||||
]
|
||||
},
|
||||
"permissions": [
|
||||
"storage"
|
||||
],
|
||||
"action": {
|
||||
"default_icon": "icons/stream-bypass.png",
|
||||
"browser_action": {
|
||||
"default_icon": {
|
||||
"48": "icons/logo_48.png",
|
||||
"128": "icons/logo_128.png"
|
||||
},
|
||||
"default_title": "Stream Bypass",
|
||||
"default_popup": "ui/popup/popup.html"
|
||||
},
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
"resources": [
|
||||
"ui/hls/*"
|
||||
],
|
||||
"matches": [
|
||||
"<all_urls>"
|
||||
]
|
||||
}
|
||||
],
|
||||
"icons": {
|
||||
"128": "icons/stream-bypass.png"
|
||||
"48": "icons/logo_48.png",
|
||||
"128": "icons/logo_128.png"
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user