Pail/background.js

25 lines
592 B
JavaScript
Raw Permalink Normal View History

chrome.webRequest.onBeforeRequest.addListener(details => {
const url = new URL(details.url)
2018-04-25 10:43:21 -04:00
if (url.hostname !== "git.add123.com") return
if (!url.pathname.endsWith("plugins/servlet/search")) return
if (details.url.includes("fork:") || details.url.includes("fork%3A")) return
2021-01-23 08:40:00 -05:00
return { redirectUrl: `${details.url}%20fork%3Afalse` }
2018-04-25 10:43:21 -04:00
},
{
urls: [ "https://git.add123.com/*" ],
types: [
"main_frame",
"sub_frame",
"stylesheet",
"script",
"image",
"object",
"xmlhttprequest",
2021-01-23 08:40:00 -05:00
"other",
],
2018-04-25 10:43:21 -04:00
},
["blocking"]
)