Calling alert() from the background script is allowed in Google's Chrome, but not in Firefox (WebExtensions) which I am porting my Chrome extension to.
So, I need a workaround to get an alert dialog up. I'm not asking for anything else other than THE alert dialog.
Sending a message to a content script to call alert() will not suffice since no content scripts may be loaded at the time the alert call is needed.
alert()
dialog, not even something that looks and feels like it. If so, then you are SOL. The text which is output in the console "alert() is not supported in background windows; please use console.log instead." is clear.alert()
is not supported in background scripts. If you want more information, you might check Bug 1203394 - alert() does not work in background scripts which is RESOLVED FIXED with this console output as the result. – Columalert()
? – Columalert()
. This is not saying send a message to an already loaded content script, but actually loading one specifically to handle this issue. This is not an acceptable solution to you, correct? – Columalert()
dialog. It implies the only thing that is acceptable to you is "THE alert dialog" and you want some way to trigger that code within a background script (unlikely to happen). That statement is why I asked for clarification. If you want something that is close to analert()
dialog, then that is possible. – Colum