diff --git a/background.js b/background.js index 4b0b185..eb52170 100644 --- a/background.js +++ b/background.js @@ -1,13 +1,16 @@ -const oldReddit = "https://old.reddit.com" +const oldReddit = "https://old.reddit.com"; chrome.webRequest.onBeforeRequest.addListener( function(details) { // Exclude poll pages - if (details.url.match(/^https?:\/\/(www.)*reddit.com\/poll/)) { - return + if (details.url.match(/^https?:\/\/(www\.)*reddit.com\/poll/)) { + return; } - return {redirectUrl: oldReddit + details.url.match(/^https?:\/\/[^\/]+([\S\s]*)/)[1]} + return { + redirectUrl: + oldReddit + details.url.match(/^https?:\/\/[^\/]+([\S\s]*)/)[1] + }; }, { urls: [ @@ -17,7 +20,16 @@ chrome.webRequest.onBeforeRequest.addListener( "*://new.reddit.com/*", "*://pay.reddit.com/*" ], - types: ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"] + types: [ + "main_frame", + "sub_frame", + "stylesheet", + "script", + "image", + "object", + "xmlhttprequest", + "other" + ] }, ["blocking"] -) +);