mirror of
https://github.com/bytedream/stream-bypass.git
synced 2025-12-13 07:32:07 +01:00
* add Kwik, use unpacker to improve reliabilty
* use packer for filemoon
* use packer for upstream
* add ff2mpv setting + functionality
* Update README.md
* get rid of @types/webextension-polyfill
* Revert "Update README.md"
This reverts commit affb600096.
* Update README.md
* Update info link for ff2mpv
* add kwik to hosters in readme
* removes console.logs
* Delete package-lock.json
* add package-lock.json to .gitignore
* unpack without using eval
* Merge main branch into here
* Add Dropload Hoster
* Add Supervideo Hoster
* Add GoodStream Hoster
* Add hosters to readme and delete console.logs
* Delete package-lock.json
* Fix ff2mpv info url
* Update readme
---------
Co-authored-by: bytedream <bytedream@protonmail.com>
26 lines
860 B
TypeScript
26 lines
860 B
TypeScript
import {getMatch} from "./match/match";
|
|
import {storageDelete, storageGet, storageSet} from "./store/store";
|
|
import {Match} from "./match/matches";
|
|
|
|
chrome.runtime.onMessage.addListener((message, sender) => {
|
|
if (message.action == "ff2mpv") {
|
|
chrome.runtime.sendNativeMessage("ff2mpv", {url: message.url})
|
|
.catch((error) => {console.error(error)})
|
|
}
|
|
})
|
|
|
|
chrome.webRequest.onBeforeRedirect.addListener(async details => {
|
|
// check if redirects origins from a previous redirect
|
|
if (await storageGet('redirect') === undefined) {
|
|
let match: Match
|
|
if ((match = await getMatch(new URL(details.url).host)) !== undefined) {
|
|
await storageSet('redirect', match.id)
|
|
}
|
|
} else {
|
|
await storageDelete('redirect')
|
|
}
|
|
}, {
|
|
urls: ['<all_urls>'],
|
|
types: ['main_frame', 'sub_frame']
|
|
})
|