2023-02-02 14:36:40 -05:00
|
|
|
chrome.webRequest.onBeforeRequest.addListener(details => {
|
|
|
|
const url = new URL(details.url)
|
2018-04-25 10:43:21 -04:00
|
|
|
|
2023-02-02 14:36:40 -05: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
|
|
|
|
2023-02-02 14:36:40 -05:00
|
|
|
return { redirectUrl: `${details.url}%20fork%3Afalse` }
|
2018-04-25 10:43:21 -04:00
|
|
|
},
|
|
|
|
{
|
2023-02-02 14:36:40 -05:00
|
|
|
urls: [ "https://git.add123.com/*" ],
|
2019-01-09 00:29:22 -05:00
|
|
|
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"]
|
2023-02-02 14:36:40 -05:00
|
|
|
)
|