I am trying to close a window opened with browser.windows.create
the issue is that code is on a browser action file loaded inn an html file. So when that window of the menu is closed the execution is stopped.
I am trying to do a window that when you share a link on a social network the window have to auto close when the url change.
The code is on: https://github.com/Mte90/Share-Backported/blob/master/modal/modal.js#L35
As I can see the only way is with a background script with an interval that getAll
the window with something:
browser.windows.getAll({ windowTypes: ["popup"] }).then(logTabsForWindows, onError);
And do something on it when there is the change of the url.
Someone has other ideas?