- Select and copy the following code:
javascript: if (document.body.firstChild.id == 'print_URL_header') { document.body.removeChild(document.body.firstChild); } else { entete = document.createElement('pre'); entete.setAttribute('id','print_URL_header'); entete.appendChild(document.createTextNode(document.URL)); document.body.insertBefore(entete, document.body.firstChild, null); window.print(); } - Open a new window (command-N) or a new tab (command-T) in Safari.
- Paste the text in the address field at the top of the window. Even if there are several lines, it will be OK.
- Drag and drop the URL symbol (the blue globe on the left of the address field) to the bookmarks bar.
- Give this bookmark a name in the pop-up dialog (e.g. Print URL Header). You now have a new "button" for this specific function.
- Click once to print the page.
- Click a second time to clean up the added header from the displayed page.
Remarks:
- The two-click procedure is due to asynchronous print processing. Too bad!
- The header is only printed on the first page. To define a global header implies using a specific CSS stylesheet.
- I tried very hard to achieve the same feature using the default stylesheet of Safari, but could not find the way to acces URL from the CSS code.
- The "print button" tip is borrowed from someone on the net. It was a standard print using javascript:window.print().

