I'm getting some strange errors when loading up Firefox or when
reloading commands (e.g. when editing a command in the text editor).
When this occurs, I can't get the Ubiquity window to come up and
commands (obviously) don't work. Can anyone identify what is going on
from the following errors?
It's almost like every command in my "library" is unacceptable
somehow... and then it gives an error message that identifies a non-
existent line number (e.g. sandboxfactory.js (line 2849))
Any help would be appreciated.
Thanks,
Duane
CmdUtils.makeSearchCommand({name: "getimages", version: "0.2.3",
author: {name: "Federico Parodi", email: "[email protected]"},
homepage: "http://www.jimmy2k.it/getimagescommand", license: "MPL",
icon: "http://www.google.com/favicon.ico", description: "Browse and
embed pictures from Google Images", help: "Press return to show the
Google Images results, left click on a picture to watch it, right
click to insert it in a text or rich text area", takes: {description:
noun_arb_text}, url: "http://images.google.com/images?hl=en&q=
{QUERY}", pageCounter: 0, imgsPerPage: 8, previewDelay: 500, preview:
function (pblock, name) {var nameText = name.text;if (nameText.length
< 1) {pblock.innerHTML = "Search on Google Images.";return;}var apiUrl
= "http://ajax.googleapis.com/ajax/services/search/images";pageCounter
= 0;var pageArray = new Array;var previousResult = 0; function refresh
(currentResult, imgsPerPage) {pblock.innerHTML = "Searching on Google
Images...";if (currentResult > previousResult) {pageCounter++;} else
{pageCounter--;}previousResult = currentResult;pageArray[pageCounter]
= currentResult;var newPageItem = (pageCounter * imgsPerPage) - 8;var
randomCode = Math.floor(Math.random() * 1000000001);var apiParams =
{q: nameText, v: "1.0", rsz: "large", start:
newPageItem};CmdUtils.previewAjax(pblock, {type: "GET", url: apiUrl,
data: apiParams, datatype: "string", error: function ()
{pblock.innerHTML = "<i>Connection error.</i>";}, success: function
(response) {var responseData = null;try {responseData =
Utils.decodeJson(response).responseData;} catch (e) {pblock.innerHTML
= "Server error";displayMessage("Server error");return;} function
action(e, image) {var rightclick = false;if (!e) {var e =
window.event;}if (e.which) {rightclick = e.which == 3;} else if
(e.button) {rightclick = e.button == 2;}if (rightclick) {var doc =
context.focusedWindow.document;var focused = context.focusedElement;if
(doc.designMode == "on") {doc.execCommand("insertHTML", false, "<img
src='" + image.title + "'/>");} else if (focused != null &&
(focused.type == "textarea" || focused.type == "text"))
{CmdUtils.setSelection(image.title);} else {displayMessage("Sorry,
this function can be used in an editable box only");}} else
{CmdUtils.setLastResult(image.title);Utils.openUrlInBrowser
(image.title);}var mainWindow = window.QueryInterface
(Components.interfaces.nsIInterfaceRequestor).getInterface
(Components.interfaces.nsIWebNavigation).QueryInterface
(Components.interfaces.nsIDocShellTreeItem).rootTreeItem.QueryInterface
(Components.interfaces.nsIInterfaceRequestor).getInterface
(Components.interfaces.nsIDOMWindow);mainWindow.gUbiquity.closeWindow
();} template = "<img id=\"img${counter}\" src=\"${thumb}\" title=\"$
{imgurl}\" style=\"position: absolute; height:80px; margin: 5px;
border:0px; vertical-align:top; z-index: 0; border: 0px solid #00C600;
-moz-border-radius: 3px;\" alt=\".\" class=\"thumbnail\"/>";var
htmlData = "Image Search results for " + nameText;htmlData += "<div id=
\"resImg\" style=\"position: relative;\">";var numberOfResults =
responseData.results.length;var resultsArray =
responseData.results;for (var index = 0; index < numberOfResults; index
++) {var imgCode = randomCode + index;templateData = {imgurl:
resultsArray[index].url, thumb: resultsArray[index].tbUrl, counter:
imgCode};htmlData += CmdUtils.renderTemplate(template, templateData);}
htmlData += "<div id=\"controls\" style=\"position: relative; width:
95%; top:270px;\"><div id=\"prev\" class=\"control\" style=
\"display:none; float: left;width: 80px; height: 50px; border: 2px
solid #00C600; -moz-border-radius: 3px; text-align: center; padding-
top: 30px; opacity: 0.5\">Prev</div>";if (pageCounter < 8) {htmlData
+= "<div id=\"next\" class=\"control\" style=\"float: right;width:
80px; height: 50px; border: 2px solid #00C600; -moz-border-radius:
3px; text-align: center; padding-top: 30px; opacity: 0.5\">Next</div></
div></div>";} else {htmlData += "<div id=\"next\" class=\"control\"
style=\"float: right;width: 80px; height: 50px; border: 2px solid
#00C600; -moz-border-radius: 3px; text-align: center; padding-top:
30px; opacity: 0.5\">More<br/>on site</div></div></div>";}
pblock.innerHTML = htmlData;var moreButton = jQuery
(pblock.ownerDocument).find("div#next");var prevButton = jQuery
(pblock.ownerDocument).find("div#prev");var controls = jQuery
(pblock.ownerDocument).find("div.control");controls.mouseover(function
() {jQuery(this).animate({opacity: 1}, 250);});controls.mouseout
(function () {jQuery(this).animate({opacity: 0.5},
250);});moreButton.click(function () {if (pageCounter < 8) {refresh
(currentResult, imgsPerPage);} else {Utils.openUrlInBrowser("http://
images.google.com/images?q=" + nameText + "&start=64");var mainWindow
= window.QueryInterface
(Components.interfaces.nsIInterfaceRequestor).getInterface
(Components.interfaces.nsIWebNavigation).QueryInterface
(Components.interfaces.nsIDocShellTreeItem).rootTreeItem.QueryInterface
(Components.interfaces.nsIInterfaceRequestor).getInterface
(Components.interfaces.nsIDOMWindow);mainWindow.gUbiquity.closeWindow
();}});prevButton.click(function () {refresh(pageArray[pageCounter -
1], imgsPerPage);});if (pageCounter != 1) {prevButton.css("display",
"inline");}var col = 0;var row = 0;for (var index = 0; index <
numberOfResults; index++) {var elementName = "img" + (randomCode +
index);var imgTag = jQuery(pblock.ownerDocument).find("img#" +
elementName);imgTag.mousedown(function (e) {action(e, this);});var
thisWidth = Math.floor((resultsArray[index].tbWidth / resultsArray
[index].tbHeight) * 80);if (thisWidth > 470) {thisWidth =
470;imgTag.css("width", thisWidth);}if ((col + thisWidth) > 470) {row
+= 85;col = 0;}imgTag.css("left", col);imgTag.css("top", row);if (row
>= 255) {imgTag.css("display", "none");} else {currentResult++;}var
leftBig = Math.floor((thisWidth * -0.0625) + 5);imgTag.mouseover
(function () {jQuery(this).css("z-index", 100);jQuery(this).animate
({height: "90px", marginTop: "0px", marginLeft: leftBig, borderWidth:
"2px"}, 80);});col += thisWidth + 5;}jQuery(pblock.ownerDocument).find
(".thumbnail").mouseout(function () {jQuery(this).css("z-index",
0);jQuery(this).animate({height: "80px", marginTop: "5px", marginLeft:
"5px", borderWidth: "0px"}, 80);});}});} refresh(1,
this.imgsPerPage);}}) is not a function
[Break on this error] (2849 out of range 139)
sandboxfactory.js (line 2849)
Traceback for last exception: @file:///Users/duane/Library/Application
%20Support/Firefox/Profiles/pqij1ht1.default/extensions/
[email protected]/modules/sandboxfactory.js:2849
[Break on this error] Components.utils.reportError("Traceback for last
exception:\n" + tb);
msgservice.js (line 88)
CmdUtils.CreateCommand({name: "gcalc", takes: {expression:
noun_arb_text}, description: "Google's calculator: knows many
functions, constants, units, currencies, etc.", help: "Try 5% of 700,
sin( sqrt( ln(pi))), (1+i)^3, 15 mod 9, (5 choose 2) / 3!, speed of
light in miles per hour, 3 dollars in euros, 242 in hex, MCMXVI in
decimal.", icon: "chrome://ubiquity/content/icons/calculator.png",
author: {name: "Axel Boldt", email: "[email protected]"}, homepage:
"http://math-www.uni-paderborn.de/~axel/", license: "Public domain",
_google_url: "http://www.google.com/search?hl=en&num=1&q=",
_calc_regexp: /\/calc_img\.gif.*?<b>(.*?)<\/b>/i, _calc_help:
"Examples: 3^4/sqrt(2)-pi, 3 inch in cm, speed
of light, 0xAF in decimal<br><u><a href=\"http://
www.googleguide.com/calculator.html\">(Google calculator command list)
</a></u>", execute: function (directObj) {var expression =
directObj.text;var url = this._google_url + encodeURIComponent
(expression);Utils.openUrlInBrowser(url);}, preview: function (pblock,
directObj) {var expression = directObj.text;var cmd =
this;pblock.innerHTML = this._calc_help;jQuery.get(this._google_url +
encodeURIComponent(expression), {}, function (result_page) {var
matchresult = result_page.match(cmd._calc_regexp);if (matchresult)
{pblock.innerHTML = "<h2>" + matchresult[1] + "</h2>" +
cmd._calc_help;} else {pblock.innerHTML = cmd._calc_help;}});}}) is
not a function
[Break on this error] (2653 out of range 139)
sandboxfactory.js (line 2653)
Traceback for last exception: @file:///Users/duane/Library/Application
%20Support/Firefox/Profiles/pqij1ht1.default/extensions/
[email protected]/modules/sandboxfactory.js:2653
[Break on this error] Components.utils.reportError("Traceback for last
exception:\n" + tb);
msgservice.js (line 88)
CmdUtils.CreateCommand({name: "bugmenot", homepage: "http://
www.yalazi.org/ubiquity", author: {name: "Onur YALAZI", email:
"[email protected]"}, license: "MPL", description: "modified by
Brandon Goldsworthy. Get password for current page or entry from
bugmenot.com", help: "If you're in an editable text area, inserts
<username:password> double", _decodeIt: function (data, key) {var b64
= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
=";var o11 = "";var o21 = "";var o31 = "";var h11 = "";var h21 =
"";var h31 = "";var h41 = "";var bits1 = "";var i1 = 0;var enc1 =
"";do {h11 = b64.indexOf(data.charAt(i1++));h21 = b64.indexOf
(data.charAt(i1++));h31 = b64.indexOf(data.charAt(i1++));h41 =
b64.indexOf(data.charAt(i1++));bits1 = h11 << 18 | h21 << 12 | h31 <<
6 | h41;o11 = bits1 >> 16 & 255;o21 = bits1 >> 8 & 255;o31 = bits1 &
255;if (h31 == 64) {enc1 += String.fromCharCode(o11);} else if (h41 ==
64) {enc1 += String.fromCharCode(o11, o21);} else {enc1 +=
String.fromCharCode(o11, o21, o31);}} while (i1 <
data.length);strInput = enc1;strOutput = "";intOffset = (key + 112) /
12;for (i1 = 4; i1 < strInput.length; i1++) {thisLetter =
strInput.charAt(i1);thisCharCode = strInput.charCodeAt(i1);newCharCode
= thisCharCode - intOffset;strOutput += String.fromCharCode
(newCharCode);}return strOutput;}, _inField: function () {return
context.focusedWindow.document.designMode == "on" ||
context.focusedElement && context.focusedElement.selectionStart >=
0;}, _getPassword: function (urlAddress, parent, pblock) {var baseUrl
= "http://www.bugmenot.com/view/" + urlAddress.text;if (!pblock && !
this._inField()) {Utils.openUrlInBrowser(baseUrl);} else {jQuery.ajax
({url: baseUrl, error: function () {if (pblock) {pblock.innerHTML +=
"Passwords not found.<br />";} else {displayMessage("Passwords not
found.");CmdUtils.setSelection("Passwords not found.");}}, success:
function (passwords) {key = parseInt(passwords.match(/key.=.([0-9]*)/)
[1]);var result = "";arrayToWork = passwords.split("<div class=
\"account\"");if (arrayToWork.length && arrayToWork.length > 1)
{o_password = "";o_username = "";o_rate = 0;for (i = 0; i <
arrayToWork.length; i++) {if (pair = arrayToWork[i].match(/d\('(.*)'\)/
g)) {rate = parseInt(arrayToWork[i].match(/[0-9]{1,3}%/));username =
pair[0].match(/'(.*)'/)[1];username = parent._decodeIt(username,
key);password = pair[1].match(/'(.*)'/)[1];password = parent._decodeIt
(password, key);if (pblock) {pblock.innerHTML += rate + "% " +
username + ":" + password + "<br />";}if (rate > o_rate) {o_password =
password;o_username = username;o_rate = rate;}}}if (o_rate > 0)
{result = o_username + ":" + o_password;} else {result = "Passwords
not found.";if (pblock) {pblock.innerHTML += "Passwords not found.<br /
>";}}} else {result = "Passwords not found.";if (pblock)
{pblock.innerHTML += "Passwords not found.<br />";}}if (!pblock)
{displayMessage(result);CmdUtils.setSelection(result);}}});}}, takes:
{url: noun_arb_text}, preview: function (pblock, urlAddress)
{pblock.innerHTML = "";if (urlAddress.text.length < 1)
{urlAddress.text = String
(Application.activeWindow.activeTab.document.location);}
pblock.innerHTML = "Passwords for: " + urlAddress.text + "<br /
>";this._getPassword(urlAddress, this, pblock);}, execute: function
(urlAddress) {if (urlAddress.text.length < 1) {urlAddress.text = String
(Application.activeWindow.activeTab.document.location);}
this._getPassword(urlAddress, this, false);}}) is not a function
[Break on this error] (2763 out of range 139)
sandboxfactory.js (line 2763)
Traceback for last exception: @file:///Users/duane/Library/Application
%20Support/Firefox/Profiles/pqij1ht1.default/extensions/
[email protected]/modules/sandboxfactory.js:2763
[Break on this error] Components.utils.reportError("Traceback for last
exception:\n" + tb);
msgservice.js (line 88)
CmdUtils.CreateCommand({name: "search-domain-name", icon: "http://
instantdomainsearch.com/favicon.ico", author: {name: "Pratham Kumar",
email: "[email protected]"}, description: "Checks availabilty of
the domain name with com/net/org TLDs.", homepage: "http://
pratham.name/", takes: {'example.com': noun_arb_text}, preview:
function (html, q) {var params = {name: q.text};html.innerHTML =
"Searching for <b>" + q.text + "</b>";jQuery.get("http://
instantdomainsearch.com/services/rest/", params, function (data) {data
= eval("(" + data + ")");var name = data.name;html.innerHTML = name +
" - <a style=\"color:" + (data.com == "a" ? "green" : "red") + "\"
href=\"http://" + name + ".com/\">com</b> <a href=\"http://" + name +
".net/\" style=\"color:" + (data.net == "a" ? "green" : "red") +
"\">net</a> <a href=\"http://" + name + ".org/\" style=\"color:" +
(data.org == "a" ? "green" : "red") + "\">org</a>";});}}) is not a
function
[Break on this error] (2625 out of range 139)
sandboxfactory.js (line 2625)
Traceback for last exception: @file:///Users/duane/Library/Application
%20Support/Firefox/Profiles/pqij1ht1.default/extensions/
[email protected]/modules/sandboxfactory.js:2625
[Break on this error] Components.utils.reportError("Traceback for last
exception:\n" + tb);
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ubiquity-firefox" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ubiquity-firefox?hl=en
-~----------~----~----~----~------~----~------~--~---