Closed Bug 1317000 Opened 8 years ago Closed 7 years ago

Display permissions prompt for webextensions installed locally from about:addons

Categories

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

51 Branch
defect

Tracking

()

VERIFIED FIXED
mozilla54
Tracking Status
firefox54 --- verified

People

(Reporter: aswan, Assigned: aswan)

References

Details

(Whiteboard: triaged)

Attachments

(2 files)

The specified flow for local installs is similar to that from web sites, this bug covers implementing that flow for installation from about:addons (either by choosing "Install Add-on from File..." from the gear menu or by dragging and dropping an xpi file onto about:addons)
Assignee: nobody → aswan
Priority: -- → P1
Whiteboard: triaged
UI
Attachment #8833162 - Flags: review?(dtownsend)
Comment on attachment 8833162 [details]
bug 1317000 Test for permission prompts on local file installs

https://reviewboard.mozilla.org/r/109398/#review110694

Mostly there but there are a few things that I think can be cleaned up here.

::: browser/base/content/test/general/browser_extension_permissions.js:70
(Diff revision 1)
> +// that resolves when the page is loaded.
> +function load(url) {
> +  let contentWin = gBrowser.selectedTab.linkedBrowser.contentWindow;
> +  let promise = new Promise(resolve => {
> +    gBrowser.addEventListener("DOMContentLoaded", resolve, {once: true});
> +  });

Please use BrowserTestUtils.browserLoaded

::: browser/base/content/test/general/browser_extension_permissions.js:71
(Diff revision 1)
> +function load(url) {
> +  let contentWin = gBrowser.selectedTab.linkedBrowser.contentWindow;
> +  let promise = new Promise(resolve => {
> +    gBrowser.addEventListener("DOMContentLoaded", resolve, {once: true});
> +  });
> +  contentWin.location.href = INSTALL_PAGE;

Please use gBrowser.selectedBrowser.loadURI

::: browser/base/content/test/general/browser_extension_permissions.js:115
(Diff revision 1)
> +      };
> +      Services.obs.addObserver(listener, "EM-loaded", false);
> +    });
> +
> +    let contentWin = gBrowser.selectedTab.linkedBrowser.contentWindow;
> +    contentWin.location.href = "about:addons";

Please use gBrowser.selectedBrowser.loadURI, it guarantees you won't be using a CPOW.

Alternativly can you just use BrowserOpenAddonsMgr which handles waiting for the load to complete already and lets you choose the initial view?
Attachment #8833162 - Flags: review?(dtownsend) → review-
Comment on attachment 8833162 [details]
bug 1317000 Test for permission prompts on local file installs

https://reviewboard.mozilla.org/r/109398/#review110694

> Please use gBrowser.selectedBrowser.loadURI, it guarantees you won't be using a CPOW.
> 
> Alternativly can you just use BrowserOpenAddonsMgr which handles waiting for the load to complete already and lets you choose the initial view?

wow, how did i get this far without ever coming across BrowserOpenAddonsMgr before?
Comment on attachment 8833162 [details]
bug 1317000 Test for permission prompts on local file installs

https://reviewboard.mozilla.org/r/109398/#review110750

Well that became simpler!
Attachment #8833162 - Flags: review?(dtownsend) → review+
Pushed by aswan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b46165a0e3d6
Test for permission prompts on local file installs r=mossop
https://hg.mozilla.org/mozilla-central/rev/b46165a0e3d6
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
Depends on: 1334452
Verified fixed on Firefox 54.0a1 (2017-02-19) under Windows 10 64-bit and Ubuntu 16.04 32-bit.
Permissions doorhanger is successfully displayed while installing locally via about:addons: https://www.screencast.com/t/5ivxUhr7n
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: