Closed Bug 1336085 Opened 8 years ago Closed 8 years ago

Don't display pending update if there are no new promptable permissions

Categories

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

defect

Tracking

()

VERIFIED FIXED
mozilla54
Tracking Status
firefox51 --- unaffected
firefox52 --- unaffected
firefox53 --- affected
firefox54 --- verified

People

(Reporter: vtamas, Assigned: aswan)

References

Details

(Whiteboard: triaged)

Attachments

(1 file)

[Affected versions]:
Firefox 53.0a2 (2017-02-02)
Firefox 54.0a1 (2017-02-02)

[Affected platforms]:
Windows 10 64-bit
Ubuntu 16.04 32-bit


[Steps to reproduce]:
1.Launch Firefox with clean profile.
2.Create extensions.webextPermissionPrompts and set it to true.
3.Create xpinstall.signatures.dev-root and set it to true.
4.Change extensions.update.background.url to point to dev server and set the update interval (extensions.update.interval) to “1”. 
5.Install the first version of the following webextension: https://addons-dev.allizom.org/en-US/firefox/addon/webext102/versions/
6.Restart the browser. 


[Expected Results]:
The new permissions are mentioned in update installation pop-up.


[Actual Results]:
There are no permissions mentioned in update installation pop-up.
See screenshot: https://www.screencast.com/t/31YVKeob

[Additional Notes]
The following permissions were added to the second version: "storage", "idle", "alarms", "contextMenus".
When designing the permissions copy, it was a deliberate decision not to include everything in the prompts.
See the doc linked from bug 1316996 for a comprehensive list of which permissions get prompts.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
(In reply to Andrew Swan [:aswan] from comment #1)
> When designing the permissions copy, it was a deliberate decision not to
> include everything in the prompts.
> See the doc linked from bug 1316996 for a comprehensive list of which
> permissions get prompts.

Andrew, see the screenshot from the original description: https://www.screencast.com/t/31YVKeob

It doesn't make sense to tell the user "You must approve new permissions" and not list any permission. Should the update be applied automatically in that case?
Status: RESOLVED → REOPENED
Flags: needinfo?(aswan)
Resolution: INVALID → ---
(In reply to Florian Quèze [:florian] [:flo] from comment #2)
> It doesn't make sense to tell the user "You must approve new permissions"
> and not list any permission. Should the update be applied automatically in
> that case?

Yep, thanks for catching that.  Updating the title to clarify the scenario.
Assignee: nobody → aswan
Flags: needinfo?(aswan)
Summary: Several permissions are not mentioned in update installation pop-up → Don't display pending update if there are no new promptable permissions
This got messy and it required not using <stringbundle> any more (since we need to look up strings when considering an update when we might not have an open browser window).  But I think this is good to go now.
Attachment #8834555 - Flags: review?(dtownsend)
Whiteboard: triaged
Comment on attachment 8834555 [details]
Bug 1336085 Apply updates with only non-promptable permissions automatically

https://reviewboard.mozilla.org/r/110442/#review111784

::: browser/modules/ExtensionsUI.jsm:72
(Diff revision 1)
>        }
>      });
>    },
>  
> -  showAddonsManager(browser, info) {
> -    let loadPromise = new Promise(resolve => {
> +  showAddonsManager(browser, strings, icon) {
> +    let tab = browser.addTab();

You shouldn't need to add a new tab, BrowserOpenAddonsMgr will do it if necessary.

::: browser/modules/ExtensionsUI.jsm:182
(Diff revision 1)
>  
> -    let win = target.ownerGlobal;
> +    let bundle = Services.strings.createBundle(BROWSER_PROPERTIES);
>  
>      let name = info.addon.name;
>      if (name.length > 50) {
>        name = name.slice(0, 49) + "…";

I know you didn't add this, but is this correct from an l10n standpoint? Does it work for RTL for example?
Attachment #8834555 - Flags: review?(dtownsend) → review+
Comment on attachment 8834555 [details]
Bug 1336085 Apply updates with only non-promptable permissions automatically

https://reviewboard.mozilla.org/r/110442/#review111784

> You shouldn't need to add a new tab, BrowserOpenAddonsMgr will do it if necessary.

Hm, I did that so I could have a handle on the tab (actually on its <browser> which was needed right below.  Can I just call BrowserOpenAddonsMgr() and then synchronously read `browser.selectedTab` or `.selectedBrowser` and have that be safe?

> I know you didn't add this, but is this correct from an l10n standpoint? Does it work for RTL for example?

I don't know, who is the right person to ask?
(In reply to Andrew Swan [:aswan] from comment #7)

> > I know you didn't add this, but is this correct from an l10n standpoint? Does it work for RTL for example?
> 
> I don't know, who is the right person to ask?

Ah, I had seen this hardcoded ellipsis, wanted to comment, and then forgot :-(.

See http://searchfox.org/mozilla-central/search?q=intl.ellipsis for what other code does.

And flod is the right person to ask.
Flags: needinfo?(francesco.lodolo)
Comment on attachment 8834555 [details]
Bug 1336085 Apply updates with only non-promptable permissions automatically

https://reviewboard.mozilla.org/r/110442/#review111784

> Hm, I did that so I could have a handle on the tab (actually on its <browser> which was needed right below.  Can I just call BrowserOpenAddonsMgr() and then synchronously read `browser.selectedTab` or `.selectedBrowser` and have that be safe?

Also, looking more closely, BrowserOpenAddonsMgr() will "take over" any existing about:addons tab if there is one which, if I understand the code right, might even entail switching focus to a different window...  I don't feel strongly about this, but I think it would surprise me as a user.
Concatenating in this case shouldn't be an issue, even for RTL (I also expect the name of an add-on to use Latin alphabet most of the time). 

Using intl.ellipsis instead of hard-coding the … would be even better. I'm only aware of Japanese using ... instead …, so 3 letters instead of 1, but given that Japanese is a lot denser that English, it shouldn't really create problems with the layout.
Flags: needinfo?(francesco.lodolo)
Blocks: 1337870
Filed bug 1337870 to handle the ellipsis issue separately.
Dave, the changes to avoid creating a tab from ExtensionsUI.jsm ended up being bigger than I expected, even though you already gave r+ can you do a quick sanity check?
Flags: needinfo?(dtownsend)
Comment on attachment 8834555 [details]
Bug 1336085 Apply updates with only non-promptable permissions automatically

https://reviewboard.mozilla.org/r/110442/#review112090

::: browser/base/content/test/general/browser_extension_update.js:378
(Diff revisions 1 - 2)
> +
> +add_task(function*() {
> +  // Return to about:blank
> +  gBrowser.selectedBrowser.loadURI("about:blank");
> +  yield BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
> +});

Can we do this in a cleanup function instead so it happens even if the test times out?

::: browser/modules/ExtensionsUI.jsm:73
(Diff revisions 1 - 2)
>      });
>    },
>  
>    showAddonsManager(browser, strings, icon) {
> -    let tab = browser.addTab();
> -    browser.selectedTab = tab;
> +    let global = browser.selectedBrowser.ownerGlobal;
> +    return global.BrowserOpenAddonsMgr("addons://list/extension").then(aomWin => {

Can you file a bug to make BrowserOpenAddonsMgr always return the window.
Flags: needinfo?(dtownsend)
Priority: -- → P2
Pushed by aswan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b423754c7ada
Apply updates with only non-promptable permissions automatically r=mossop
No longer blocks: 1337870
https://hg.mozilla.org/mozilla-central/rev/b423754c7ada
Status: REOPENED → RESOLVED
Closed: 8 years ago8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
Depends on: 1340135
No longer depends on: 1340135
Verified fixed on Firefox 54.0a1 (2017-02-21/22) under Windows 10 64-bit, Mac OS X 10.12.1 and Ubuntu 16.04 32-bit. Pending update is not displayed while upgrading via background method a webextension with no new promptable permissions. This issue will be verified also using interactive updates after the Bug 1340078 will be fixed.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: