Hilfe durchsuchen

Vorsicht vor Support-Betrug: Wir fordern Sie niemals auf, eine Nummer anzurufen, sie per SMS zu kontaktieren oder persönliche Daten preiszugeben. Bitte melden Sie verdächtige Aktivitäten über die Funktion „Missbrauch melden“.

Learn More

Firefox Add-On need to open an open dialog from the activeTab page

  • 2 Antworten
  • 1 hat dieses Problem
  • 13 Aufrufe
  • Letzte Antwort von jscher2000

more options

Hi all,

i'm currently developing an add-on that has an import from file feature that needs to open an "Open file" dialog, now the problem is that in order to do that i had to do the following:

  • inject some javascript code in the active page as a content script
  • call the execute command from the extension to open the dialog popup (that is actually emulating a click)

I have to do it, because from an extension when a "File open" dialog appear, the extension lose the focus and it is automatically closed, and its context destroyed, so when i actually press open on the dialog, the "caller" is already gone (https://stackoverflow.com/questions/26884140/open-import-file-in-a-chrome-extension/26917671#26917671 you can refer to my stackoverflow question to get an idea of what i was doing)

This works fine in chrome (And it worked for a while on firefox) but probably in the latest months/years (not sure when it happened) it stopped working and when i press the import button nothing happens, after some investigation i found what is the problem: the "block popup" windows option enabled by default (i suppose it is enabled by default i don't remember to have never enabled it), so when i disable it, the feature resume working. What i'm wondering is if there is a way to programmatically add an exception to the popup blocker option while installing the extension, or if there is any way to avoid closing the exception popup when the "File Open" Dialog appears.

Thanks everyone

Alle Antworten (2)

more options

Add-on questions should be posted in the add-ons forum; https://discourse.mozilla-community.org/c/add-ons


more options

You might need to switch from using a BrowserAction popup to using a page in a tab or a separate window (popup/panel), if suitable for your extension.


Stellen Sie eine Frage

Sie müssen sich mit Ihrem Benutzerkonto anmelden, um auf Beiträge zu antworten. Bitte stellen Sie eine neue Frage, wenn Sie noch kein Benutzerkonto haben.