// Background.js console.log("background.js"); // Listener from the chrome.runtime.sendMessage used on the content.js chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { if (request.message === "obscured") { // Create the popup right after the permission prompt is summoned // And above the permission Window with instructions the user gonna do // For example with TAB TAB ENTER the user could be accepting a permission from any malicious site without his real consent setTimeout(() => { chrome.windows.create({ url: chrome.runtime.getURL("popup.html"), focused: false }); }, 1000); } });