Experiment disabling F12 by default
Categories
(DevTools :: General, task, P3)
Tracking
(firefox77 fixed)
Tracking | Status | |
---|---|---|
firefox77 | --- | fixed |
People
(Reporter: jdescottes, Assigned: jdescottes)
References
(Blocks 1 open bug)
Details
Attachments
(8 files, 1 obsolete file)
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
text/plain
|
tdsmith
:
data-review+
|
Details |
Experiment designed to disable F12 until users have opened the toolbox once.
Assignee | ||
Comment 1•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
Depends on D71035
Assignee | ||
Comment 3•5 years ago
|
||
Depends on D71036
Assignee | ||
Comment 4•5 years ago
|
||
Gijs: Hi!
We want to disable the F12 shortcut for DevTools in an experiment, since it is responsible for most of the accidental usage of DevTools.
I was asked to evaluate how complex it would be to add a small "doorhanger" notification when users press F12. The idea is to have a very simple readonly message "If you want to open DevTools, activate it via the Web Developer menu". (will add screenshot in next comment)
I tried to look at how other doorhangers were displayed and came up with the following diff: https://phabricator.services.mozilla.com/D71036
Basically I am including a new inc.xhml + ftl in browser.xhtml and I try to trigger it from DevTools. I'm missing most of the styling for now, but before I dive deeper, I'd like to get an overall feeling from someone working on the Firefox UI. Does the idea of adding a doorhanger for an experiment seem reasonable to you? And if yes, should I be careful about hidden complexity or does the skeleton of my patch look more or less on track?
(hopefully you're the good person to ask, otherwise, maybe you would know who to ping?)
Thanks!
Assignee | ||
Comment 5•5 years ago
|
||
Comment 6•5 years ago
|
||
Very sorry about the slowness here. In future, please do feel free to ping me on slack/matrix, I lost track of this needinfo for a bit.
(In reply to Julian Descottes [:jdescottes] from comment #4)
We want to disable the F12 shortcut for DevTools in an experiment, since it is responsible for most of the accidental usage of DevTools.
I'm a little surprised; this is the shortcut IE/Edge evangelize on, right? If it's responsible for most accidental usage, do we know how common intentional usage of the shortcut is?
I was asked to evaluate how complex it would be to add a small "doorhanger" notification when users press F12. The idea is to have a very simple readonly message "If you want to open DevTools, activate it via the Web Developer menu". (will add screenshot in next comment)
I tried to look at how other doorhangers were displayed and came up with the following diff: https://phabricator.services.mozilla.com/D71036
Basically I am including a new inc.xhml + ftl in browser.xhtml and I try to trigger it from DevTools. I'm missing most of the styling for now, but before I dive deeper, I'd like to get an overall feeling from someone working on the Firefox UI. Does the idea of adding a doorhanger for an experiment seem reasonable to you? And if yes, should I be careful about hidden complexity or does the skeleton of my patch look more or less on track?
It's a bit overly complex. :-) I think I saw similar confusion in the all-tabs view and forgot to chase it, so I'll do that after responding here...
I think here you only really need a panel
, not a panelview
, because you're not going to create sliding subviews or anything like that. You shouldn't need to use PanelMultiView. You also don't need the hidden attribute, nor do you need to set that when the popup hides. If you want to hide the popup, you can call the hidePopup
method on the panel. (The hidden attribute on panels is a leftover optimization from XBL days. It really needs to be removed for all the panels that currently deal with it, but that's a separate discussion...)
You could look at the notification shown after use of the forget/panic button - https://searchfox.org/mozilla-central/rev/aec63591821712236a522f7f55116f582ed7c920/browser/components/customizableui/content/panelUI.inc.xhtml#74-90 . You just need a panel
and some markup in the panel to make it look the way you want. Then when you want to show the panel, simply call openPopup
, like the code at https://searchfox.org/mozilla-central/rev/aec63591821712236a522f7f55116f582ed7c920/browser/base/content/browser.js#8780-8807 - which does some extra stuff to make clicking on the panel / keypressing while the panel is up make the panel disappear, as well as having a timeout to hide it after a few seconds.
In terms of the ftl file, I'd find another topical ftl file rather than introducing a new one just for this message, and call MozXULElement.insertFTLIfNeeded
with the path to the ftl file when you show the popup, if the file is not already included in browser.xhtml .
Does that help?
Assignee | ||
Comment 7•5 years ago
|
||
Thanks a lot for the pointers Gijs! I will apply them next week, but I wanted to provide some answers to your question below
I'm a little surprised; this is the shortcut IE/Edge evangelize on, right? If it's responsible for most accidental usage, do we know how common intentional usage of the shortcut is?
We have measured the accidental usage in various experiments, and the results are not always consistent. But for the study I followed closely, the results were:
- 2/3 of DevTools opening were accidental
- 75% of accidental open are coming from F12
- among non-accidental users, 1/3 use F12
This leads to think that the accidental usage of F12 is 5 times more important than the intentional one.
Keeping in mind it's our only shortcut which is not using modifiers.
Assignee | ||
Comment 8•5 years ago
|
||
I updated https://phabricator.services.mozilla.com/D71036 with your suggestions, it looks much simpler!
Waiting for inputs from Harald about the styling of the notification.
In terms of the ftl file, I'd find another topical ftl file rather than introducing a new one just for this message, and call MozXULElement.insertFTLIfNeeded with the path to the ftl file when you show the popup, if the file is not already included in browser.xhtml .
I put it in browser.ftl for now for the sake of simplicity, as we don't really have a devtools' ftl for popups, but I can change that later.
Assignee | ||
Comment 9•5 years ago
|
||
Depends on D71037
Assignee | ||
Comment 10•5 years ago
|
||
Assignee | ||
Comment 11•5 years ago
|
||
Depends on D71988
Assignee | ||
Updated•5 years ago
|
Comment 12•5 years ago
|
||
Comment 13•5 years ago
|
||
For reference - this ETP message is where we currently use a doorhanger for a simple notification.
Assignee | ||
Comment 14•5 years ago
|
||
Updated per comments from tdsmith on https://phabricator.services.mozilla.com/D71988
Comment 15•5 years ago
|
||
Comment 16•5 years ago
|
||
Comment 17•5 years ago
|
||
Backed out for bc failures on browser_startup_images.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/bc7658646927718a3c7b7174cb0e6df7130afec3
Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=299883784&repo=autoland&lineNumber=1048
Also dt failure on browser_toolbox_telemetry_open_event.js: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=299882920&repo=autoland&lineNumber=3412
Assignee | ||
Comment 18•5 years ago
|
||
Sorry about that!
(In reply to Narcis Beleuzu [:NarcisB] from comment #17)
Backed out for bc failures on browser_startup_images.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/bc7658646927718a3c7b7174cb0e6df7130afec3
Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=299883784&repo=autoland&lineNumber=1048
Looks like this is what the hidden attribute on the <panel> element is for after all.
Will add the attribute and re-request review.
Also dt failure on browser_toolbox_telemetry_open_event.js: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=299882920&repo=autoland&lineNumber=3412
Forgot to remove a reference to an extra_key, fixing this.
Comment 19•5 years ago
|
||
Comment 20•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d8f6dc8f06ce
https://hg.mozilla.org/mozilla-central/rev/91d89a77be32
https://hg.mozilla.org/mozilla-central/rev/df2a2b6c118e
https://hg.mozilla.org/mozilla-central/rev/b2f7e6085ee8
https://hg.mozilla.org/mozilla-central/rev/7ecc2806071e
Assignee | ||
Comment 21•5 years ago
|
||
Note: if you want to test this locally on Nightly or local builds, make sure you flip:
- devtools.experiment.f12.shortcut_disabled to true
- devtools.selfxss.count to 0
The first preference enables the experiment, and the second preference is to flag the profile as a "new devtools user".
Updated•4 years ago
|
Description
•