Closed Bug 1606862 Opened 8 months ago Closed 4 months ago

Make devtools an optional permission

Categories

(WebExtensions :: General, enhancement, P1)

71 Branch
enhancement

Tracking

(firefox77 fixed)

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: mbugzillam, Assigned: mixedpuppy)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:71.0) Gecko/20100101 Firefox/71.0

Steps to reproduce:

This is a request to make DevTools access an optional permission.

Currently the only way to request DevTools access is to specify devtools_page in the manifest, which results in a permissions warning at install time. This is a shame, as only a subset of the users of the extension I maintain would actually need to use the DevTools part of it, and I'd like people to be able to install the extension without any warnings.

Thanks for your time in considering this. Context and related issues can be found below.

// Background

I maintain an extension that helps people navigate with the keyboard, via landmark regions [0]. It also contains a DevTools panel to help web-devs understand how their code relates to the landmarks on their pages.

Whilst the extension needs to run on every page (in order to tell the user how many landmarks there are via the browserAction badge), I've been experimenting with requesting <all_urls> at runtime, so that it doesn't require any permissions to install.

Unfortunately because the only way to request the DevTools permission is to set devtools_page in the manifest, the user is always required to authorise it, even if they aren't going to actually use it.

// Related issues

There are several other issues that ask for permissions to be made optional:

  • Bug 1458585: Allow more permissions to be used as an optional permission [doesn't mention DevTools in the thread, but the submitted patch did include it, though I am not sure if the patch was taken forward]
  • Bug 1459941: Let geolocation be an optional permission
  • Bug 1548011: Make proxy an optional permission
  • Bug 1386673: Make Contextual Identity extensions be an optional permission
  • Bug 1399109: Add management as an optional permission

[0] https://github.com/matatk/landmarks

Blocks: 1458585
Priority: -- → P3
Priority: P3 → P1
Assignee: nobody → mixedpuppy
Pushed by scaraveo@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/74dce6390e5e
support devtools as an optional extension permission r=rpl
Pushed by scaraveo@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8a0b81f6263e
support devtools as an optional extension permission r=rpl

Backed out changeset 8a0b81f6263e (Bug 1606862) for causing devtools failures at devtools/client/framework/test/browser_toolbox_toolbar_reorder_with_extension.js

Push with failure: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=8a0b81f6263e9197fae61b2a65a775055d452398

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=300130455&repo=autoland&lineNumber=8115

Backout link: https://treeherder.mozilla.org/#/jobs?repo=autoland&selectedTaskRun=AS60ai1rQ8mRy_cBIg3xhA-0&resultStatus=testfailed%2Cbusted%2Cexception&revision=f5b6bbac55bc2d9e8f49e7fdc21dcfccd03e3952

[task 2020-04-30T02:42:07.785Z] 02:42:07     INFO - Not taking screenshot here: see the one that was previously logged
[task 2020-04-30T02:42:07.787Z] 02:42:07     INFO - TEST-UNEXPECTED-FAIL | devtools/client/framework/test/browser_toolbox_toolbar_reorder_with_extension.js | no tasks awaiting on messages - Got ["devtools-page-ready"], expected []
[task 2020-04-30T02:42:07.789Z] 02:42:07     INFO - Stack trace:
[task 2020-04-30T02:42:07.790Z] 02:42:07     INFO - chrome://mochikit/content/browser-test.js:test_is:1297
[task 2020-04-30T02:42:07.792Z] 02:42:07     INFO - chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js:ExtensionTestUtils.loadExtension/<:36
[task 2020-04-30T02:42:07.793Z] 02:42:07     INFO - chrome://mochikit/content/browser-test.js:nextTest:549
[task 2020-04-30T02:42:07.794Z] 02:42:07     INFO - chrome://mochikit/content/browser-test.js:timeoutFn:1160
[task 2020-04-30T02:42:07.796Z] 02:42:07     INFO - setTimeout handler*chrome://mochikit/content/browser-test.js:Tester_execTest:1107
[task 2020-04-30T02:42:07.797Z] 02:42:07     INFO - chrome://mochikit/content/browser-test.js:nextTest/<:904
[task 2020-04-30T02:42:07.798Z] 02:42:07     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:918
[task 2020-04-30T02:42:07.800Z] 02:42:07     INFO - Not taking screenshot here: see the one that was previously logged
[task 2020-04-30T02:42:07.801Z] 02:42:07     INFO - TEST-UNEXPECTED-FAIL | devtools/client/framework/test/browser_toolbox_toolbar_reorder_with_extension.js | Extension left running at test shutdown - 
[task 2020-04-30T02:42:07.802Z] 02:42:07     INFO - Stack trace:
[task 2020-04-30T02:42:07.803Z] 02:42:07     INFO - chrome://mochikit/content/browser-test.js:test_ok:1269
[task 2020-04-30T02:42:07.804Z] 02:42:07     INFO - chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js:ExtensionTestUtils.loadExtension/<:117
[task 2020-04-30T02:42:07.806Z] 02:42:07     INFO - chrome://mochikit/content/browser-test.js:nextTest:549
[task 2020-04-30T02:42:07.807Z] 02:42:07     INFO - chrome://mochikit/content/browser-test.js:timeoutFn:1160
[task 2020-04-30T02:42:07.808Z] 02:42:07     INFO - setTimeout handler*chrome://mochikit/content/browser-test.js:Tester_execTest:1107
[task 2020-04-30T02:42:07.810Z] 02:42:07     INFO - chrome://mochikit/content/browser-test.js:nextTest/<:904
[task 2020-04-30T02:42:07.811Z] 02:42:07     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:918
[task 2020-04-30T02:42:07.960Z] 02:42:07     INFO - GECKO(1224) | [Parent 1224: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 0x7efcb23b4400 == 7 [pid = 1224] [id = {971e8244-2351-4eef-9ca8-f49f44b936be}] [url = about:devtools-toolbox]
[task 2020-04-30T02:42:08.077Z] 02:42:08     INFO - GECKO(1224) | MEMORY STAT | vsize 3675MB | residentFast 506MB | heapAllocated 178MB
Backout by dvarga@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ae6d6d6f6e4b
Backed out changeset 8a0b81f6263e for causing devtools failures at devtools/client/framework/test/browser_toolbox_toolbar_reorder_with_extension.js
Pushed by scaraveo@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7ee1e3242808
support devtools as an optional extension permission r=rpl
Status: UNCONFIRMED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
Flags: needinfo?(mixedpuppy)

Hi and thanks for implementing this :-). I noticed there are some public release notes now about optional permissions coming in Firefox 77 [0] - I gathered from this thread that devtools is included, but it's not mentioned there - do they need to be updated?

Do the developer docs and compat data [1] need updating too? (Apologies if that's already in-progress, or not applicable for the upcoming release.)

[0] https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/77#Changes_for_add-on_developers
[1] https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/optional_permissions

You need to log in before you can comment on or make changes to this bug.