Merge pull request #10 from zamicol/master

add support for poll pages
This commit is contained in:
Tom Watson 2018-12-06 15:58:14 +01:00 committed by GitHub
commit eb008c724d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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( chrome.webRequest.onBeforeRequest.addListener(
function(details) { 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]} return {redirectUrl: oldReddit + details.url.match(/^https?:\/\/[^\/]+([\S\s]*)/)[1]}
}, },
{ {