Clickable Maps :: Version 3.21
Moderator: Tech Team
Forum rules
Please read the Community Guidelines before posting.
Please read the Community Guidelines before posting.
-
ParadiceCity9
- Posts: 4239
- Joined: Thu Feb 15, 2007 4:10 pm
Error console thing:
const CLASSNAME = "GM_GreasemonkeyService";
const CONTRACTID = "@greasemonkey.mozdev.org/greasemonkey-service;1";
const CID = Components.ID("{77bf3650-1cd6-11da-8cd6-0800200c9a66}");
const Cc = Components.classes;
const Ci = Components.interfaces;
const appSvc = Cc["@mozilla.org/appshell/appShellService;1"]
.getService(Ci.nsIAppShellService);
function alert(msg) {
Cc["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Ci.nsIPromptService)
.alert(null, "Greasemonkey alert", msg);
}
var greasemonkeyService = {
browserWindows: [],
// nsISupports
QueryInterface: function(aIID) {
if (!aIID.equals(Ci.nsIObserver) &&
!aIID.equals(Ci.nsISupports) &&
!aIID.equals(Ci.nsISupportsWeakReference) &&
!aIID.equals(Ci.gmIGreasemonkeyService) &&
!aIID.equals(Ci.nsIWindowMediatorListener) &&
!aIID.equals(Ci.nsIContentPolicy)) {
throw Components.results.NS_ERROR_NO_INTERFACE;
}
return this;
},
// nsIObserver
observe: function(aSubject, aTopic, aData) {
if (aTopic == "app-startup") {
this.startup();
}
},
// gmIGreasemonkeyService
registerBrowser: function(browserWin) {
var existing;
for (var i = 0; existing = this.browserWindows[i]; i++) {
if (existing == browserWin) {
throw new Error("Browser window has already been registered.");
}
}
this.browserWindows.push(browserWin);
},
unregisterBrowser: function(browserWin) {
var existing;
for (var i = 0; existing = this.browserWindows[i]; i++) {
if (existing == browserWin) {
this.browserWindows.splice(i, 1);
return;
}
}
throw new Error("Browser window is not registered.");
},
domContentLoaded: function(wrappedContentWin, chromeWin) {
var unsafeWin = wrappedContentWin.wrappedJSObject;
var unsafeLoc = new XPCNativeWrapper(unsafeWin, "location").location;
var href = new XPCNativeWrapper(unsafeLoc, "href").href;
var scripts = this.initScripts(href);
if (scripts.length > 0) {
this.injectScripts(scripts, href, unsafeWin, chromeWin);
}
},
startup: function() {
Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://global/content/XPCNativeWrapper.js");
Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://greasemonkey/content/prefmanager.js");
Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://greasemonkey/content/versioning.js");
Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://greasemonkey/content/utils.js");
Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://greasemonkey/content/config.js");
Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://greasemonkey/content/convert2RegExp.js");
Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://greasemonkey/content/miscapis.js");
Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://greasemonkey/content/xmlhttprequester.js");
//loggify(this, "GM_GreasemonkeyService");
},
shouldLoad: function(ct, cl, org, ctx, mt, ext) {
var ret = Ci.nsIContentPolicy.ACCEPT;
// don't intercept anything when GM is not enabled
if (!GM_getEnabled()) {
return ret;
}
// block content detection of greasemonkey by denying GM
// chrome content, unless loaded from chrome
if (org && org.scheme != "chrome" && cl.scheme == "chrome" &&
decodeURI(cl.host) == "greasemonkey") {
return Ci.nsIContentPolicy.REJECT_SERVER;
}
// don't interrupt the view-source: scheme
// (triggered if the link in the error console is clicked)
if ("view-source" == cl.scheme) {
return ret;
}
if (ct == Ci.nsIContentPolicy.TYPE_DOCUMENT &&
cl.spec.match(/\.user\.js$/)) {
dump("shouldload: " + cl.spec + "\n");
dump("ignorescript: " + this.ignoreNextScript_ + "\n");
if (!this.ignoreNextScript_) {
if (!this.isTempScript(cl)) {
var winWat = Cc["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Ci.nsIWindowWatcher);
if (winWat.activeWindow && winWat.activeWindow.GM_BrowserUI) {
winWat.activeWindow.GM_BrowserUI.startInstallScript(cl);
ret = Ci.nsIContentPolicy.REJECT_REQUEST;
}
}
}
}
this.ignoreNextScript_ = false;
return ret;
},
shouldProcess: function(ct, cl, org, ctx, mt, ext) {
return Ci.nsIContentPolicy.ACCEPT;
},
ignoreNextScript: function() {
dump("ignoring next script...\n");
this.ignoreNextScript_ = true;
},
isTempScript: function(uri) {
if (uri.scheme != "file") {
return false;
}
var fph = Components.classes["@mozilla.org/network/protocol;1?name=file"]
.getService(Ci.nsIFileProtocolHandler);
var file = fph.getFileFromURLSpec(uri.spec);
var tmpDir = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties)
.get("TmpD", Components.interfaces.nsILocalFile);
return file.parent.equals(tmpDir) && file.leafName != "newscript.user.js";
},
initScripts: function(url) {
var config = new Config(getScriptFile("config.xml"));
var scripts = [];
config.load();
outer:
for (var i = 0; i < config.scripts.length; i++) {
var script = config.scripts[i];
if (script.enabled) {
for (var j = 0; j < script.includes.length; j++) {
var pattern = convert2RegExp(script.includes[j]);
if (pattern.test(url)) {
for (var k = 0; k < script.excludes.length; k++) {
pattern = convert2RegExp(script.excludes[k]);
if (pattern.test(url)) {
continue outer;
}
}
scripts.push(script);
continue outer;
}
}
}
}
log("* number of matching scripts: " + scripts.length);
return scripts;
},
injectScripts: function(scripts, url, unsafeContentWin, chromeWin) {
var sandbox;
var script;
var logger;
var console;
var storage;
var xmlhttpRequester;
var safeWin = new XPCNativeWrapper(unsafeContentWin);
var safeDoc = safeWin.document;
// detect and grab reference to firebug console and context, if it exists
var firebugConsole = this.getFirebugConsole(unsafeContentWin, chromeWin);
for (var i = 0; script = scripts[i]; i++) {
sandbox = new Components.utils.Sandbox(safeWin);
logger = new GM_ScriptLogger(script);
console = firebugConsole ? firebugConsole : new GM_console(script);
storage = new GM_ScriptStorage(script);
xmlhttpRequester = new GM_xmlhttpRequester(unsafeContentWin,
appSvc.hiddenDOMWindow);
sandbox.window = safeWin;
sandbox.document = sandbox.window.document;
sandbox.unsafeWindow = unsafeContentWin;
// hack XPathResult since that is so commonly used
sandbox.XPathResult = Ci.nsIDOMXPathResult;
// add our own APIs
sandbox.GM_addStyle = function(css) { GM_addStyle(safeDoc, css) };
sandbox.GM_log = GM_hitch(logger, "log");
sandbox.console = console;
sandbox.GM_setValue = GM_hitch(storage, "setValue");
sandbox.GM_getValue = GM_hitch(storage, "getValue");
sandbox.GM_openInTab = GM_hitch(this, "openInTab", unsafeContentWin);
sandbox.GM_xmlhttpRequest = GM_hitch(xmlhttpRequester,
"contentStartRequest");
sandbox.GM_registerMenuCommand = GM_hitch(this,
"registerMenuCommand",
unsafeContentWin);
sandbox.__proto__ = safeWin;
this.evalInSandbox("(function(){\n" +
getContents(getScriptFileURI(script.filename)) +
"\n})()",
url,
sandbox,
script);
}
},
registerMenuCommand: function(unsafeContentWin, commandName, commandFunc,
accelKey, accelModifiers, accessKey) {
var command = {name: commandName,
accelKey: accelKey,
accelModifiers: accelModifiers,
accessKey: accessKey,
doCommand: commandFunc,
window: unsafeContentWin };
for (var i = 0; i < this.browserWindows.length; i++) {
this.browserWindows[i].registerMenuCommand(command);
}
},
openInTab: function(unsafeContentWin, url) {
var unsafeTop = new XPCNativeWrapper(unsafeContentWin, "top").top;
for (var i = 0; i < this.browserWindows.length; i++) {
this.browserWindows[i].openInTab(unsafeTop, url);
}
},
evalInSandbox: function(code, codebase, sandbox, script) {
if (!(Components.utils && Components.utils.Sandbox)) {
var e = new Error("Could not create sandbox.");
GM_logError(e, 0, e.fileName, e.lineNumber);
} else {
try {
// workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=307984
var lineFinder = new Error();
Components.utils.evalInSandbox(code, sandbox);
} catch (e) {
// try to find the line of the actual error line
var line = e.lineNumber;
if (4294967295 == line) {
// Line number is reported as max int in edge cases. Sometimes
// the right one is in the "location", instead. Look there.
if (e.location && e.location.lineNumber) {
line = e.location.lineNumber;
} else {
// Reporting max int is useless, if we couldn't find it in location
// either, forget it. Value of 0 isn't shown in the console.
line = 0;
}
}
if (line) {
line = line - lineFinder.lineNumber - 1;
}
GM_logError(
e, // error obj
0, // 0 = error (1 = warning)
getScriptFileURI(script.filename).spec,
line
);
}
}
},
getFirebugConsole:function(unsafeContentWin, chromeWin) {
var firebugConsoleCtor = null;
var firebugContext = null;
if (chromeWin && chromeWin.FirebugConsole) {
firebugConsoleCtor = chromeWin.FirebugConsole;
firebugContext = chromeWin.top.TabWatcher
.getContextByWindow(unsafeContentWin);
// on first load (of multiple tabs) the context might not exist
if (!firebugContext) firebugConsoleCtor = null;
}
if (firebugConsoleCtor && firebugContext) {
return new firebugConsoleCtor(firebugContext, unsafeContentWin);
} else {
return null;
}
}
};
greasemonkeyService.wrappedJSObject = greasemonkeyService;
//loggify(greasemonkeyService, "greasemonkeyService");
/**
* XPCOM Registration goop
*/
var Module = new Object();
Module.registerSelf = function(compMgr, fileSpec, location, type) {
compMgr = compMgr.QueryInterface(Ci.nsIComponentRegistrar);
compMgr.registerFactoryLocation(CID,
CLASSNAME,
CONTRACTID,
fileSpec,
location,
type);
var catMgr = Cc["@mozilla.org/categorymanager;1"]
.getService(Ci.nsICategoryManager);
catMgr.addCategoryEntry("app-startup",
CLASSNAME,
CONTRACTID,
true,
true);
catMgr.addCategoryEntry("content-policy",
CONTRACTID,
CONTRACTID,
true,
true);
}
Module.getClassObject = function(compMgr, cid, iid) {
if (!cid.equals(CID)) {
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
}
if (!iid.equals(Ci.nsIFactory)) {
throw Components.results.NS_ERROR_NO_INTERFACE;
}
return Factory;
}
Module.canUnload = function(compMgr) {
return true;
}
var Factory = new Object();
Factory.createInstance = function(outer, iid) {
if (outer != null) {
throw Components.results.NS_ERROR_NO_AGGREGATION;
}
return greasemonkeyService;
}
function NSGetModule(compMgr, fileSpec) {
return Module;
}
//loggify(Module, "greasemonkeyService:Module");
//loggify(Factory, "greasemonkeyService:Factory");
const CLASSNAME = "GM_GreasemonkeyService";
const CONTRACTID = "@greasemonkey.mozdev.org/greasemonkey-service;1";
const CID = Components.ID("{77bf3650-1cd6-11da-8cd6-0800200c9a66}");
const Cc = Components.classes;
const Ci = Components.interfaces;
const appSvc = Cc["@mozilla.org/appshell/appShellService;1"]
.getService(Ci.nsIAppShellService);
function alert(msg) {
Cc["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Ci.nsIPromptService)
.alert(null, "Greasemonkey alert", msg);
}
var greasemonkeyService = {
browserWindows: [],
// nsISupports
QueryInterface: function(aIID) {
if (!aIID.equals(Ci.nsIObserver) &&
!aIID.equals(Ci.nsISupports) &&
!aIID.equals(Ci.nsISupportsWeakReference) &&
!aIID.equals(Ci.gmIGreasemonkeyService) &&
!aIID.equals(Ci.nsIWindowMediatorListener) &&
!aIID.equals(Ci.nsIContentPolicy)) {
throw Components.results.NS_ERROR_NO_INTERFACE;
}
return this;
},
// nsIObserver
observe: function(aSubject, aTopic, aData) {
if (aTopic == "app-startup") {
this.startup();
}
},
// gmIGreasemonkeyService
registerBrowser: function(browserWin) {
var existing;
for (var i = 0; existing = this.browserWindows[i]; i++) {
if (existing == browserWin) {
throw new Error("Browser window has already been registered.");
}
}
this.browserWindows.push(browserWin);
},
unregisterBrowser: function(browserWin) {
var existing;
for (var i = 0; existing = this.browserWindows[i]; i++) {
if (existing == browserWin) {
this.browserWindows.splice(i, 1);
return;
}
}
throw new Error("Browser window is not registered.");
},
domContentLoaded: function(wrappedContentWin, chromeWin) {
var unsafeWin = wrappedContentWin.wrappedJSObject;
var unsafeLoc = new XPCNativeWrapper(unsafeWin, "location").location;
var href = new XPCNativeWrapper(unsafeLoc, "href").href;
var scripts = this.initScripts(href);
if (scripts.length > 0) {
this.injectScripts(scripts, href, unsafeWin, chromeWin);
}
},
startup: function() {
Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://global/content/XPCNativeWrapper.js");
Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://greasemonkey/content/prefmanager.js");
Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://greasemonkey/content/versioning.js");
Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://greasemonkey/content/utils.js");
Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://greasemonkey/content/config.js");
Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://greasemonkey/content/convert2RegExp.js");
Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://greasemonkey/content/miscapis.js");
Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://greasemonkey/content/xmlhttprequester.js");
//loggify(this, "GM_GreasemonkeyService");
},
shouldLoad: function(ct, cl, org, ctx, mt, ext) {
var ret = Ci.nsIContentPolicy.ACCEPT;
// don't intercept anything when GM is not enabled
if (!GM_getEnabled()) {
return ret;
}
// block content detection of greasemonkey by denying GM
// chrome content, unless loaded from chrome
if (org && org.scheme != "chrome" && cl.scheme == "chrome" &&
decodeURI(cl.host) == "greasemonkey") {
return Ci.nsIContentPolicy.REJECT_SERVER;
}
// don't interrupt the view-source: scheme
// (triggered if the link in the error console is clicked)
if ("view-source" == cl.scheme) {
return ret;
}
if (ct == Ci.nsIContentPolicy.TYPE_DOCUMENT &&
cl.spec.match(/\.user\.js$/)) {
dump("shouldload: " + cl.spec + "\n");
dump("ignorescript: " + this.ignoreNextScript_ + "\n");
if (!this.ignoreNextScript_) {
if (!this.isTempScript(cl)) {
var winWat = Cc["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Ci.nsIWindowWatcher);
if (winWat.activeWindow && winWat.activeWindow.GM_BrowserUI) {
winWat.activeWindow.GM_BrowserUI.startInstallScript(cl);
ret = Ci.nsIContentPolicy.REJECT_REQUEST;
}
}
}
}
this.ignoreNextScript_ = false;
return ret;
},
shouldProcess: function(ct, cl, org, ctx, mt, ext) {
return Ci.nsIContentPolicy.ACCEPT;
},
ignoreNextScript: function() {
dump("ignoring next script...\n");
this.ignoreNextScript_ = true;
},
isTempScript: function(uri) {
if (uri.scheme != "file") {
return false;
}
var fph = Components.classes["@mozilla.org/network/protocol;1?name=file"]
.getService(Ci.nsIFileProtocolHandler);
var file = fph.getFileFromURLSpec(uri.spec);
var tmpDir = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties)
.get("TmpD", Components.interfaces.nsILocalFile);
return file.parent.equals(tmpDir) && file.leafName != "newscript.user.js";
},
initScripts: function(url) {
var config = new Config(getScriptFile("config.xml"));
var scripts = [];
config.load();
outer:
for (var i = 0; i < config.scripts.length; i++) {
var script = config.scripts[i];
if (script.enabled) {
for (var j = 0; j < script.includes.length; j++) {
var pattern = convert2RegExp(script.includes[j]);
if (pattern.test(url)) {
for (var k = 0; k < script.excludes.length; k++) {
pattern = convert2RegExp(script.excludes[k]);
if (pattern.test(url)) {
continue outer;
}
}
scripts.push(script);
continue outer;
}
}
}
}
log("* number of matching scripts: " + scripts.length);
return scripts;
},
injectScripts: function(scripts, url, unsafeContentWin, chromeWin) {
var sandbox;
var script;
var logger;
var console;
var storage;
var xmlhttpRequester;
var safeWin = new XPCNativeWrapper(unsafeContentWin);
var safeDoc = safeWin.document;
// detect and grab reference to firebug console and context, if it exists
var firebugConsole = this.getFirebugConsole(unsafeContentWin, chromeWin);
for (var i = 0; script = scripts[i]; i++) {
sandbox = new Components.utils.Sandbox(safeWin);
logger = new GM_ScriptLogger(script);
console = firebugConsole ? firebugConsole : new GM_console(script);
storage = new GM_ScriptStorage(script);
xmlhttpRequester = new GM_xmlhttpRequester(unsafeContentWin,
appSvc.hiddenDOMWindow);
sandbox.window = safeWin;
sandbox.document = sandbox.window.document;
sandbox.unsafeWindow = unsafeContentWin;
// hack XPathResult since that is so commonly used
sandbox.XPathResult = Ci.nsIDOMXPathResult;
// add our own APIs
sandbox.GM_addStyle = function(css) { GM_addStyle(safeDoc, css) };
sandbox.GM_log = GM_hitch(logger, "log");
sandbox.console = console;
sandbox.GM_setValue = GM_hitch(storage, "setValue");
sandbox.GM_getValue = GM_hitch(storage, "getValue");
sandbox.GM_openInTab = GM_hitch(this, "openInTab", unsafeContentWin);
sandbox.GM_xmlhttpRequest = GM_hitch(xmlhttpRequester,
"contentStartRequest");
sandbox.GM_registerMenuCommand = GM_hitch(this,
"registerMenuCommand",
unsafeContentWin);
sandbox.__proto__ = safeWin;
this.evalInSandbox("(function(){\n" +
getContents(getScriptFileURI(script.filename)) +
"\n})()",
url,
sandbox,
script);
}
},
registerMenuCommand: function(unsafeContentWin, commandName, commandFunc,
accelKey, accelModifiers, accessKey) {
var command = {name: commandName,
accelKey: accelKey,
accelModifiers: accelModifiers,
accessKey: accessKey,
doCommand: commandFunc,
window: unsafeContentWin };
for (var i = 0; i < this.browserWindows.length; i++) {
this.browserWindows[i].registerMenuCommand(command);
}
},
openInTab: function(unsafeContentWin, url) {
var unsafeTop = new XPCNativeWrapper(unsafeContentWin, "top").top;
for (var i = 0; i < this.browserWindows.length; i++) {
this.browserWindows[i].openInTab(unsafeTop, url);
}
},
evalInSandbox: function(code, codebase, sandbox, script) {
if (!(Components.utils && Components.utils.Sandbox)) {
var e = new Error("Could not create sandbox.");
GM_logError(e, 0, e.fileName, e.lineNumber);
} else {
try {
// workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=307984
var lineFinder = new Error();
Components.utils.evalInSandbox(code, sandbox);
} catch (e) {
// try to find the line of the actual error line
var line = e.lineNumber;
if (4294967295 == line) {
// Line number is reported as max int in edge cases. Sometimes
// the right one is in the "location", instead. Look there.
if (e.location && e.location.lineNumber) {
line = e.location.lineNumber;
} else {
// Reporting max int is useless, if we couldn't find it in location
// either, forget it. Value of 0 isn't shown in the console.
line = 0;
}
}
if (line) {
line = line - lineFinder.lineNumber - 1;
}
GM_logError(
e, // error obj
0, // 0 = error (1 = warning)
getScriptFileURI(script.filename).spec,
line
);
}
}
},
getFirebugConsole:function(unsafeContentWin, chromeWin) {
var firebugConsoleCtor = null;
var firebugContext = null;
if (chromeWin && chromeWin.FirebugConsole) {
firebugConsoleCtor = chromeWin.FirebugConsole;
firebugContext = chromeWin.top.TabWatcher
.getContextByWindow(unsafeContentWin);
// on first load (of multiple tabs) the context might not exist
if (!firebugContext) firebugConsoleCtor = null;
}
if (firebugConsoleCtor && firebugContext) {
return new firebugConsoleCtor(firebugContext, unsafeContentWin);
} else {
return null;
}
}
};
greasemonkeyService.wrappedJSObject = greasemonkeyService;
//loggify(greasemonkeyService, "greasemonkeyService");
/**
* XPCOM Registration goop
*/
var Module = new Object();
Module.registerSelf = function(compMgr, fileSpec, location, type) {
compMgr = compMgr.QueryInterface(Ci.nsIComponentRegistrar);
compMgr.registerFactoryLocation(CID,
CLASSNAME,
CONTRACTID,
fileSpec,
location,
type);
var catMgr = Cc["@mozilla.org/categorymanager;1"]
.getService(Ci.nsICategoryManager);
catMgr.addCategoryEntry("app-startup",
CLASSNAME,
CONTRACTID,
true,
true);
catMgr.addCategoryEntry("content-policy",
CONTRACTID,
CONTRACTID,
true,
true);
}
Module.getClassObject = function(compMgr, cid, iid) {
if (!cid.equals(CID)) {
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
}
if (!iid.equals(Ci.nsIFactory)) {
throw Components.results.NS_ERROR_NO_INTERFACE;
}
return Factory;
}
Module.canUnload = function(compMgr) {
return true;
}
var Factory = new Object();
Factory.createInstance = function(outer, iid) {
if (outer != null) {
throw Components.results.NS_ERROR_NO_AGGREGATION;
}
return greasemonkeyService;
}
function NSGetModule(compMgr, fileSpec) {
return Module;
}
//loggify(Module, "greasemonkeyService:Module");
//loggify(Factory, "greasemonkeyService:Factory");
- edthemaster
- Posts: 111
- Joined: Mon Jan 29, 2007 3:07 am
- Contact:
ParadiceCity9 wrote:Error console thing:
dice, not to frustrate you, but this doesn't do me any good. what i need is the errors from the error console. what you gave me is the script that generated the errors. if you right-click each error and copy it, then you can paste it on the forum. it should look something like this (i pasted this from my error console):
Error: document.getElementById("to_country") has no properties
Source File: file:///C:/Documents%20and%20Settings/Enoch/Application%20Data/Mozilla/Firefox/Profiles/izyl5o8t.default/extensions/%7Be4a8a97b-f2ed-450b-b12d-ee082ba24781%7D/components/greasemonkey.js
Line: 672
but before you do any of that, what exactly is happening now? what problem are you having? the better you describe it the better chance i have of fixing it.
btw, coleman, i'm glad to hear you're not having any more problems. i hope this is the same for everyone else
- edthemaster
- Posts: 111
- Joined: Mon Jan 29, 2007 3:07 am
- Contact:
yeti_c wrote:edthemaster wrote:yeti_c wrote:EdTheMaster...
If you get the latest BOB - take a look at the outer-rolls coding and see if you can fix the bug - I won't have any time to look at it til Thursday!!
Thanks in advance.
C.
c, if i get the time i will, but with my night classes starting up again and my work schedule getting crazier (not to mention the bugs i still need to fix in clickable maps), i can't make you any promises...
Any help would be most appreciated!!!
Cheers,
C.
c, i took a quick look, but without time to dig into it i will just tell you how i think i might approach fixing it: take the outer-rolls innerHTML and place it inside the action menu, or possibly use the appendChild method to place the entire element itself inside the action menu? it looks like the problem is that the outer-rolls and action-menu elements are different and separate--somehow they need to be combined, and they will need to be combined every time the dice are rolled, i think
- edthemaster
- Posts: 111
- Joined: Mon Jan 29, 2007 3:07 am
- Contact:
edthemaster wrote:yeti_c wrote:edthemaster wrote:yeti_c wrote:EdTheMaster...
If you get the latest BOB - take a look at the outer-rolls coding and see if you can fix the bug - I won't have any time to look at it til Thursday!!
Thanks in advance.
C.
c, if i get the time i will, but with my night classes starting up again and my work schedule getting crazier (not to mention the bugs i still need to fix in clickable maps), i can't make you any promises...
Any help would be most appreciated!!!
Cheers,
C.
c, i took a quick look, but without time to dig into it i will just tell you how i think i might approach fixing it: take the outer-rolls innerHTML and place it inside the action menu, or possibly use the appendChild method to place the entire element itself inside the action menu? it looks like the problem is that the outer-rolls and action-menu elements are different and separate--somehow they need to be combined, and they will need to be combined every time the dice are rolled, i think
Yeah not a bad idea - instead of popping it off the page - just copy it into a new Div of my own making...
C.

Highest score : 2297
-
ParadiceCity9
- Posts: 4239
- Joined: Thu Feb 15, 2007 4:10 pm
- rebelman
- Posts: 2968
- Joined: Thu Aug 02, 2007 5:24 pm
- Gender: Male
- Location: People's Republic of Cork
- Contact:
just added this script but would love a step by step guide as to how to use it if someone could post it here
thanks in advance
thanks in advance
Don't now why people on here don't like being cooks, remember under siege: A former SEAL, now cook, is the only person who can stop a gang of terrorists when they sieze control of a US Navy battleship.
- edthemaster
- Posts: 111
- Joined: Mon Jan 29, 2007 3:07 am
- Contact:
yeti_c wrote:ParadiceCity9 wrote:new error console thing:
Error: uncaught exception: Permission denied to call method Location.toString
Weird - is that even in your code Ed - could change with "location.href"
C.
no, that's not even in my code...
paradice, is your clickable maps script not working? if not, please just tell me what is/is not happening...
- hecter
- Posts: 14632
- Joined: Tue Jan 09, 2007 6:27 pm
- Gender: Female
- Location: Tying somebody up on the third floor
- Contact:
rebelman wrote:just added this script but would love a step by step guide as to how to use it if someone could post it here
thanks in advance
There are pop up instructions if you turn them on. Basically: click to deply; click to choose where you want to attack from, and then click where you want to attack (shift + click to auto), then click and shift+click to fortify.
In heaven... Everything is fine, in heaven... Everything is fine, in heaven... Everything is fine... You got your things, and I've got mine.


-
ParadiceCity9
- Posts: 4239
- Joined: Thu Feb 15, 2007 4:10 pm
edthemaster wrote:yeti_c wrote:ParadiceCity9 wrote:new error console thing:
Error: uncaught exception: Permission denied to call method Location.toString
Weird - is that even in your code Ed - could change with "location.href"
C.
no, that's not even in my code...
paradice, is your clickable maps script not working? if not, please just tell me what is/is not happening...
It's working, just occasionally the entire page will just not work. I dno it might be BOB.
yeti_c wrote:edthemaster wrote:yeti_c wrote:edthemaster wrote:yeti_c wrote:EdTheMaster...
If you get the latest BOB - take a look at the outer-rolls coding and see if you can fix the bug - I won't have any time to look at it til Thursday!!
Thanks in advance.
C.
c, if i get the time i will, but with my night classes starting up again and my work schedule getting crazier (not to mention the bugs i still need to fix in clickable maps), i can't make you any promises...
Any help would be most appreciated!!!
Cheers,
C.
c, i took a quick look, but without time to dig into it i will just tell you how i think i might approach fixing it: take the outer-rolls innerHTML and place it inside the action menu, or possibly use the appendChild method to place the entire element itself inside the action menu? it looks like the problem is that the outer-rolls and action-menu elements are different and separate--somehow they need to be combined, and they will need to be combined every time the dice are rolled, i think
Yeah not a bad idea - instead of popping it off the page - just copy it into a new Div of my own making...
C.
Found a better fix - I was popping off a TD - but Lack sticks a Div in there too called "rolls" so Instead of popping off the TD - I just popped the Div - and that works beautifully...
Good old Firebug helped me find that - you'd never see it in a view source because the source doesn't update when it's dynamically changed.
C.

Highest score : 2297
- edthemaster
- Posts: 111
- Joined: Mon Jan 29, 2007 3:07 am
- Contact:
rebelman wrote:just added this script but would love a step by step guide as to how to use it if someone could post it here
thanks in advance
rebelman, after having the script installed for a while, do you now understand how to use it, or would you still like a step-by-step guide?
i ask because i tried to make things as intuitive as possible so that instructions would hopefully be unnecessary, but if people feel that instructions would be helpful i will be happy to create them.
-
ParadiceCity9
- Posts: 4239
- Joined: Thu Feb 15, 2007 4:10 pm
- hecter
- Posts: 14632
- Joined: Tue Jan 09, 2007 6:27 pm
- Gender: Female
- Location: Tying somebody up on the third floor
- Contact:
ParadiceCity9 wrote:well, i'm a speed type of guy, and version 1.0 was much faster...BUT it till may be the BOB i don't know. but if you do recall I posted the script for 1.0 on an earlier page if you can get that for me somehow.
Take the script, copy it into NotePad or something like that, and save it as NAME.user.js, then install it.
In heaven... Everything is fine, in heaven... Everything is fine, in heaven... Everything is fine... You got your things, and I've got mine.


- Scott-Land
- Posts: 2423
- Joined: Tue Jan 23, 2007 9:37 pm
-
ParadiceCity9
- Posts: 4239
- Joined: Thu Feb 15, 2007 4:10 pm
hecter wrote:ParadiceCity9 wrote:well, i'm a speed type of guy, and version 1.0 was much faster...BUT it till may be the BOB i don't know. but if you do recall I posted the script for 1.0 on an earlier page if you can get that for me somehow.
Take the script, copy it into NotePad or something like that, and save it as NAME.user.js, then install it.
how do i install it?
- hecter
- Posts: 14632
- Joined: Tue Jan 09, 2007 6:27 pm
- Gender: Female
- Location: Tying somebody up on the third floor
- Contact:
ParadiceCity9 wrote:hecter wrote:ParadiceCity9 wrote:well, i'm a speed type of guy, and version 1.0 was much faster...BUT it till may be the BOB i don't know. but if you do recall I posted the script for 1.0 on an earlier page if you can get that for me somehow.
Take the script, copy it into NotePad or something like that, and save it as NAME.user.js, then install it.
how do i install it?
Try dragging it into your firefox window.
In heaven... Everything is fine, in heaven... Everything is fine, in heaven... Everything is fine... You got your things, and I've got mine.


- edthemaster
- Posts: 111
- Joined: Mon Jan 29, 2007 3:07 am
- Contact:
ed, odd little bug.
When I press a number to select armies for deploy/advance, I seem to get the wrong number (usually 2 or 4) a lot of the time. I havn't been able to reproduce this yet...any thoughts on what I might try?
Twill
When I press a number to select armies for deploy/advance, I seem to get the wrong number (usually 2 or 4) a lot of the time. I havn't been able to reproduce this yet...any thoughts on what I might try?
Twill
Retired.
Please don't PM me about forum stuff any more.
Essential forum poster viewing:
Posting, and You! and How to behave on an internet forum...on the internet
Please don't PM me about forum stuff any more.
Essential forum poster viewing:
Posting, and You! and How to behave on an internet forum...on the internet
- edthemaster
- Posts: 111
- Joined: Mon Jan 29, 2007 3:07 am
- Contact:
Twill wrote:ed, odd little bug.
When I press a number to select armies for deploy/advance, I seem to get the wrong number (usually 2 or 4) a lot of the time. I havn't been able to reproduce this yet...any thoughts on what I might try?
Twill
hmmm.... i haven't seen this bug, probably because i never really use the number keys... but i do remember someone else having a similar problem. i can't think of anything to try other than to use the increase/decrease arrows or shortcuts keys, but i will make it a point to use the number keys while i'm playing my games to see if i can recreate and solve the problem.