I am making a google chrome extension. Is there a way to use javascript to make the extension automatically pop-up every time I switch to a new tab without having to click on the icon?
I am making a google chrome extension. Is there a way to use javascript to make the extension automatically pop-up every time I switch to a new tab without having to click on the icon?
If you want your javascript to be injected into every page (and then you decide if you want to do a in page popup from there). You would use content scripts.
https://developer.chrome.com/docs/extensions/mv3/content_scripts/#functionality
I have a workaround for you, it is to create a sticky dialog container, create it from your contents.js, make the container style a fixed position.
In ES5 syntax:
var container = document.createElement('div')
container.style.position = "fixed"
container.style.height = "50px"
container.style.width = " 100px"
container.style.top = "0px"
container.style.right = "0px"
container.style.border = "1px solid black"
container.style.backgroundColor = "white"
document.body.appendChild(container)