Safari Tips


Want to visit sites that insist on Windows IE 6 or later? You can use this trick to fool the website into letting you in. You only need to do this once:

1) Open the Terminal application in the Utilities folder

2) Type "defaults write com.apple.Safari IncludeDebugMenu 1" and hit return.

3) Type "exit" and then quit the Terminal application.

From now on, when you launch Safari a new "Debug" menu appears.

Under "User Agent", you can now make Safari emulate any of the listed browsers.


Check out the exhaustive list of Safari Keyboard and Mouse Shortcuts


Add JavaScript bookmarks in Safari. Click the link below, or copy and paste it into the browser window. Bookmark it for next time.

Print URL:
Safari doesn't print the web page url by default, but you can do it. Paste this code into your Safari address field, bookmark it for future use.
 
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();
}
 

Window Resize:

Resize the width to 700 pixels and move to top left of screen:
javascript:resizeTo(700,screen.availHeight);moveTo(0,0)
 
Resize the width to 700 pixels and move to top right of screen:
javascript:resizeTo(700,screen.availHeight);moveTo(screen.availWidth-700,0)
 
Validate A Web Page:
Validate current page with w3.org in new window (popup blocker must be off):
javascript:void(window.open('http://validator.w3.org/check?uri='+window.location.href))
 
Validate current page with Bobby AAA in new window (popup blocker must be off):
javascript:void(window.open('http://bobby.watchfire.com/bobby/bobbyServlet?&output=Submit&gl=wcag1-aaa&URL='+window.location.href))
 
Validate current page with Bobby 508 in new window (popup blocker must be off):
javascript:void(window.open('http://bobby.watchfire.com/bobby/bobbyServlet?&output=Submit&gl=gl=sec508URL='+window.location.href))

Images:

Proof the images on a page while skipping the layout:
javascript:outText='';for(i=0;i<document.images.length;i++){if(outText.indexOf(document.images[i].src)==-1){outText+='<tr><td><img src='+document.images[i].src+'></td><td>'+document.images[i].height+'</td><td>'+document.images[i].width+'</td><td>'+document.images[i].src+'</td></tr>'}};if(outText!=''){imgWindow=window.open('','imgWin','width=800,height=600');imgWindow.document.write ('<table border=1 cellpadding=10><tr><th>Image</th><th>Height</th><th>Width</th><th>URL</th></tr>'+outText+'</table>');imgWindow.document.close()}else{alert('No images!')}