Created
May 22, 2014 11:10
-
-
Save codeout/6835610480bbe5c6b981 to your computer and use it in GitHub Desktop.
chrome.webRequest patch for autopagerize
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/background.js b/src/background.js | |
index 9c0b369..e406ec8 100644 | |
--- a/src/background.js | |
+++ b/src/background.js | |
@@ -213,11 +213,11 @@ chrome.webRequest.onHeadersReceived.addListener( | |
details.responseHeaders, | |
xhrHeaderFinalURL, details.url | |
) | |
- return { | |
- cancel: !isSameOrigin( | |
- details.url, checkReqs[details.requestId] | |
- ), | |
- responseHeaders: headers | |
+ | |
+ if(isSameOrigin(details.url, checkReqs[details.requestId])) { | |
+ return {responseHeaders: headers} | |
+ } else { | |
+ return {cancel: true} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment