I would like to trigger a refresh of the content on my popup when it is opened. According to the chrome.browserAction docs chrome.browserAction.onClicked will not fire if the browser action has a popup.
If I refresh the popup content on document ready, it is only refreshed once when the browser is opened (instead of every time the popup is "shown").
Is there an event fired when the user clicks the browser button/the popup is shown?
I really don't want to have to do a setTimeout(refreshContent(), 1000)
on document ready...
Open the Chrome browser and click on the three-dot menu icon in the upper right-corner. Click on More tools >Extensions. You'll see a list of all Chrome extensions and a toggle where you can disable every extension.
Chrome extensions can be either packed or unpacked. Packed extensions are a single file with a . crx extension. Unpacked extensions are a directory containing the extension, including a manifest.
Odd.
I have the following manifest:
{
"name": "A test",
"version": "1.1",
"background": { "scripts": ["background.js"] },
"browser_action": {
"name": "TEts",
"default_popup": "popup.html"
},
"manifest_version": 2
}
I have the following popup.html
<p>Hello</p>
<script src="popup.js">
</script>
popup.js
window.onload = function() {
console.log("onload" + Date())
}
And every time that I go into to inspect the logs via Chrome Dev tools I only see one entry and it is the updated "onload" log with the most recent time which suggests that the page is getting reloaded.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With