@@ -28,30 +28,28 @@ HTTPSB.turnOn();
2828/******************************************************************************/
2929
3030function onUpdatedTabsHandler ( tabId , changeInfo , tab ) {
31- // Can this happen?
32- if ( ! tab . url || ! tab . url . length ) {
33- return ;
34- }
35-
36- var pageURL = uriTools . normalizeURI ( tab . url ) ;
37-
38- // console.debug('tabs.onUpdated > tabId=%d changeInfo=%o tab=%o', tabId, changeInfo, tab);
39- var protocol = uriTools . schemeFromURI ( pageURL ) ;
40- if ( protocol !== 'http' && protocol !== 'https' ) {
41- return ;
42- }
43-
4431 // Following code is for script injection, which makes sense only if
4532 // web page in tab is completely loaded.
4633 if ( changeInfo . status !== 'complete' ) {
4734 return ;
4835 }
4936
37+ // Can this happen?
38+ if ( ! tab . url || ! tab . url . length ) {
39+ return ;
40+ }
41+
5042 // rhill 2013-12-23: Compute state after whole page is loaded. This is
5143 // better than building a state snapshot dynamically when requests are
5244 // recorded, because here we are not afflicted by the browser cache
5345 // mechanism.
54- var pageStats = HTTPSB . pageStatsFromPageUrl ( pageURL ) ;
46+
47+ // rhill 2014-03-05: Use tab id instead of page URL: this allows a
48+ // blocked page using HTTPSB internal data URI-based page to be properly
49+ // unblocked when user un-blacklist the hostname.
50+ // https://github.com/gorhill/httpswitchboard/issues/198
51+
52+ var pageStats = HTTPSB . pageStatsFromTabId ( tabId ) ;
5553 if ( pageStats ) {
5654 pageStats . state = HTTPSB . computeTabState ( tabId ) ;
5755 }
0 commit comments