Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Do not allow modal dialogs (wait for firefox 59) #12

@ghost

Description

At the moment there is no WebExtension API to close modal dialogs (window.alert(), etc). browser.tabs.remove has no effect when a modal dialog is displayed. So this means that a modal dialog blocks the entire script run and keeps the window open.

However firefox 59 offers a new API that we could use: browser.contentScripts.register()
This would let us block all modal dialogs for the duration of the script run, for example:

exportFunction(() => {}, window, {defineAs: 'alert'});

And by removing the registration after a script run we can still allow dialogs for normal website after the script run. In principal we could already apply this hack right now, however we would be too late because we need to communicate with the background script first.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions