Files
Librarian-Redirects/js/background.js
T
video-prize-ranch 0071403d34 first commit
2021-11-23 19:10:03 -05:00

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"],
);