JavaScript print() without URL and Date

2019-08-19 04:52发布

I made a little "CMS" for writing, managing and printing bills for a company. The bills are saved on the server as HTML-files. The javascript code is document.billFrame.print();. Is it possible to prevent the browser of printing the URL and date? Because I know that it's probably not possible with JavaScript/CSS, is it possible to install a browser-Plugin or something like that for Safari/Chrome or FF? The CMS will be only used on one computer, so it doesn't matter if a plugin is required.

Thanks for help

2条回答
Melony?
2楼-- · 2019-08-19 05:16

In Firefox:

Print -> Page Setup -> Margins & Headers/Footers

In Chrome:

Print -> Uncheck Headers and Footers under Options

查看更多
女痞
3楼-- · 2019-08-19 05:34

The header you're seeing is coming from your browser, not the page you're print()ing, so opening up new window and stying it with JS/CSS won't work.

Manage these settings via your browser preferences. Howto here for each major browser.

查看更多
登录 后发表回答