Skip to content

Instantly share code, notes, and snippets.

@dtinth
Created September 3, 2010 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dtinth/563916 to your computer and use it in GitHub Desktop.
Save dtinth/563916 to your computer and use it in GitHub Desktop.
function load() {
var prefix = 'http://tw.dt.in.th/thaiWitter/';
if (window.location.href.substr(0, prefix.length) == prefix) {
// do some required work here
}
var mediator = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var windows = mediator.getEnumerator(null);
while (windows.hasMoreElements()) {
var currentWindow = windows.getNext();
if (currentWindow.location.href == 'chrome://webrunner/content/webrunner.xul') {
var browser = currentWindow.document.getElementById('browser_content');
if (browser.contentWindow.wrappedJSObject == window) {
currentWindow.WebRunner._firstLoad = true;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment