Defeat setter example

From GreaseSpot

Jump to: navigation, search
// ==UserScript==
// @name           Location Hack Defeated
// @namespace      http://whateveryouwant/
// @description    Location Hack Defeated
// @include        http://esquifit.googlepages.com/LocationHackDefeat.html
// ==/UserScript==

var oldBodyTitle = document.body.title;
window.location="javascript:void(delete document.body.title)";
location.href = "javascript:void(document.body.title = pageFunc('Greasemonkey'))";

window.setTimeout(function()
{
var fauxReturnValue = document.body.title;
document.body.title = oldBodyTitle;

alert ("The expected returned value is " +  '***[[[ Greasemonkey ]]]***' +
       "\n" + 
       "The actual returned value is: "  + fauxReturnValue);
}, 0)
Personal tools