Skip to content Skip to sidebar Skip to footer

HTML Transient Modal Window

We have a legacy web application. At various places it opens a window with the help of Privilege Manager on Firefox to get the needed result. Some of these windows open a Java appl

Solution 1:

The Privilege Manager was deprecated in Firefox 12 and removed in Firefox 17 (briefly restored).

You might want to look into Window.showModalDialog(). However, it is deprecated and is expected to go away within the year, or in 2016 if you go with an extended service release (ESR) of Firefox 38. It may be a temporary solution while you develop an extension.

In order to accomplish the same tasks, you will need to write an extension and ask the user to install it (from Bypassing Security Restrictions and Signing Code, the old information about Privilege Manager):

Sites that require additional permissions should now ask Firefox users to install an extension, which can interact with non-privileged pages if needed.

It is possible to write such an extension using any of the three different extension types:

  1. XUL overlay
  2. Restartless/Bootstrap
  3. Add-on SDK

For the first two types, you would use window.open(). The modal option is in "Features requiring privileges". You will probably also want to look at Window.openDialog().

For the Add-on SDK, you would normally use the open() function in the SDK's window/utils module. Here, again, you will probably want to look at openDialog().

It appears you may be opening content that is supplied from the web in these modal windows. It is unlikely that you will get an extension approved to be hosted on AMO which opens content in such windows which in not included in the add-on release. This does not mean you can not develop the extension and have it installed on your kiosk clients without hosting it on AMO. However, there are additional restrictions in development for Firefox this year which will make this significantly more difficult, see: "Introducing Extension Signing: A Safer Add-on Experience".


Solution 2:

You should be able to get similiar window.open behavior, including support for the modal option from the sdk's window/utils module.

You will have to install the onclick listener with a content script, send a message to the addon-main through its port and then open that window from the addon main.


Post a Comment for "HTML Transient Modal Window"