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

Unified Diff: popupBlocker.js

Issue 5133931611422720: Simplified and removed memory leaks from code dealing with frames on Chrome (Closed)
Patch Set: Created Feb. 25, 2014, 5:52 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
Index: popupBlocker.js
===================================================================
--- a/popupBlocker.js
+++ b/popupBlocker.js
@@ -22,9 +22,9 @@
chrome.webNavigation.onCreatedNavigationTarget.addListener(function(details)
{
var sourcePage = new ext.Page({id: details.sourceTabId});
- var sourceFrame = new ext.Frame({frameId: details.sourceFrameId, tabId: details.sourceTabId});
+ var sourceFrame = ext.getFrame(details.sourceTabId, details.sourceFrameId);
- if (isFrameWhitelisted(sourcePage, sourceFrame))
+ if (!sourceFrame || isFrameWhitelisted(sourcePage, sourceFrame))
return;
var openerUrl = sourceFrame.url;
« chrome/ext/background.js ('K') | « chrome/ext/background.js ('k') | webrequest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld