diff --git a/xul/content/static.js b/xul/content/static.js --- a/xul/content/static.js +++ b/xul/content/static.js @@ -346,34 +346,38 @@ function initStatic() * hence the second if statement */ if (item == null) { var invalidFile = new nsLocalFile(client.prefs["profilePath"]); invalidFile.append("awayMsgs.invalid"); invalidFile.createUnique(FTYPE_FILE, 0600); var msg = getMsg(MSG_ERR_INVALID_FILE, [awayFile.leafName, invalidFile.leafName]); - setTimeout("client.display(" + msg.quote() + ", MT_WARN)", 0); + setTimeout(function() { + client.display(msg, MT_WARN); + }, 0); awayFile.moveTo(null, invalidFile.leafName); } } } // Get back input history from previous session: var inputHistoryFile = new nsLocalFile(client.prefs["profilePath"]); inputHistoryFile.append("inputHistory.txt"); try { client.inputHistoryLogger = new TextLogger(inputHistoryFile.path, client.MAX_HISTORY); } catch (ex) { msg = getMsg(MSG_ERR_INPUTHISTORY_NOT_WRITABLE, inputHistoryFile.path); - setTimeout("client.display(" + msg.quote() + ", MT_ERROR)", 0); + setTimeout(function() { + client.display(msg, MT_ERROR); + }, 0); dd(formatException(ex)); client.inputHistoryLogger = null; } if (client.inputHistoryLogger) client.inputHistory = client.inputHistoryLogger.read().reverse(); // Set up URL collector. var urlsFile = new nsLocalFile(client.prefs["profilePath"]); @@ -381,17 +385,19 @@ function initStatic() try { client.urlLogger = new TextLogger(urlsFile.path, client.prefs["urls.store.max"]); } catch (ex) { msg = getMsg(MSG_ERR_URLS_NOT_WRITABLE, urlsFile.path); - setTimeout("client.display(" + msg.quote() + ", MT_ERROR)", 0); + setTimeout(function() { + client.display(msg, MT_ERROR); + }, 0); dd(formatException(ex)); client.urlLogger = null; } // Migrate old list preference to file. try { // Throws if the preference doesn't exist. @@ -3663,17 +3669,17 @@ function getTabForObject(source, create) if (!("messages" in source) || source.messages == null) createMessages(source); tb = document.createElement("tab"); tb.setAttribute("ondraggesture", "nsDragAndDrop.startDrag(event, tabDNDObserver);"); tb.setAttribute("href", source.getURL()); tb.setAttribute("name", source.unicodeName); - tb.setAttribute("onclick", "onTabClick(event, " + id.quote() + ");"); + tb.setAttribute("onclick", "onTabClick(event, this.id);"); // This wouldn't be here if there was a supported CSS property for it. tb.setAttribute("crop", "center"); tb.setAttribute("context", "context:tab"); tb.setAttribute("class", "tab-bottom view-button"); tb.setAttribute("id", id); tb.setAttribute("state", "normal"); name = source.prefs["tabLabel"] || name; tb.setAttribute("label", name + (matches > 1 ? "<" + matches + ">" : ""));