I've been asked a question by one of my friends as a brain teaser, is it possible to spoof a referer by injecting a link and then simulating a click? So I decided to try, I tried it with gmail.com and ran this through firebug javascript console.
var headID = document.getElementsByTagName("head")[0];
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js';
headID.appendChild(newScript);
$("#signIn").html('<a href="http://google.com" id="testing">Hmm</a>');
$("#testing").click();
It's interesting tho, first I get an error because it seems that jquery is not loaded fast, but the main important thing is that the element actually doesn't get clicked, any ideas?