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

Issue 5673543668858880: Issue 451 - Fall back to the first known frame instead of hard-coding the top level frame (Closed)

Created:
May 9, 2014, 5:49 p.m. by Sebastian Noack
Modified:
May 15, 2014, 9:39 a.m.
Reviewers:
Wladimir Palant
Visibility:
Public.

Description

If we encounter an unknown frame on Chrome we fall back to the top level frame. However there are cases where the top level frame is unknown too, for example if it is an extension page, see #451. So we have to fall back to the first known frame, instead hard-coding frames[0].

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M chrome/ext/background.js View 1 chunk +1 line, -1 line 1 comment Download

Messages

Total messages: 2
Sebastian Noack
May 9, 2014, 5:53 p.m. (2014-05-09 17:53:57 UTC) #1
Wladimir Palant
May 13, 2014, 2:29 p.m. (2014-05-13 14:29:49 UTC) #2
LGTM

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

http://codereview.adblockplus.org/5673543668858880/diff/5629499534213120/chro...
chrome/ext/background.js:316: frame = frames[frameId] ||
frames[Object.keys(frames)[0]];
Object.keys() doesn't guarantee a particular order for the properties. However,
for numerical properties both Safari and Firefox seem to return the properties
in ascending order and associating the request with a random frame won't hurt
much - so I guess changing the code here isn't worth the added complexity.

Powered by Google App Engine
This is Rietveld