X
Tap here to go to the mobile version of the site.

Support Forum

WYSIWYG printing in Firefox without showing expanded link addresses?

Posted

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.

Chosen solution

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

Read this answer in context 1

Additional System Details

Application

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

More Information

Question owner

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 solutions 14836 answers

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
8635 solutions 70637 answers

Chosen Solution

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

Question owner

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
17415 solutions 157323 answers

Helpful Reply

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>