简体   繁体   中英

Firefox “media emulate print” vs print this page

I've got some trouble printing a web page in Firefox. If I use media emulate print in the console the CSS look great. But if I look at the print preview via menu -> print this page .

It looks horrible and also only the first page is shown - further pages are empty!

So does anybody know the difference between media emulate print and menu -> print this page ?

How I can solve my problem?

This is a Firefox bug. It's documented here: https://bugzilla.mozilla.org/show_bug.cgi?id=1448507

The workaround is to move your CSS to the web_accessible_resources section of your manifest, and then insert a link to it into your head element using JavaScript. You can refer to it using the browser.runtime.getURL() method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM