Make Google Chrome Extension Automatically Pop Up

Viewed 733

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?

2 Answers

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)
Related