Is it possible to view a page in Firefox using "print" media type?
Solution 1
There is now (June 2019) a nice button in the devtools. See this discussion mentioned in the answer by @interDist above.
Solution 2
From https://developer.mozilla.org/pl/docs/Tools/GCLI : Launch the Developer Toolbar with Shift+F2, then type: media emulate print
Somehow it doesn't solve my problem though, this what I see after this command differs from the Print Preview and from what is printed out... :(
Solution 3
As of September 2018, no, there is no such option. The Developer Toolbar, mentioned by @gaazkam, was removed in Firefox 62 in September 2018. There is no replacement for the media emulate
command in DevTools, although it may be given some priority now that the command line interface is gone. Discussion is also here: https://discourse.mozilla.org/t/how-to-media-emulate-print-without-developer-toolbar-gcli/30975.
Solution 4
This can be done using the developer tools by pressing the 'Toggle print media simulation for the page' button in the styles panel.
Related videos on Youtube
gaazkam
Apparently, this user prefers to keep an air of mystery about him.
Updated on September 18, 2022Comments
-
gaazkam almost 2 years
I'm not talking of the Print Preview - I mean to view the webpage in Firefox "normally", with access to e.g. the F12 Developer Tools, but I want the layout to be the same as if I was printing the page out.
-
Blackwood almost 6 yearsThis appears to be a comment on the existing answer.
-
zmbq almost 6 yearsActually, this is the correct answer for 2018.
-
user2924019 over 5 yearsThe way I do it, is open the site, go to print, then you can right click on elements and use "Inspect element". Chrome you can do the same. I know it's not what OP originally wanted, but just a work around for now.
-
Hayden Thring over 5 yearsdoing it this way @user2924019 there are no css rules shown
-
interDist over 5 years@user2924019 in Chrome, the only thing I can inspect in this way is
<embed id="plugin" type="application/x-google-chrome-pdf" ... />
within apreview-wrapper
div... -
Qsigma almost 5 yearsThis solved my problem - the new button was hidden because my style pane was too narrow. Following your screenshot, I widened my pane and got a live print media preview.
-
William Turrell over 4 yearsReading in 2019? There's an icon top-right in DevTools, looks like a page with one corner folded over. See Alexander Rutz's answer.
-
Mikko Rantalainen almost 3 yearsAdditional tips for context: this is actually inside
Inspector
tab and its subviewRules
which is the part that shows the applied CSS rules for currently selected DOM node. The tootip for the button says "Toggle print media simulation for the page". At first I was looking for this in the top toolbar of Web Developer Tools. -
M at almost 3 years@gaazkam Could you please select this as an answer?