Various Firefox error and warning fixes #166

This commit is contained in:
Jason 2016-03-07 23:22:28 -06:00
parent 2973cac28f
commit cc95a62c7c
6 changed files with 24 additions and 13 deletions

View File

@ -83,7 +83,10 @@ chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
}
});
chrome.commands.onCommand.addListener(function(command) {
// Not available in Firefox - https://bugzilla.mozilla.org/show_bug.cgi?id=1240350
if (("commands") in chrome) {
chrome.commands.onCommand.addListener(function(command) {
switch (command) {
case "openManage":
openURL({url: chrome.extension.getURL("manage.html")});
@ -93,7 +96,8 @@ chrome.commands.onCommand.addListener(function(command) {
chrome.contextMenus.update("disableAll", {checked: prefs.get("disableAll")});
break;
}
});
});
}
// contextMenus API is present in ancient Chrome but it throws an exception
// upon encountering the unsupported parameter value "browser_action", so we have to catch it.

View File

@ -1,5 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<script src="codemirror/lib/codemirror.js"></script>
<link rel="stylesheet" href="codemirror/lib/codemirror.css">
<script src="codemirror/mode/css/css.js"></script>

View File

@ -48,7 +48,7 @@ function tNodeList(nodes) {
continue;
}
name = name.substr(5); // "i18n-".length
var value = t(attr.nodeValue);
var value = t(attr.value);
switch (name) {
case "text":
node.insertBefore(document.createTextNode(value), node.firstChild);
@ -59,7 +59,7 @@ function tNodeList(nodes) {
default:
node.setAttribute(name, value);
}
node.removeAttributeNode(attr);
node.removeAttribute(attr.nodeName);
}
}
}

View File

@ -1,5 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title i18n-text="manageTitle"></title>
<style>
body {

View File

@ -1,5 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<style>
body {
width: 200px;

View File

@ -1,6 +1,10 @@
var webSqlStorage = {
migrate: function() {
if (typeof openDatabase == "undefined") {
// No WebSQL - no migration!
return;
}
webSqlStorage.getStyles(function(styles) {
getDatabase(function(db) {
var tx = db.transaction(["styles"], "readwrite");