| Index: webrequest.js |
| =================================================================== |
| --- a/webrequest.js |
| +++ b/webrequest.js |
| @@ -17,6 +17,7 @@ |
| chrome.webRequest.onBeforeRequest.addListener(onBeforeRequest, {urls: ["http://*/*", "https://*/*"]}, ["blocking"]); |
| chrome.webRequest.onHeadersReceived.addListener(onHeadersReceived, {urls: ["http://*/*", "https://*/*"]}, ["responseHeaders"]); |
| +chrome.tabs.onUpdated.addListener(onUpdated); |
| chrome.tabs.onRemoved.addListener(forgetTab); |
| var onFilterChangeTimeout = null; |
| @@ -50,6 +51,27 @@ |
| var frames = {}; |
| +function onUpdated(tabId, changeInfo, tab) |
| +{ |
| + var url = changeInfo.url; |
| + if (url) |
| + { |
| + if (url.indexOf("#") > -1) |
| + url = url.match(/^(.*?)#/) && RegExp.$1; |
| + var lastURL = tabId in frames && frames[tabId].lastURL; |
| + if (lastURL != url) |
|
Wladimir Palant
2012/11/08 16:58:27
And now try window.history.pushState() to change U
|
| + { |
| + if (lastURL) |
| + forgetTab(tabId); |
| + |
| + if (!(tabId in frames)) |
| + frames[tabId] = {}; |
| + |
| + frames[tabId].lastURL = url; |
| + } |
| + } |
| +} |
| + |
| function onBeforeRequest(details) |
| { |
| if (details.tabId == -1) |