Various Firefox error and warning fixes #166
This commit is contained in:
parent
2973cac28f
commit
cc95a62c7c
|
@ -83,17 +83,21 @@ chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
|
|||
}
|
||||
});
|
||||
|
||||
chrome.commands.onCommand.addListener(function(command) {
|
||||
switch (command) {
|
||||
case "openManage":
|
||||
openURL({url: chrome.extension.getURL("manage.html")});
|
||||
break;
|
||||
case "styleDisableAll":
|
||||
disableAllStylesToggle();
|
||||
chrome.contextMenus.update("disableAll", {checked: prefs.get("disableAll")});
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
// 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")});
|
||||
break;
|
||||
case "styleDisableAll":
|
||||
disableAllStylesToggle();
|
||||
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.
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<title i18n-text="manageTitle"></title>
|
||||
<style>
|
||||
body {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<style>
|
||||
body {
|
||||
width: 200px;
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue
Block a user