Implement userScripts permission prompt (mobile)
Categories
(Firefox for Android :: WebExtensions, task, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox138 | --- | verified |
People
(Reporter: robwu, Assigned: robwu)
References
(Blocks 1 open bug)
Details
(Whiteboard: [addons-jira])
Attachments
(6 files)
The "userScripts" permission requires double confirmation as described at https://bugzilla.mozilla.org/show_bug.cgi?id=1917000#c1
Bug 1917000 will add the permission string, and bug 1931554 will add the extra notice in the Extensions Manager. In this bug we should implement the permission prompt with checkbox as specified in bug 1917000 and visualized at the right of https://bugzilla.mozilla.org/show_bug.cgi?id=1917000#c3.
Updated•1 year ago
|
| Assignee | ||
Comment 1•9 months ago
|
||
This patch renders the userScripts permission with a checkbox instead of
a visual non-interactive checkmark.
The "Allow" button cannot be clicked until the checkbox is checked.
| Assignee | ||
Comment 2•9 months ago
|
||
In preparation for adding a "disabled" button style, I noticed that the
current button colors follow an old design system. This patch updates
the colors to the latest version, and defines the aliases for the
"disabled" style, which will be used in the next patch.
The current button in extension permission prompts background has the
"accent" color because it was the design at the time of introduction, in
https://github.com/mozilla-mobile/fenix/issues/8593
The "action primary" style was introduced in
https://github.com/mozilla-mobile/fenix/issues/24055
... but not applied to the existing button.
Comparison of colors (for regular and private browsing):
Before: R.attr.accent
- @color/accent_normal_theme = @color/photonViolet50
- @color/accent_private_theme = @color/photonViolet50
After: R.attr.actionPrimary
- @color/fx_mobile_action_color_primary = @color/photonInk20
- @color/fx_mobile_private_action_color_primary = @color/photonViolet60
New: R.attr.actionPrimaryDisabled
- @color/fx_mobile_action_color_primary_disabled = @color/photonInk20A20
- @color/fx_mobile_private_action_color_primary_disabled = @color/photonViolet60A50 (from fx_mobile_action_color_primary_disabled in values-night/colors.xml)
Before: R.attr.textOnColorPrimary
- @color/fx_mobile_text_color_oncolor_primary = @color/photonLightGrey05
- @color/fx_mobile_private_text_color_oncolor_primary = @color/photonLightGrey05
After: R.attr.textActionPrimary
- @color/fx_mobile_text_color_action_primary = @color/photonLightGrey05
- @color/fx_mobile_private_text_color_action_primary = @color/photonLightGrey05
New: R.attr.textActionPrimaryDisabled
- @color/fx_mobile_text_color_action_primary_disabled = @color/photonDarkGrey90A50
- @color/fx_mobile_private_text_color_action_primary_disabled = @color/photonLightGrey05A40 (from fx_mobile_text_color_action_primary_disabled in values-night/colors.xml)
| Assignee | ||
Comment 3•9 months ago
|
||
| Assignee | ||
Comment 4•9 months ago
|
||
This is based on the design from https://bugzilla.mozilla.org/show_bug.cgi?id=1917000#c3
Updated•9 months ago
|
Updated•9 months ago
|
Comment 6•8 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/6be867ad527f
https://hg.mozilla.org/mozilla-central/rev/3425347a8e40
https://hg.mozilla.org/mozilla-central/rev/3cd62841322c
https://hg.mozilla.org/mozilla-central/rev/b30a8e2d8c4a
Comment 7•8 months ago
|
||
Verified as Fixed. Tested on the latest Nightly for Android (138.0a1 – GV: 20250315022318, AS: 138.20250311050358) on an Oppo Reno 6 5G running Android 13, using the extension linked in https://bugzilla.mozilla.org/show_bug.cgi?id=1931554#c2.
The extension requesting the userScripts optional permission will show a prompt requiring a double confirmation and a warning message stating Unverified scripts can pose security and privacy risks. Only run scripts from extensions or sources you trust..
The double confirmation consists of a checkbox stating Allow unverified third-party scripts to access your data which when not checked will disable the Allow button on the prompt and when checked will enable the Allow button on the prompt.
When the userScripts permission is not granted on the dialog, the optional permission Allow unverified third-party scripts to access your data from the “Permissions” page of the extension will remain disabled. When the permission is allowed on the dialog, the optional permission on the “Permissions” page also gets enabled.
User scripts added in the extension will correctly run if the permission is granted on the dialog and will not run when the permission is not granted, as expected.
For more details, see the attached screenshot.
Comment 8•8 months ago
|
||
Comment 9•8 months ago
|
||
Description
•