Javascript Loophole ??

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Live24x7
Forum Contributor
Posts: 194
Joined: Sat Nov 19, 2011 9:32 am

Javascript Loophole ??

Post 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:
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Javascript Loophole ??

Post 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?
Live24x7
Forum Contributor
Posts: 194
Joined: Sat Nov 19, 2011 9:32 am

Re: Javascript Loophole ??

Post 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"
Live24x7
Forum Contributor
Posts: 194
Joined: Sat Nov 19, 2011 9:32 am

Re: Javascript Loophole ??

Post 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
Post Reply