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

Issue 6346177440120832: Added abstraction for frames, to fix domain-based rules, whitelisting and ad counter on Safari (Closed)

Created:
Dec. 21, 2013, 7:48 p.m. by Sebastian Noack
Modified:
Jan. 20, 2014, 8:50 a.m.
Visibility:
Public.

Description

In order to fix whitelisting for Safari, I have added an abstraction layer for frames. So event handlers for ext.webRequest.onBeforeload and ext.onMessage, receive a Frame object, instead of Chrome-specific frame ids, now. Also I had to implement key-based whitelisting via HTML attribute, because of in Safari there is no way to read response headers. This patch is huge since I had to change all code that relied on frames. Also I had to use the onBeforeNavigate event in order to make thing work cross Chrome/Safari. But this event belongs to the webNavigation API on Chromium. So I broke compatibility with Opera 15-16. Please let me know whether whether we can drop compatibility for Opera 15 and 16 (18 is current stable). Otherwise I could easily implement a fallback based on content scripts and the beforeunload event.

Patch Set 1 #

Total comments: 21

Patch Set 2 : Rebased and addressed comments #

Total comments: 1

Patch Set 3 : Addressed another comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+514 lines, -326 lines) Patch
M background.js View 1 5 chunks +14 lines, -39 lines 0 comments Download
M chrome/ext/background.js View 1 2 10 chunks +177 lines, -31 lines 0 comments Download
M chrome/ext/common.js View 1 3 chunks +44 lines, -30 lines 0 comments Download
M chrome/ext/content.js View 1 chunk +1 line, -1 line 0 comments Download
M include.preload.js View 2 chunks +5 lines, -8 lines 0 comments Download
M lib/basedomain.js View 1 chunk +8 lines, -0 lines 0 comments Download
M lib/stats.js View 1 4 chunks +15 lines, -12 lines 0 comments Download
A lib/whitelisting.js View 1 1 chunk +92 lines, -0 lines 0 comments Download
M metadata.common View 1 1 chunk +1 line, -0 lines 0 comments Download
M popup.js View 1 chunk +2 lines, -1 line 0 comments Download
M popupBlocker.js View 1 1 chunk +4 lines, -2 lines 0 comments Download
M safari/ext/background.js View 1 2 9 chunks +69 lines, -35 lines 0 comments Download
M safari/ext/common.js View 1 3 chunks +19 lines, -30 lines 0 comments Download
M safari/ext/content.js View 1 3 chunks +47 lines, -7 lines 0 comments Download
M webrequest.js View 2 chunks +16 lines, -130 lines 0 comments Download

Messages

Total messages: 6
Sebastian Noack
In order to fix whitelisting for Safari, I have added an abstraction layer for frames. ...
Dec. 21, 2013, 8:19 p.m. (2013-12-21 20:19:16 UTC) #1
Wladimir Palant
This seems to be the wrong approach and unnecessarily complicating everything. The natural approach would ...
Jan. 18, 2014, 2:46 a.m. (2014-01-18 02:46:35 UTC) #2
Felix Dahlke
Quite a large patch indeed. Anyway, looks good to me, some of my traditional nit ...
Jan. 18, 2014, 1:39 p.m. (2014-01-18 13:39:19 UTC) #3
Sebastian Noack
On 2014/01/18 02:46:35, Wladimir Palant wrote: > This seems to be the wrong approach and ...
Jan. 19, 2014, 10:19 a.m. (2014-01-19 10:19:28 UTC) #4
Sebastian Noack
http://codereview.adblockplus.org/6346177440120832/diff/5629499534213120/chrome/ext/background.js File chrome/ext/background.js (right): http://codereview.adblockplus.org/6346177440120832/diff/5629499534213120/chrome/ext/background.js#newcode417 chrome/ext/background.js:417: if (frame) On 2014/01/18 13:39:19, Felix H. Dahlke wrote: ...
Jan. 19, 2014, 10:19 a.m. (2014-01-19 10:19:40 UTC) #5
Felix Dahlke
Jan. 20, 2014, 12:02 a.m. (2014-01-20 00:02:14 UTC) #6
LGTM, one final style nit.

http://codereview.adblockplus.org/6346177440120832/diff/4601851299233792/chro...
File chrome/ext/background.js (right):

http://codereview.adblockplus.org/6346177440120832/diff/4601851299233792/chro...
chrome/ext/background.js:419: else
No else before return, as described in the Mozilla Coding Style.

Powered by Google App Engine
This is Rietveld