Pail/background.js

19 lines
505 B
JavaScript
Raw Normal View History

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/*",
2018-05-03 09:10:45 -04:00
"*://np.reddit.com/*",
"*://new.reddit.com/*"
"*://pay.reddit.com/*"
2018-04-25 10:43:21 -04:00
],
types: ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"]
},
["blocking"]
)