openDialog

Rob Wu rwu at mozilla.com
Fri Jun 23 13:09:56 UTC 2017


The prompt() function (along with other modal dialogs) cannot be opened
from the background page of the WebExtension.

In your example, it seems better to attach a popup to your action button.
Then the popup is opened in response to clicking on the button, and the
popup will automatically disappear when the user removes the focus from the
popup panel.
See https://developer.mozilla.org/en-US/Add-ons/WebExtensions/
user_interface/Popups

--- Rob <https://robwu.nl>

On Thu, Jun 22, 2017 at 1:33 AM, Eric H. Jung <grimholtz at gmail.com> wrote:

> Not sure what data you're gathering in that dialog, but you can use
> prompt() to ask the user a question and get a string in return.
>
> Eric Jung
>
>
> On Jun 21, 2017 11:53 AM, "Andrew McKay" <amckay at mozilla.com> wrote:
>
>> Hi there,
>>
>> openDialog or xul is not available in WebExtensions.
>>
>> I think you'll have to open a window or an iframe.
>>
>> On 21 June 2017 at 06:38, Capt'n Flash <contact at captnflash.fr> wrote:
>>
>>> Hello,
>>>
>>>
>>>
>>> We are trying to migrate our Firefox extension to the new webextension
>>> standard.
>>>
>>>
>>>
>>> Actually, when we click on a button, we are able to open a modal dialog.
>>>
>>> The goal of this dialog is to prompt a message from the user, and to
>>> save the result in a variable.
>>>
>>>
>>>
>>> We to it llike this :
>>>
>>>
>>>
>>> openDialog("chrome://myextension/content/addcomment.xul", "", "resizable=yes,
>>> modal", params, retVals).focus();
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> I need to keep this functionnality with webextension, but I get this
>>> error message : *openDialog is not a function*
>>>
>>>
>>>
>>> How can I do this with webextensions ?
>>>
>>>
>>>
>>>
>>>
>>> Thanks you in advance for your help,
>>>
>>>
>>>
>>>
>>>
>>> Regards,
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Webextensions-support mailing list
>>> Webextensions-support at mozilla.org
>>> https://mail.mozilla.org/listinfo/webextensions-support
>>>
>>>
>>
>> _______________________________________________
>> Webextensions-support mailing list
>> Webextensions-support at mozilla.org
>> https://mail.mozilla.org/listinfo/webextensions-support
>>
>>
> _______________________________________________
> Webextensions-support mailing list
> Webextensions-support at mozilla.org
> https://mail.mozilla.org/listinfo/webextensions-support
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/webextensions-support/attachments/20170623/86be704a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 31706 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/webextensions-support/attachments/20170623/86be704a/attachment-0001.jpg>


More information about the Webextensions-support mailing list