Index: webrequest.js |
=================================================================== |
--- a/webrequest.js |
+++ b/webrequest.js |
@@ -86,12 +86,6 @@ |
{ |
function onHeadersReceived(details) |
{ |
- if (details.tabId == -1) |
Sebastian Noack
2015/05/18 14:48:49
There should always be a tab for requests of type
|
- return; |
- |
- if (details.type != "main_frame" && details.type != "sub_frame") |
- return; |
- |
var page = new ext.Page({id: details.tabId}); |
var frame = ext.getFrame(details.tabId, details.frameId); |
@@ -110,5 +104,12 @@ |
showNotification(notificationToShow); |
} |
- chrome.webRequest.onHeadersReceived.addListener(onHeadersReceived, {urls: ["http://*/*", "https://*/*"]}, ["responseHeaders"]); |
+ chrome.webRequest.onHeadersReceived.addListener( |
+ onHeadersReceived, |
+ { |
+ urls: ["http://*/*", "https://*/*"], |
+ types: ["main_frame", "sub_frame"] |
+ }, |
+ ["responseHeaders"] |
+ ); |
} |