Page 1 of 1

Javascript Loophole ??

Posted: Mon Sep 24, 2012 11:41 pm
by Live24x7
I am not sure if this can be misused.. but this looks like doable.

A function like this one can be used to change the home page of every visitor.

For example i can point the new homepage to my google adsense publisher id and then earn revenue for every click by unsuspecting users

Code: Select all

$(document).ready()(function() {

 document.body.style.behavior='url(#default#homepage)';
  document.body.setHomePage('http://www.google.com/myadsensepublishercodehere');

});



am i correct in this assumption ?
:roll:

Re: Javascript Loophole ??

Posted: Tue Sep 25, 2012 12:23 am
by Benjamin
Well google would ban you, but that's a different issue.

Are you sure this works? Have you tested it from a domain?

Re: Javascript Loophole ??

Posted: Tue Sep 25, 2012 10:06 am
by Live24x7
tried this out - did work in IE9 (not in forefox)
but turns out that you can change the homepage only to the currently loaded website, not to some other website.

so that answers the question :)

about banning by google - this is one strategy being used by google on IE browsers to take a bite out of the default bing search users.

so if you visit google on an IE9 browser, you will get a notice at the top that reads
"visit here often ? make google your homepage"

Re: Javascript Loophole ??

Posted: Tue Sep 25, 2012 10:23 am
by Live24x7
just discovered a code at http://stackoverflow.com/a/1063119 that works on firefox as well.

But firefox gives an alert:

"this action was aviod by your browser,if you want to enable,please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true"

something that is not turned true by default