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: Addressed comment Created March 31, 2014, 3:43 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 | « chrome/ext/background.js ('k') | webrequest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « chrome/ext/background.js ('k') | webrequest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld