Closed Bug 1427991 Opened 6 years ago Closed 5 years ago

Can't remove an addon from the detail page if the list page is not the previous page in history

Categories

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

x86_64
All
defect

Tracking

()

RESOLVED DUPLICATE of bug 1482480
Tracking Status
firefox57 --- affected
firefox58 --- affected
firefox59 --- affected

People

(Reporter: cbadescu, Unassigned)

References

Details

Attachments

(3 files)

Attached image Remove add-on.gif
[Notes]:
- Sometimes, at first add-on install, the theme options ("Default" and "Dark") might not appear and you need to refresh the "about:addons" page to see them.
- This issue is not reproducible when you select "Remove" button from "about:addons" main page.
- This issue is also reproducible after you use "Undo" option.
- See also: https://github.com/mozilla/notes/issues/545

[Affected versions]:
- Firefox 57.0.3 and up

[Affected Platforms]:
- All Mac
- All Linux

[Prerequisites]:
- Have a Firefox profile with the latest "Firefox Notes" add-on version installed from Test Pilot experiment page (https://testpilot.firefox.com/experiments/notes).

[Steps to reproduce]:
1. Open Firefox browser with the profile from prerequisites.
2. Navigate to "about:addons" page and select "Extensions" section.
3. Click on "More" link and select the "Remove" button.
4. Observe the behavior.

[Expected result]:
- The add-on is removed.

[Actual result]:
- The add-on is not removed and the Theme options disappear.

[Additional notes]:
- This issue is also reproducible with the latest Firefox "Notes" add-on version (2.2.0dev custom build from 01.04.2018) installed.
- Attached is a screen recording of the issue.
This appears to be due to the code here assuming that going back one step in history will take us from the detail page to the list of extensions:
https://searchfox.org/mozilla-central/rev/652fbd6270de0d3ec424d2b88f8375ff546f949f/toolkit/mozapps/extensions/content/extensions.js#1297-1299

I've got a fix in hand (having createOptionsBrowser() call loadURIWithFlags and pass REPLACE_HISTORY) but I need to write a test.  Patch coming shortly.
Assignee: nobody → aswan
Priority: -- → P3
Attachment #8940405 - Flags: review?(lgreco)
Attachment #8940406 - Flags: review?(lgreco)
Comment on attachment 8940405 [details]
Bug 1427991 Modernize browser_uninstalling.js

https://reviewboard.mozilla.org/r/210678/#review216728

::: toolkit/mozapps/extensions/test/browser/browser_uninstalling.js:55
(Diff revision 2)
>    }
>    return null;
>  }
>  
> -// Tests that uninstalling a normal add-on from the list view can be undone
> -add_test(function() {
> +// Tests that uninstalling a restartless add-on from the list view can be undone
> +add_task(async function() {

Nit, given that we are touching this test file (it was definitely very "old style"), it would be nice to give a name to the async functions that we pass to add_task (only to make them more easily identifiable in the logs).
Attachment #8940405 - Flags: review?(lgreco) → review+
Comment on attachment 8940406 [details]
Bug 1427991 Don't create an extra history entry for options browser

https://reviewboard.mozilla.org/r/210680/#review216682

I'm not set the r+ yet, mainly because as we agreed while discussing briefly about this over IRC, we would like to add an explicit test for the `if (!this._addon) { return; }` added to the `createOptionsBrowser` method and we would also like to double-check if we can fix the similar issue that is going to happen when an extension options page navigates to other extension urls (which would still going to become part of the history of the about:addons top level page when the extension is running in the main process).

::: toolkit/mozapps/extensions/content/extensions.js:3250
(Diff revision 3)
>        stack.remove();
>      }
>  
> +    // If the addon gets disabled before we get here (which probably
> +    // happens more in tests that in regular usage) then just bail out.
> +    if (!this._addon) {

As briefly discussed over IRC, if it is possible that `this._addon` could be null and we need to add this check, it would also make sense to add an explicit test case for it.

Besides the new test case, I'm wondering if just "silently returning after have removing the stack" is the right way to handle this unexpected scenario, I would probably prefer at least to have an error logged in the console (so that it could be easier to investigate in case it is going to introduce unexpected regressions).

::: toolkit/mozapps/extensions/content/extensions.js:3340
(Diff revision 3)
>          browserOptions.stylesheets = extensionStylesheets;
>        }
>  
>        mm.sendAsyncMessage("Extension:InitBrowser", browserOptions);
>  
> -      browser.loadURI(optionsURL);
> +      browser.loadURIWithFlags(optionsURL, {flags: Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY});

I guess that this issue only happens when the extension is running in the main process (on Linux and OSX), because when the browser is remote, its navigation events should not become part of the about:addons page that contains the browser element.

It is quite unfortunate that this fix is not going to be able to cover a similar issue that I'm pretty sure is also happening when the actual main options page (loaded in a non-remote webextension browser element) navigates to another extension page (e.g. an extension could have a main options page and links that navigate that page to other options sub pages, or when it uses the history API internally).

::: toolkit/mozapps/extensions/test/browser/browser_uninstalling.js:14
(Diff revision 3)
>  
> +let epScope = {};
> +Components.utils.import("resource://gre/modules/ExtensionParent.jsm", epScope);
> +let {ExtensionParent} = epScope;
> +
> +function promiseOptionsPageLoaded() {

We have a similar test helper function named `waitOptionsBrowserInserted` and defined in another about:addons test:

- https://searchfox.org/mozilla-central/rev/f42618c99dcb522fb674221acfbc68c2d92e7936/toolkit/mozapps/extensions/test/browser/browser_webext_options_addon_reload.js#8-22

we could move it into a shared file and reuse in both these test files.

I'm not actively working on this, unassigning myself. Also clarified the title.
With the HTML rewrite of about:addons now actually imminent, I don't think this is a high priority.

Assignee: aswan → nobody
Priority: P3 → P5
Summary: At first attempt cannot remove the Firefox "Notes" add-on from the "about:addons" details page → Can't remove an addon from the detail page if the list page is not the previous page in history

This should've been fixed by bug 1482480. I can't reproduce this.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
Attachment #8940406 - Flags: review?(lgreco)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: