Closed Bug 1608373 Opened 4 years ago Closed 4 years ago

Extension no longer works since Firefox 72

Categories

(WebExtensions :: Untriaged, defect)

72 Branch
defect
Not set
normal

Tracking

(firefox-esr68 unaffected, firefox72 wontfix, firefox73 verified, firefox74 verified)

VERIFIED FIXED
mozilla74
Tracking Status
firefox-esr68 --- unaffected
firefox72 --- wontfix
firefox73 --- verified
firefox74 --- verified

People

(Reporter: pedro, Assigned: baku)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

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

Steps to reproduce:

Upgraded to Firefox 72.0.1 in both Linux and Windows. I went straight from 71 to 72.0.1 so I can't be sure if the problem was in 72 or the point release.

In Firefox 71 the ProxySwitcheroo extension worked properly, changing the proxy settings when clicked. Now it no longer works. Code for the extension is here:

https://github.com/pedrocr/proxyswitcheroo

Actual results:

Console prints the following:

Could not map contract ID '@mozilla.org/sharepicker;1' to CID {1201d357-8417-4926-a694-e6408fbedcf8} because no implementation of the CID is registered.
Error: respectBeConservative can be set by privileged extensions only. ExtensionUtils.jsm

I didn't find a way to get a stack trace of that error to be able to understand what call is causing this.

Expected results:

The extension should have switched the proxy setting.

This seems to be caused by #1593651. As respectBeConservative is now returned by browser.proxy.settings.get(), running browser.proxy.settings.set() with the same value returned triggers this. I'm not sure if that was intended, particularly since set() is being called with the same value that get() returned so no change is actually being requested.

Product: Firefox → WebExtensions
Regressed by: 1593651
Has Regression Range: --- → yes

I've fixed this for now by doing something like:

settings = browser.proxy.settings.get()
delete settings.respectBeConservative;
// Change only the settings I care about here
browser.proxy.settings.set({value: settings});

This is brittle as the moment you add another private setting like respectBeConservative that can be queried by anyone but only set by privileged extensions this will break again. If the extension cannot set() respectBeConservative maybe get() shouldn't return it either.

baku, can you look into this?

Flags: needinfo?(amarchesini)
Assignee: nobody → amarchesini
Flags: needinfo?(amarchesini)

Moving this over to General to remove it from Untriaged.

To note that there are two separate issues noticed here:(In reply to Pedro Côrte-Real from comment #0)

Console prints the following:

Could not map contract ID '@mozilla.org/sharepicker;1' to CID {1201d357-8417-4926-a694-e6408fbedcf8} because no implementation of the CID is registered.
Error: respectBeConservative can be set by privileged extensions only. ExtensionUtils.jsm

  1. One being the "Could not map contract ID...." message which started being shown in the extension console after this push:
    Autoland pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=50fbf3477d757aa27f9f3f823606271015cefc0a&tochange=0efb4f268d16e4778ce003629c2cdfeafb1f5c3c
    Mozilla-central pushlog: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=4651f71eeb5476a6dc9002a47a45c3a5b17aba6c&tochange=cad27f93a9869351457fc5d5290777420068e173

Reproduced on Windows 10-64 bit, macOS Catalina 10.15 and Ubuntu 18.04 LTS on Firefox Nightly 74.0a1 (20200112214546), Beta 73.0b4 (20200112220634) and Release 72.0.1 (20200107212822).

  1. The second being the respectBeConservative Error which was identified as a regression from #1593651.

If needed the two can be separated into different tickets.

Status: UNCONFIRMED → NEW
Ever confirmed: true

The "contract ID" line seems unrelated to the problem described here. After working around respectBeConservative the extension seems to be working fine again. Maybe that needs a separate issue but I don't know what the implications of that line are. Functionally I didn't detect anything so far.

Do we think we want this to land in a possible 72 future dot release?

Flags: needinfo?(amarchesini)

Mayhemer, I was wondering if it's better to set 'network.http.proxy.respect-be-conservative' pref to false always when Proxy API is in use. Do you see any good reason to keep it to true when proxy settings are handled by extensions?

Flags: needinfo?(amarchesini) → needinfo?(honzab.moz)

Too late to ship a fix in 72 at this point. It's also getting late in the Fx73 cycle to land a fix.

Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/55e0165160aa
proxy webExtension API should not expose respectBeConservative only to privileged extensions, r=mixedpuppy
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74

Lets see how far we can uplift this

Flags: needinfo?(amarchesini)

Comment on attachment 9120054 [details]
Bug 1608373 - proxy webExtension API should not expose respectBeConservative only to privileged extensions, r?fallen

Beta/Release Uplift Approval Request

  • User impact if declined: Bug 1593651 introduced respectBeConservative property in webExtension proxy API, breaking a few non-privileged extensions. This patch fixes the issue and it would be great if we can uplift to reduce the breakage.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Low risk because the patch makes the proxy API to ignore the value of this attribute for non-privileged extensions.
  • String changes made/needed: none
Flags: needinfo?(amarchesini)
Attachment #9120054 - Flags: approval-mozilla-beta?

Comment on attachment 9120054 [details]
Bug 1608373 - proxy webExtension API should not expose respectBeConservative only to privileged extensions, r?fallen

fix an issue with proxy extensions, approved for 73.0b11

Attachment #9120054 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

"Error: respectBeConservative can be set by privileged extensions only. ExtensionUtils.jsm" message is no longer received in console. Marking this as verified fixed in 73.0b11 Build ID: 20200128001646 and 74.0a1 with Build ID: 20200129093157 on Windows 10 64-bit and Ubuntu 18.04.

Status: RESOLVED → VERIFIED

(In reply to Andrea Marchesini [:baku] from comment #10)

Mayhemer, I was wondering if it's better to set 'network.http.proxy.respect-be-conservative' pref to false always when Proxy API is in use. Do you see any good reason to keep it to true when proxy settings are handled by extensions?

To be honest, I'd start to default this to false and maybe remove eventually (but only after the current coronavirus situation.) Other option is to have some kind of 'in between' option for proxies, perhaps with a fallback to be less restrictive.

Flags: needinfo?(honzab.moz)
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: