fenix icon indicating copy to clipboard operation
fenix copied to clipboard

[Bug] Extensions declaring the nativeMessaging permission fail to install

Open dessant opened this issue 6 years ago • 18 comments

Steps to reproduce

Add LastPass Password Manager to a collection and try to install it by following this guide.

Expected behavior

The nativeMessaging permission is ignored and the extension is successfully installed.

Actual behavior

An error message shows up: Failed to install LastPass Password Manager.

Device information

  • Fenix version: 201013 17:00

Notes

Fennec ignores the nativeMessaging permission and the extension is successfully installed.

┆Issue is synchronized with this Jira Task

dessant avatar Oct 14 '20 21:10 dessant

See: https://github.com/mozilla-mobile/fenix/issues/17373 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 20 '21 01:04 stale[bot]

The issue is still relevant.

dessant avatar Apr 20 '21 05:04 dessant

See: https://github.com/mozilla-mobile/fenix/issues/17373 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 17 '21 05:10 stale[bot]

The issue is still relevant.

This is a regression caused by https://github.com/mozilla-mobile/android-components/pull/6052 in an attempt to resolve https://github.com/mozilla-mobile/android-components/issues/6015. That patch rejects add-ons with the "nativeMessaging" permission: https://github.com/mozilla-mobile/android-components/blob/96ae23b628816faeabeee8c91340ae7601743ec1/components/feature/addons/src/main/java/mozilla/components/feature/addons/AddonManager.kt#L359

In my opinion (as a Firefox engineer working on the WebExtension framework in Firefox), the restriction is unnecessary; although "nativeMessaging" has been re-purposed for internal purposes, it is only available with the geckoViewAddons permission, and fails otherwise: https://searchfox.org/mozilla-central/rev/a12c2c2e59c92d8f969d8f3f290ab16919449c9d/toolkit/components/extensions/ExtensionParent.jsm#278-288

To fix this issue, PR https://github.com/mozilla-mobile/android-components/issues/6015 needs to be partially undone, by removing "nativeMessaging". Patches are welcome, I suppose.

EDIT: Fix issue links to point to android-components repo instead of this one.

Rob--W avatar Nov 04 '21 20:11 Rob--W

I don't think we should fix this in the front-end. If Gecko finds a permission that we don't recognize, we ignore it, we don't send it straight to the embedder. In this case the same thing should happen, the permission is ignored if geckoviewAddons is not present (and I think it should also ignored if the addon is not built-in) so the front-end should never get the request for nativeMessaging to begin with. Otherwise they would have to know to not ask the user for permission for nativeMessaging when geckoviewAddons is not present which I think is not the right place to handle that.

@Rob--W do you think that would be possible? I guess worst case scenario we can filter the permission request in GeckoView right before it gets to AC.

agi avatar Nov 05 '21 15:11 agi

@Rob--W do you think that would be possible? I guess worst case scenario we can filter the permission request in GeckoView right before it gets to AC.

I've implemented that in https://bugzilla.mozilla.org/show_bug.cgi?id=1739746. Now there should no longer be an objection against rejecting add-ons with the nativeMessaging permission in A-C/Fenix.

Rob--W avatar Nov 09 '21 16:11 Rob--W

cc @Amejia481 for more experienced input on this issue.

Alexandru2909 avatar Mar 04 '22 08:03 Alexandru2909

It looks like the issue was addressed on Gecko some time ago, @dessant is the issue fixed for you ?

Amejia481 avatar Mar 04 '22 14:03 Amejia481

The gecko part was a blocker to this bug, but the actual change to fix this bug needs to be made in android-components.

As mentioned in a previous comment, https://github.com/mozilla-mobile/android-components/pull/6052 needs to partially be reverted:

  • remove "nativemessaging" from https://github.com/mozilla-mobile/android-components/blob/71e124a5dbafffb800168ea615fdbc54d7398f50/components/feature/addons/src/test/java/AddonManagerTest.kt#L510
  • remove "nativeMessaging" from https://github.com/mozilla-mobile/android-components/blob/71e124a5dbafffb800168ea615fdbc54d7398f50/components/feature/addons/src/main/java/mozilla/components/feature/addons/AddonManager.kt#L359

Such a change would be trivial to make.

Rob--W avatar Mar 04 '22 21:03 Rob--W

Thanks for the clarification!

Amejia481 avatar Mar 04 '22 21:03 Amejia481

This bug has been fixed in Gecko, see https://bugzilla.mozilla.org/show_bug.cgi?id=1759601#c3 and later. I'm resolving this, if anybody can reproduce this please reopen this issue or open a new one.

agi avatar Apr 20 '22 21:04 agi

@agi, I've just tested and both Buster and LastPass fails to install on the latest Nightly, could you reopen the issue?

dessant avatar Jul 01 '22 04:07 dessant

@agi, I've just tested and both Buster and LastPass fails to install on the latest Nightly, could you reopen the issue?

Could you open a new bug report and share the full reproduction steps, to trigger the issue in a new profile?

Rob--W avatar Jul 01 '22 08:07 Rob--W

@Rob--W, the reproduction steps have remained the same: https://github.com/mozilla-mobile/fenix/issues/15904#issue-721795399

dessant avatar Jul 01 '22 12:07 dessant

Hi - I also have this issue with all these addons:

https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/ https://addons.mozilla.org/en-US/firefox/addon/bypass-paywalls-clean/ https://addons.mozilla.org/en-US/firefox/addon/kindle-it/

thekiefs avatar Sep 13 '22 03:09 thekiefs

https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/ https://addons.mozilla.org/en-US/firefox/addon/bypass-paywalls-clean/

I got both installed beforehand reading this.

@thekiefs, this issue is about extensions with the nativeMessaging permission failing to install on Android, those extensions do not have such permission. You could try asking for help here: https://support.mozilla.org/en-US/questions/new/desktop/form

dessant avatar Sep 13 '22 06:09 dessant