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

Unified Diff: chrome/background.js

Issue 5133183649579008: Fixed: Popup blocking functionality broken (Closed)
Patch Set: Created Dec. 20, 2013, 3:08 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 | popupBlocker.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/background.js
===================================================================
--- a/chrome/background.js
+++ b/chrome/background.js
@@ -191,6 +191,34 @@
}
};
+ var CreatedNavigationEventTarget = function()
+ {
+ WrappedEventTarget.call(this, chrome.webNavigation.onCreatedNavigationTarget);
+ };
+ CreatedNavigationEventTarget.prototype = {
+ __proto__: WrappedEventTarget.prototype,
+ _wrapListener: function(listener)
+ {
+ return function(details)
+ {
+ var tab = null;
+ var sourceTab = null;
+
+ if (details.tabId != -1)
+ tab = new Tab({id: details.tabId, url: details.url});
+
+ if (details.sourceTabId != -1)
+ sourceTab = new Tab({id: details.sourceTabId});
+
+ listener({
+ tab: tab,
+ sourceTab: sourceTab,
+ sourceFrameId: details.sourceFrameId
+ });
+ }
+ }
+ };
+
/* Tabs */
@@ -370,6 +398,10 @@
handlerBehaviorChanged: chrome.webRequest.handlerBehaviorChanged
};
+ ext.webNavigation = {
+ onCreatedNavigationTarget: new CreatedNavigationEventTarget()
+ };
+
ext.contextMenus = {
create: function(title, contexts, onclick)
{
« no previous file with comments | « no previous file | popupBlocker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld