| 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) |
| { |