Closed
Bug 1363990
Opened 7 years ago
Closed 5 years ago
Beautify HTML when copying inner/outer HTML from the inspector
Categories
(DevTools :: Inspector, enhancement, P3)
DevTools
Inspector
Tracking
(firefox67 fixed)
RESOLVED
FIXED
Firefox 67
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: pbro, Assigned: pbro)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
1. Go to google home page 2. Go to html body#gsr.hp.vasq div#viewport.ctr-p div#searchform.jhp form#tsf.tsf div.tsf-p div.jsb in the Inspector 3. Copy Outer HTML This is what you get: <div class="jsb" style="padding-top:18px"><center><input value="Google Search" aria-label="Google Search" name="btnK" jsaction="sf.chk" type="submit"><input value="I'm Feeling Lucky" aria-label="I'm Feeling Lucky" name="btnI" jsaction="sf.lck" type="submit"></center></div> This is the actual outer HTML because the site minified it. However, it's not very useful when you want to share the code or use it in a text editor. It would be great if there was an option to beautify this HTML automatically. Note that keeping the default formatting might also be needed in some situations, to check various things like if there's a space character somewhere, etc. So this has to be an option. Either a new set of context menu entries, or a pref, or a checkbox in the settings panel.
Updated•6 years ago
|
Product: Firefox → DevTools
Assignee | ||
Updated•6 years ago
|
Blocks: devtools-webcompat-team
Assignee | ||
Comment 1•5 years ago
|
||
I will go ahead with the plan outlined above: there will be a new pref (not surfaced outside of about:config for now) that one can turn on to beautify the HTML when copying it through the inspector's "copy inner HTML" and "copy outer HTML" context menu items.
Assignee: nobody → pbrosset
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•5 years ago
|
||
Pushed by pbrosset@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b7080c6d1c05 New pref to beautify HTML code when copying from the inspector; r=jdescottes
Assignee | ||
Comment 4•5 years ago
|
||
Hey Karl. This feature came from you, originally. As you can see, it's about to land.
This first MVP approach was to just hide this behind a pref. So if you want to take advantage of this feature when it lands, please do the following:
- open about:config
- set
devtools.markup.beautifyOnCopy
to true - right click on any HMTL element in the inspector and choose
Copy > Inner/Outer HMTL
- profit!
Flags: needinfo?(kdubost)
Comment 5•5 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
status-firefox67:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 67
You need to log in
before you can comment on or make changes to this bug.
Description
•