Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

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

  • 2 trả lời
  • 1 gặp vấn đề này
  • 12 lượt xem
  • Trả lời mới nhất được viết bởi 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

Tất cả các câu trả lời (2)

more options

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

Hữu ích?

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.

Hữu ích?

Đặt một câu hỏi

Bạn phải đăng nhập vào tài khoản của bạn để trả lời bài viết. Vui lòng bắt đầu một câu hỏi mới, nếu bạn chưa có tài khoản.