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

Unified Diff: webrequest.js

Issue 11579001: Workaround for Chrome not specifying which request is main_frame under some circumstances (Closed)
Patch Set: Added more checks Created Aug. 30, 2013, 8:24 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrequest.js
===================================================================
--- a/webrequest.js
+++ b/webrequest.js
@@ -56,6 +56,13 @@
return {};
var type = details.type;
+
+ // Assume that the first request belongs to the top frame. Chrome may give the
+ // top frame the type "object" instead of "main_frame".
+ // https://code.google.com/p/chromium/issues/detail?id=281711
+ if (details.frameId == 0 && !(details.tabId in frames) && type == "object")
Wladimir Palant 2013/08/30 12:16:25 Please ensure details.tabId >= 0, tabId -1 means a
+ type = "main_frame";
+
if (type == "main_frame" || type == "sub_frame")
recordFrame(details.tabId, details.frameId, details.parentFrameId, details.url);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld