views:

60

answers:

2

Hello,

I'm invoking the navigator print function using a simple window.print(); call. It prints perfect (I want to print the same I see on the screen, so I don't really use a special CSS to print) but it showing the link locations next to the text link, something like:

    Homepage (http://localhost)

To be clearer: I don't want to have the link locations near the links in the printed version, I have control over the CSS but I can't find this behaviour defined anywhere, so I think is a navigator-related issue!

EDIT: This happens under Firefox 3.6.8 and the last Chrome, on Ubuntu an Windows XP/Vista.

+2  A: 

Seems you are printing a page with this styling from a CSS2 compliant browser

http://www.alistapart.com/articles/goingtoprint/

In a fully CSS2-conformant browser, we can parenthetically insert the URLs of the links after each one, thus making them fairly useful to anyone who has a copy of the printout and a web browser handy. Here’s the rule, which restricts this effect to the “content” div and thus avoids sticking a URL in the masthead:

#content a:link:after, #content a:visited:after {    
  content: " ("attr(href) ") ";    
  font-size: 90%;   
}

Try it out in a Gecko-based browser, like Mozilla or Netscape 6.x. After every link in the printout, you should see the URL of the link in parentheses.

mplungjan
I wan't to avoid that behaviour, I'm going to try to use that code to remove what I'm getting :)
Adirael
I understand - but the behaviour you are describing is something explicitly put into the page you are looking at. To avoid this behaviour on that page - remove it if it is your page, use a userCSS in the browser if it is not.
mplungjan
The code wasn't appearing on Firefox, but I decided to start turning off different modules that I got enabled (it's a Drupal system) and a module was injecting a print.css with that code.Thanks a lot :)
Adirael
Great - and thanks for the question - it showed me something I was not aware of in CSS2 :)
mplungjan
Here it is in case someone else want to look http://drupal.org/files/issues/print.css_.txt sourced from here http://drupal.org/node/116482 which funnily enough references my listapart link
mplungjan
+1  A: 

Use additional CSS for print.

See here: http://www.webcredible.co.uk/user-friendly-resources/css/print-stylesheet.shtml

Mchl
But according to what is described, the page that is being printed has been set up to print the HREFS. Sounds like if the asker has control over the css, the href CSS can just be removed rather than a specific stylesheet applied. Some browsers can however override the css with a user css.
mplungjan