19 lines
505 B
JavaScript
19 lines
505 B
JavaScript
const oldReddit = "https://old.reddit.com"
|
|
|
|
chrome.webRequest.onBeforeRequest.addListener(
|
|
function(details) {
|
|
return {redirectUrl: oldReddit + details.url.match(/^https?:\/\/[^\/]+([\S\s]*)/)[1]}
|
|
},
|
|
{
|
|
urls: [
|
|
"*://reddit.com/*",
|
|
"*://www.reddit.com/*",
|
|
"*://np.reddit.com/*",
|
|
"*://new.reddit.com/*"
|
|
"*://pay.reddit.com/*"
|
|
],
|
|
types: ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"]
|
|
},
|
|
["blocking"]
|
|
)
|