Open Bug 1745931 Opened 2 years ago Updated 1 year ago

External scheme handler configured to "Always ask" can not be launched from add-on background page

Categories

(Core :: Widget: Gtk, defect, P3)

Firefox 95
defect

Tracking

()

UNCONFIRMED

People

(Reporter: manikulin, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0

Steps to reproduce:

I am trying a way to reliably launch external scheme handler from an add-on independently whether regular or privileged page is shown in the current tab.

It is possible to to launch such handler if particular application is configured for the scheme in about:preferences by adding an <iframe> to background page or just assigning URI to window.location in a background script. Unfortunately neither of this two methods works if scheme handler is configured to "Always ask".

  • Choose some scheme that has an installed handler application
  • Set "Always ask" for it on the about:preferences page
  • Load add-on prepared for Bug #1744018 to try <iframe> method or any add-on for window.location method.
  • "Inspect" this add-on and switch to its console.
  • Try window.location = "irc:test" or await launchIframe("irc:test") from console with chosen scheme instead of "irc"
  • Change handler preferences from "Always ask" to particular application and repeat the previous step.

Actual results:

I am filing filing bugs since any method I have tried has some problems or demonstrates inconsistency in behavior.

  • For "Always ask" option for scheme handler both <iframe> and window.location methods does not work, no errors appears in console, error detection for the <iframe> method does not work as well.
  • When particular application is chosen for the scheme or when similar code is executed from a regular page the handler is launched.

It looks like another facet of Bug #1744960 and there is another one that might be loosely related: Bug #1695436

Expected results:

I expect that for "Always ask" configuration application chooser popup appears even when external handler is launched from add-on background page.

Actually I do not mind to switch to another method if it can satisfy the following requirements:

  • Can be used for tab showing regular or privileged page
  • There is a way to detect that handler for particular scheme is not configured yet (to notify the user about the error)

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Priority: -- → P3

Launching external scheme handler by content script is unreliable as well, see the Bug #1813975.

You need to log in before you can comment on or make changes to this bug.