diff --git a/src/js/main.js b/src/js/main.js index 90af090..681cc17 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -58,7 +58,8 @@ browser.tabs.onUpdated.addListener( function onTabUpdatedStatusListener(tabId,changeInfo,tabInfo){ let securityInfo,secType,certChain,browserActionSpec,extraCmds=[]; try { - securityInfo=cachedSecurityInfosByTabIdAndURL[tabId][tabInfo.url]; + let url=removeFragment(tabInfo.url); + securityInfo=cachedSecurityInfosByTabIdAndURL[tabId][url]; if(changeInfo.status=='complete' && securityInfo) extraCmds={enable:tabId}; secType=identifySecType(securityInfo); certChain=securityInfo.certificates; diff --git a/src/js/util.js b/src/js/util.js index f83b52b..b17d324 100644 --- a/src/js/util.js +++ b/src/js/util.js @@ -7,6 +7,13 @@ function getAsset(path){ return xhr.response; } +function removeFragment(url){ + //Removes the fragment from a URL + let u=new URL(url); + u.hash=''; + return u.toString(); +} + function intDiv(a,b=100){ //Functions as e.g. Python's integer division //Divides then casts directly to integer