2018-04-25 11:06:59 -04:00
|
|
|
const oldReddit = "https://old.reddit.com"
|
2018-04-25 10:43:21 -04:00
|
|
|
|
|
|
|
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/*"
|
|
|
|
],
|
|
|
|
types: ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"]
|
|
|
|
},
|
|
|
|
["blocking"]
|
|
|
|
)
|