Why different versions of Mozilla display alert message window in different manners?

Hi, friends!
I have simple web extension with sidebar and button on it.
Button click calls alert() function.

HTML:

<!DOCTYPE html>
<html>
  <head>
 <meta charset="utf-8">
 <link rel="stylesheet" href="panel.css"/>
   </head>
 
 <body>
  <h2 id="pr" style="text-align: center">Sidebar & alert()</h2>
 
   <form action="">
    <input id="alert_button" type="button" value="Alert Message">
   </form>
 
  <script src="panel.js"></script>
  </body>
 
 </html>

Javascript:

var ab = document.getElementById("alert_button");
ab.addEventListener("click", clickAlertButton);

function clickAlertButton() {
	alert("This is alert message"); 
}

And I test extension on two versions Mosilla:
Firefox 55.0.2 for Linux -


and Firefox Quantum 59.0.1 for Win 10:

So, I have question. Why different versions of Mozilla display alert message window in different manners?

Firefox for Linux display this window on the main browser window:


but for Win 10 - in sidebar window:

First behaviour is more nice. But second - not convinient.
Whether it is possible to force Win10 Firefox to work as Linux Firefox?

In Firefox, the sidebar and the page content are in different context & scope.
That is a security measure so the two cant interact directly as they have different privileges. Sidebar has far more privileges than the page content.
That should be the same across all platforms and if it isn’t yet, it will be.

That means the alert() from sidebar belongs to sidebar and should show in sidebar (ugly but correct).

On Linux you are using Firefox 55 which is pre-Quantum so not all new security measures have been applied as it is still a legacy version.

On Windows you are using Firefox 59 which is post-Quantum.

Whether correctly I have understood that in the future and Linux alert() there will be “ugly” too?

My updated answer, should answer your question. :slight_smile:

Excuse me please, I have hurried with this question.

And whether there is some way to display the similar message in page content?

Sure…
You would need to get the active Tab first using tabs.query() and then inject the alert() in the page content using tabs.executeScript().

Personally, I often use the notification API instead of modal alert(). There is a plan (both Firefox & Chrome) to remove modal pop-ups (alert/confirm/prompt) in future.

It is intresting.

Is notification API modal window too? Is it prevents the user from accessing the rest of the program’s interface until the dialog box is closed?
I will try to understand

Thank you very much!
I’ll try both way.

The WebExtension notifications.create() isn’t modal. :wink:

Please also note the Firefox prevents tabs.executeScript() on some pages (like addons.mozilla.org or about:* etc).
Chrome also has some restriction on some of its pages.

thanks, ok
I will take into consideration :slightly_smiling_face: