Sensitive sites are being unblocked async (i.e. before the extension is opened). It seems like the JS code runs as soon as the browser and site is loaded, it executes the check for sensitive site and executes the code to unblock the site. The intended functionality is to unblock sensitive sites ONLY when the user clicks on the browser extension and opens the popup, NOT before that.
if (result === 0) {
//Website is sensitive
removeView();
document.getElementById("all-set").style.display = "block";
chrome.scripting.executeScript({
target: {tabId: tabs[0].id},
files: ['contentScript.js']
})
chrome.tabs.sendMessage(tabs[0].id, {action: "removeBlocker"}); // <= this line needs to be executed AFTER the popup is loaded
}
Sensitive sites are being unblocked async (i.e. before the extension is opened). It seems like the JS code runs as soon as the browser and site is loaded, it executes the check for sensitive site and executes the code to unblock the site. The intended functionality is to unblock sensitive sites ONLY when the user clicks on the browser extension and opens the popup, NOT before that.