Open Bug 1695436 Opened 4 years ago Updated 3 years ago

Always ask URL scheme handler doesn't work in addon options page

Categories

(Toolkit :: Add-ons Manager, defect, P3)

Firefox 86
defect

Tracking

()

Tracking Status
firefox86 --- affected
firefox87 --- affected
firefox88 --- affected

People

(Reporter: firefox, Unassigned, Mentored)

Details

(Keywords: good-first-bug)

Attachments

(9 files)

Attached file manifest.json

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36

Steps to reproduce:

  1. Open Preferences
  2. In Applications, Content Type mailto:, select "Always ask"
  3. Open about:debugging
  4. Select "This Firefox"
  5. Load Temporary Add-on
  6. Select the attached manifest.json file
  7. Open about:addons
  8. Select "Always ask test"
  9. Select Preferences
  10. Click mailto:foo@bar.com link

Actual results:

Nothing.

In the browser console, there's an error "Node.insertBefore: Adopting nodes across docgroups in chrome documents is unsupported"

Expected results:

Choose an application to open the mailto link.

Attached file options.html
Attached image Alwaysask.png
Attached image addons.png
Attached image BrowserConsole.png
Attached image Choose.png
Attached image UseMail.png

The Bugbug bot thinks this bug should belong to the 'Toolkit::Add-ons Manager' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Add-ons Manager
Product: Firefox → Toolkit

"Always ask" used to work in the addons options page. I don't know when it broke.

If you switch Preferences to "Use Mail (default)", then the mailto link works.

This bug also exists in Firefox Developer Edition 87.0b3

Hello,

I’ve managed to reproduce the issue on the latest Nightly (88.0a1/20210301093612), Beta (87.0b4/20210228185859) and Release (86.0/20210222142601) under Windows 10 x64 and Ubuntu 16.04 LTS, using the provided extension.

After clicking on the mailto:foo@bar.com link from the add-ons options page, nothing happens and the
"Node.insertBefore: Adopting nodes across docgroups in chrome documents is unsupported" is logged in the browser console, as mentioned in the issue’s description.

Also, as per Comment 8, using the default setting for mailto ("Use Mail (default)"), the mailto link works as expected.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(tomica)

Jeff, could you click on the triangle at the left to expand the error message, so we can see the stack trace of the error?

Strange "Choo" as "location" in the console... I had to see it for myself, and indeed, it's also there when I try it. I attached the Browser Toolbox and put a breakpoint at ContentDispatchChooser.jsm:300 (Nightly from February, 24th) to view error.stack:

TabDialogBox@chrome://browser/content/browser.js:8843:29
getTabDialogBox@chrome://browser/content/tabbrowser.js:813:32
_openDialog@resource://gre/modules/ContentDispatchChooser.jsm:502:42
_prompt@resource://gre/modules/ContentDispatchChooser.jsm:396:18
handleURI@resource://gre/modules/ContentDispatchChooser.jsm:283:38

I suppose that the logic there assumes that the browser of a document is always a <browser> of a <tab>. That assumption is not true.

For about:addons and extension popups, this logic would work: https://searchfox.org/mozilla-central/rev/26330a08b1f9d06938faa0aa5e0f8c7a58064aa2/browser/modules/ExtensionsUI.jsm#40-48

That logic could be used in _openDialog at https://searchfox.org/mozilla-central/rev/26330a08b1f9d06938faa0aa5e0f8c7a58064aa2/toolkit/mozapps/handling/ContentDispatchChooser.jsm#524 or in getTabDialogBox at https://searchfox.org/mozilla-central/rev/26330a08b1f9d06938faa0aa5e0f8c7a58064aa2/browser/base/content/tabbrowser.js#825

Severity: -- → S3
Flags: needinfo?(tomica)
Priority: -- → P3
Mentor: rob
Keywords: good-first-bug

Hi! Is anyone working on this bug? If not, I'd like to take a look.

Hi Richal! Sorry for the late response; this bug is open! To get started, please visit https://wiki.mozilla.org/WebExtensions/Contribution_Onramp.

Ok, that's great - thanks for letting me know. I'll get started on the fix.

Please is this bug fixed?

This bug has not been fixed, patches are welcome (comment 12 explains what needs to be done).

Hi Rob, I am an Outreachy applicant. I have Mozilla development environment working in my system already. I'd like to work on this issue. Thank you

Please where can I find this code to rectify this issue locally?

Comment 12 links to relevant places in the code (in an online viewer of the source code, i.e. Searchfox).

If you'd like to get started with a local checkout, see https://firefox-source-docs.mozilla.org/contributing/index.html and https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html

Assignee: nobody → nafees87n
Status: NEW → ASSIGNED

While looking into this, I noticed that Thunderbird has a special override of PrintUtils.getTabDialogBox:

That's supposedly to get printing to work. Is Thunderbird also affected by this bug (i.e. inability to confirm protocol handlers), because of the reliance of ContentDispatchChooser.jsm on gBrowser at https://searchfox.org/mozilla-central/rev/1e7f7235cf822e79cd79ba9e200329ede3d37925/toolkit/mozapps/handling/ContentDispatchChooser.jsm#533 ?

Flags: needinfo?(geoff)

It's slightly confused by the fact that Thunderbird is a mailto: protocol handler, but if I click on the macappstore: link or change the code to some other protocol, I get the protocol handler window as a real window. So if I'm understanding this right, we're not affected. We're not really using TabDialogBoxes yet except for printing, so that's probably why.

That said, I have seen the message from "Choo" before when working on things, and the use of gBrowser is probably bad for us.

Flags: needinfo?(geoff)

This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.

Assignee: nafees87n → nobody
Status: ASSIGNED → NEW
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: