X
點擊此處開啟此網站的行動版。

技術支援討論區

WYSIWYG printing in Firefox without showing expanded link addresses?

已張貼

Cannot get Firefox to print or print preview without expanding all link addresses. Sorry this section so short but fourth time typing due to page errors and hangs at adding file image.

Cannot get Firefox to print or print preview without expanding all link addresses. Sorry this section so short but fourth time typing due to page errors and hangs at adding file image.

被選擇的解決方法

That is a feature of a print style sheet in the website. Unfortunately, it is not always easy to defeat a print style sheet because those links are generated during print and not actually something you can pull out of the page.

You can override the generated content rule as follows. Not convenient, but tolerable for the occasional use:

You can use Firefox's Web Console to inject a new superseding style rule into the page. You can open the Web Console in the lower part of the tab using either:

  • "3-bar" menu button > Web Developer > Web Console
  • (menu bar) Tools > Web Developer > Web Console
  • (mac) Command+Alt+k

In the line at the bottom, paste the following script and press Return to submit it:

r='@media print{a[href]:after {display:none !important}}'; var s=document.createElement('style'); s.appendChild(document.createTextNode(r)); document.body.appendChild(s);

It's normal for Firefox to warn you not to run scripts from strangers the first time you do this. You may need to complete a task to demonstrate that you were warned.

When you call up print preview after that, the unwanted link text should be gone.

For reference:

If you're curious how a style rule can insert text into a document, this article on MDN has more information: https://developer.mozilla.org/docs/Web/CSS/::after

從原來的回覆中察看解決方案 1

額外的系統細節

應用程式

  • User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:56.0) Gecko/20100101 Firefox/56.0

更多資訊

提出問題者

Here are the images which would not load on the combined questions entry/ account creation page.

Here are the images which would not load on the combined questions entry/ account creation page.
Shadow110 1072 個解決方法 14836 個答案

HI most sites have a print friendly button to click so that you do not get all of those links. You can try the below to see if can do anything.

Please let us know if this solved your issue or if need further assistance.

HI most sites have a print friendly button to click so that you do not get all of those links. You can try the below to see if can do anything. *http://kb.mozillazine.org/Problems_printing_web_pages *https://support.mozilla.org/en-US/kb/fix-printing-problems-firefox Please let us know if this solved your issue or if need further assistance.
jscher2000
  • Top 10 Contributor
8757 個解決方法 71649 個答案

選擇的解決方法

That is a feature of a print style sheet in the website. Unfortunately, it is not always easy to defeat a print style sheet because those links are generated during print and not actually something you can pull out of the page.

You can override the generated content rule as follows. Not convenient, but tolerable for the occasional use:

You can use Firefox's Web Console to inject a new superseding style rule into the page. You can open the Web Console in the lower part of the tab using either:

  • "3-bar" menu button > Web Developer > Web Console
  • (menu bar) Tools > Web Developer > Web Console
  • (mac) Command+Alt+k

In the line at the bottom, paste the following script and press Return to submit it:

r='@media print{a[href]:after {display:none !important}}'; var s=document.createElement('style'); s.appendChild(document.createTextNode(r)); document.body.appendChild(s);

It's normal for Firefox to warn you not to run scripts from strangers the first time you do this. You may need to complete a task to demonstrate that you were warned.

When you call up print preview after that, the unwanted link text should be gone.

For reference:

If you're curious how a style rule can insert text into a document, this article on MDN has more information: https://developer.mozilla.org/docs/Web/CSS/::after

That is a feature of a print style sheet in the website. Unfortunately, it is not always easy to defeat a print style sheet because those links are generated during print and not actually something you can pull out of the page. You can override the generated content rule as follows. Not convenient, but tolerable for the occasional use: You can use Firefox's Web Console to inject a new superseding style rule into the page. You can open the Web Console in the lower part of the tab using either: * "3-bar" menu button > Web Developer > Web Console * (menu bar) Tools > Web Developer > Web Console * (mac) Command+Alt+k In the line at the bottom, paste the following script and press Return to submit it: <code>r='@media print{a[href]:after {display:none !important}}'; var s=document.createElement('style'); s.appendChild(document.createTextNode(r)); document.body.appendChild(s); </code> It's normal for Firefox to warn you not to run scripts from strangers the first time you do this. You may need to complete a task to demonstrate that you were warned. When you call up print preview after that, the unwanted link text should be gone. ''For reference:'' If you're curious how a style rule can insert text into a document, this article on MDN has more information: https://developer.mozilla.org/docs/Web/CSS/::after

提出問題者

Yes! A technical solution to a problem created by crappy technology--love it. Having barely passable programming skills myself even as a script-kiddie, could I ask if there is a way to (save it) run/inject the script from a bookmark such as prefixing it with "javascript:" or other such protocol command?

Yes! A technical solution to a problem created by crappy technology--love it. Having barely passable programming skills myself even as a script-kiddie, could I ask if there is a way to (save it) run/inject the script from a bookmark such as prefixing it with "javascript:" or other such protocol command?
cor-el
  • Top 10 Contributor
  • Moderator
17516 個解決方法 158398 個答案

有幫助的回覆

I normally place such script files in the head section and give them an 'id' to make it easy to toggle with another bookmarklet.

javascript:(function(){var nS=document.createElement('style'),r='@media print{a[href]::after {display:none!important}}';nS.id='style_!!!';nS.setAttribute('type','text/css');nS.textContent=r;document.querySelector('head,body').appendChild(nS)})();
I normally place such script files in the head section and give them an 'id' to make it easy to toggle with another bookmarklet. <pre><nowiki>javascript:(function(){var nS=document.createElement('style'),r='@media print{a[href]::after {display:none!important}}';nS.id='style_!!!';nS.setAttribute('type','text/css');nS.textContent=r;document.querySelector('head,body').appendChild(nS)})();</nowiki></pre>