Closed Bug 1330741 Opened 3 years ago Closed 3 years ago

Show the filesystem location of the extension


(WebExtensions :: Developer Tools, defect, P5)



(firefox55 fixed)

Tracking Status
firefox55 --- fixed


(Reporter: andy+bugzilla, Assigned: mstriemer)


(Blocks 1 open bug)


(Whiteboard: triaged)


(2 files)

This is hopefully a simple change to about:debugging to show the path to the extension on the file system. Particularly useful for temporary extensions, but could apply to them all.
Assignee: nobody → mstriemer
Priority: -- → P5
Whiteboard: triaged
Attached image install-location.png
This only shows the install location for temporary add-ons. When an add-on is regularly installed from the filesystem the path is set to the original install location which doesn't seem very helpful.

We could use `_sourceBundle` to get the location for regular installs but this ends up being in Firefox's directory for system add-ons and likely also isn't very helpful (and looks kind of bad because those paths are really long and weird).

There's some RTL/LTR flipping for getting the ellipsis on the left-hand-side of the file path. I think this is fine because we always want the file path to be displayed LTR from what I can tell.
I wanted to add some more specific tests for this by rendering the AddonTarget component directly. This didn't seem to work in the browser tests since there's no global `document` and React depends on that.

I tried writing a mochitest that does this but I couldn't get it to load react. I think this might just need some config updates but I trial and error did not lead me to a solution.

Is there a good way to do this? I don't see any tests like this in aboutdebugging but I see that there are some other parts using enzyme.

Essentially I want this:

      React.createElement(AddonTarget, { target: { url: "" } }, null),
    ok(!testContainer.textContent.includes("Location"), "remote location is hidden");
Comment on attachment 8859693 [details]
Bug 1330741 - Show filesystem location of add-ons in about:debugging

Looks good to me, thanks! 
Few nits, feel free to land with my comments addressed and a green try.

::: devtools/client/aboutdebugging/aboutdebugging.css:258
(Diff revision 2)
> +  display: grid;
> +  font-size: 14px;
> +  grid-template-columns: 128px 1fr;
> +}
> +
> +.addon-target-info dt {

can you use classes instead of dt/dd ?

::: devtools/client/aboutdebugging/test/browser.ini:31
(Diff revision 2)
>  tags = webextensions
>  [browser_addons_debug_webextension_nobg.js]
>  tags = webextensions
>  [browser_addons_debug_webextension_popup.js]
>  tags = webextensions
> +[browser_addons_debug_info.js]

nit: move before [browser_addons_debug_webextension.js]

::: devtools/client/aboutdebugging/test/browser_addons_debug_info.js:21
(Diff revision 2)
> +  let container = document.querySelector(`[data-addon-id="${ADDON_ID}"]`);
> +  let filePath = container.querySelector(".file-path");
> +  let expectedFilePath = "browser/devtools/client/aboutdebugging/test/addons/unpacked/";
> +
> +  // Verify that the path to the install location is shown next to its label.
> +  ok(filePath, "no file path set");

The description seems wrong here?
Attachment #8859693 - Flags: review?(jdescottes) → review+
Autoland can't push this until all pending issues in MozReview are marked as resolved.
Keywords: checkin-needed
Keywords: checkin-needed
Pushed by
Show filesystem location of add-ons in about:debugging r=jdescottes
Keywords: checkin-needed
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.