Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: webrequest.js

Issue 6393086494113792: Issue 154 - Added devtools panel showing blocked and blockable items (Closed)
Left Patch Set: Use chrome.runtime.onConnect directly Created Feb. 2, 2016, 11:19 a.m.
Right Patch Set: Adapt for UI changes generating domain specific filters when necessary Created Feb. 3, 2016, 10:40 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « popupBlocker.js ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 function onBeforeRequest(url, type, page, frame) 65 function onBeforeRequest(url, type, page, frame)
66 { 66 {
67 if (checkWhitelisted(page, frame)) 67 if (checkWhitelisted(page, frame))
68 return true; 68 return true;
69 69
70 var urlString = stringifyURL(url); 70 var urlString = stringifyURL(url);
71 var docDomain = extractHostFromFrame(frame); 71 var docDomain = extractHostFromFrame(frame);
72 var thirdParty = isThirdParty(url, docDomain); 72 var thirdParty = isThirdParty(url, docDomain);
73 var key = getKey(page, frame); 73 var key = getKey(page, frame);
74 74
75 var specificOnly = checkWhitelisted( 75 var specificOnly = !!checkWhitelisted(
76 page, frame, RegExpFilter.typeMap.GENERICBLOCK 76 page, frame, RegExpFilter.typeMap.GENERICBLOCK
77 ); 77 );
78 78
79 var filter = defaultMatcher.matchesAny( 79 var filter = defaultMatcher.matchesAny(
80 urlString, RegExpFilter.typeMap[type], 80 urlString, RegExpFilter.typeMap[type],
81 docDomain, thirdParty, key, specificOnly 81 docDomain, thirdParty, key, specificOnly
82 ); 82 );
83 83
84 setTimeout(onBeforeRequestAsync, 0, page, urlString, 84 setTimeout(onBeforeRequestAsync, 0, page, urlString,
85 type, docDomain, 85 type, docDomain,
(...skipping 25 matching lines...) Expand all
111 111
112 chrome.webRequest.onHeadersReceived.addListener( 112 chrome.webRequest.onHeadersReceived.addListener(
113 onHeadersReceived, 113 onHeadersReceived,
114 { 114 {
115 urls: ["http://*/*", "https://*/*"], 115 urls: ["http://*/*", "https://*/*"],
116 types: ["main_frame", "sub_frame"] 116 types: ["main_frame", "sub_frame"]
117 }, 117 },
118 ["responseHeaders"] 118 ["responseHeaders"]
119 ); 119 );
120 } 120 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld