Skip to content

Instantly share code, notes, and snippets.

@tetsuharuohzeki
Created October 16, 2010 00:30
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 tetsuharuohzeki/629216 to your computer and use it in GitHub Desktop.
Save tetsuharuohzeki/629216 to your computer and use it in GitHub Desktop.
空間ナビゲーション発動機
// ==UserScript==
// @name Ignition SpecialNavigation
// @namespace saneyuki_s
// @description Ignition SpecialNavigation.
// @include main
// @compatibility Firefox 3.6
// @author saneyuki_s
// @version 0.1.20101016.1
// ==/UserScript==
var SpNavigation = {
get prefSvc () {
delete this.prefSvc;
return this.prefSvc = Components.classes['@mozilla.org/preferences-service;1']
.getService(Components.interfaces.nsIPrefService);
},
get appContent () {
delete this.appContent;
return this.appContent = document.getElementById("appcontent");
},
handleEvent: function (aEvent) {
switch (aEvent.type) {
/*case "load":
this.onLoad();
break;*/
case "unload":
this.onUnLoad();
break;
case "DOMContentLoaded":
this.onDOMContentLoaded()
break;
}
},
onLoad: function () {
//window.removeEventListener("load", this, false);
window.addEventListener("unload", this, false);
Components.utils.import("resource://gre/modules/SpatialNavigation.js");
this.prefSvc.getBranch('').setBoolPref("snav.enabled", true);
this.appContent.addEventListener("DOMContentLoaded", this, false);
},
onUnLoad: function () {
window.removeEventListener("unload", this, false);
this.prefSvc.getBranch('').clearUserPref("snav.enabled");
this.appContent.removeEventListener("DOMContentLoaded", this, false);
},
onDOMContentLoaded: function () {
this.spNavInit();
},
spNavInit: function () {
Application.console.log("Ignition SpatialNavigation");//debug
SpatialNavigation.init(window.gBrowser.mCurrentBrowser);
},
};
//window.addEventListener("load", SpNavigation, false);
SpNavigation.onLoad();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment