Thanks in advance!
What I want to achieve is to open the popup window when a special tag is detected on a webpage by my extension. After searching for a while it seems like the popup can only be opened when user clicks the extension. Is it true?
Or could I get the location of my extension's icon on browser? Maybe I could draw a window and display under the extension icon to make it looks just like the popup window.
Running in the background also allows any Chrome extensions you might have installed to continue to operate. These are applications that run within Chrome and either enhance the browser's existing features, or add new ones.
Background Pages. A common need for extensions is to have a single long-running script to manage some task or state. Background pages to the rescue. As the architecture overview explains, the background page is an HTML page that runs in the extension process.
This guy wants opposite effect and can't get his popup window not to open. Take a look at his code to open your popup page ;)
It is impossible to get the extension window to open without a user clicking on it... However, you can get the extension popup page to open in a new tab as follows:
1) Set your background page in your manifest file...
"background_page": "background.html",
This is where you will run the code to see whether the special tag is detected... background pages can constantly run code in the background, and it is up to you to set a repeat loop to check whether you variable condition is true every so often...
2) Enable tabs permission in your manifest file...
"permissions": [ "tabs" ],
This permission is needed for step 3 (Allows the background page to open a new tab)
3) In background page, call create
and point to the extension popup url.
if(condition == true){ chrome.tabs.create({url:"popup.html"}); }
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