blob: a17cbeefe4841cf0613e5fa500568903a12afd29 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
var targetUrl = "https://www.youtube.com/*";
var disable_option = "disable_polymer=true";
function rewriteUrl(req) {
if (!req.url.includes("disable_polymer"))
if (req.url.includes("?"))
return { redirectUrl: req.url + "&" + disable_option};
else
return { redirectUrl: req.url + "?" + disable_option};
}
browser.webRequest.onBeforeRequest.addListener(
rewriteUrl,
{ urls: [targetUrl], types: ["main_frame"]},
["blocking"]
);
|