mirror of
https://codeberg.org/librarian/Librarian-Redirects
synced 2024-12-06 19:16:16 +01:00
19 lines
382 B
JavaScript
19 lines
382 B
JavaScript
window.browser = window.browser || window.chrome;
|
|
|
|
browser.webRequest.onBeforeRequest.addListener(
|
|
(details) => {
|
|
const url = new URL(details.url);
|
|
if (
|
|
url.hostname.endsWith("odysee.com") ||
|
|
url.hostname.endsWith("open.lbry.com")
|
|
) {
|
|
url.hostname = "librarian.bcow.xyz";
|
|
return { redirectUrl: url.href };
|
|
}
|
|
},
|
|
{
|
|
urls: ["<all_urls>"],
|
|
},
|
|
["blocking"],
|
|
);
|