Skip to content

Instantly share code, notes, and snippets.

@arantius
Created January 3, 2014 21:00
Show Gist options
  • Save arantius/8246475 to your computer and use it in GitHub Desktop.
Save arantius/8246475 to your computer and use it in GitHub Desktop.
Test script for Greasemonkey issue 1836
// ==UserScript==
// @name testttt
// @namespace testtt
// @match http://www.greasespot.net/*
// @grant unsafeWindow
// ==/UserScript==
unsafeWindow.history.EXreplaceState = unsafeWindow.history.replaceState;
unsafeWindow.history.EXXreplaceState = history.replaceState;
function myf()
{
window.history.EXXXreplaceState = window.history.replaceState;
window.history.EWreplaceState = history.replaceState;
history.EWWreplaceState = history.replaceState;
}
function inject(func)
{
var source = func.toString();
var script = document.createElement('script');
script.text = "("+ source +")()";
document.head.appendChild(script);
}
inject(myf);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment