add support for poll pages

This commit is contained in:
Zamicol 2018-11-19 23:59:07 -07:00
parent 11c3c4b114
commit fb325a7ae4
1 changed files with 6 additions and 0 deletions

View File

@ -2,6 +2,12 @@ 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
}
return {redirectUrl: oldReddit + details.url.match(/^https?:\/\/[^\/]+([\S\s]*)/)[1]}
},
{