Skip to content
Advertisement

How to open Chrome Extension on new window instead of the default popup?

I’m building a Chrome Extension and I need users to be able to “detach” the extension from the default top-right location of the popup when they so desire. Note that I still want the extension to open normally when the icon is clicked. But I need that when a specific button is clicked, for the extension to close and immediately open itself in a new window with specified dimensions and no URL address bar as per the below picture:

enter image description here

I’ve got this code so far but it is not working. Nothing happens when the button is clicked:

JavaScript

What am I missing here?

Advertisement

Answer

I “thinned out” an extension of mine. It should do what you asked and also remember the last position of the detached window.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement