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

Unified Diff: chrome/ext/background.js

Issue 29362558: Issue 4647,4598 - More eagerly record URL of new frames (Closed)
Patch Set: Created Nov. 15, 2016, 4:12 p.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: chrome/ext/background.js
diff --git a/chrome/ext/background.js b/chrome/ext/background.js
index 0c8bdfc289fc8276fa7a8c6b5f171ad41e729328..65edc7e03c9c4203299bbcde9500781a63bee97b 100644
--- a/chrome/ext/background.js
+++ b/chrome/ext/background.js
@@ -128,6 +128,13 @@
// Capture parent frame here because onCommitted doesn't get this info.
var frame = createFrame(details.tabId, details.frameId);
frame.parent = framesOfTabs[details.tabId][details.parentFrameId] || null;
+
+ // Frames are assumed to always have a URL, so for new frames it's better to
+ // record the URL now. Otherwise requests new frames make before their
+ // onCommitted event fires won't be subject to blocking and will cause
+ // exceptions.
+ if (!("url" in frame))
+ frame.url = new URL(details.url);
});
var eagerlyUpdatedPages = new ext.PageMap();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld