aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Rogan Creswick <creswick@gmail.com>2013-01-28 15:52:03 -0800
committerGravatar Rogan Creswick <creswick@gmail.com>2013-01-28 15:52:03 -0800
commitca69f84825da44598a29f57dce4c16691c29d449 (patch)
treee9f95396082fd4875955634e3f53dec406f4bfac
parentac5da6bf6071cb6e9f83728f5b1ff71c739b8b8c (diff)
updates to account for recent changes in Chrome
-rw-r--r--contexts/data/fiveui/chrome/background.html3
-rw-r--r--contexts/data/fiveui/chrome/background.js7
-rw-r--r--contexts/data/fiveui/ffcheck.js3
-rw-r--r--contexts/data/fiveui/options.html7
-rw-r--r--contexts/manifest.json42
5 files changed, 39 insertions, 23 deletions
diff --git a/contexts/data/fiveui/chrome/background.html b/contexts/data/fiveui/chrome/background.html
index 35d5c41..bb9d05e 100644
--- a/contexts/data/fiveui/chrome/background.html
+++ b/contexts/data/fiveui/chrome/background.html
@@ -24,6 +24,5 @@
<title>Background Page</title>
<script src="../../target/chrome-background.js"></script>
</head>
- <body onLoad="fiveui.chrome.background()">
- </body>
+ <body/>
</html>
diff --git a/contexts/data/fiveui/chrome/background.js b/contexts/data/fiveui/chrome/background.js
index eab6798..4d34658 100644
--- a/contexts/data/fiveui/chrome/background.js
+++ b/contexts/data/fiveui/chrome/background.js
@@ -158,3 +158,10 @@ fiveui.chrome.background = function() {
background.showUI(tab.id);
});
};
+
+// Add event listeners once the DOM has fully loaded by listening for the
+// `DOMContentLoaded` event on the document, and adding your listeners to
+// specific elements when it triggers.
+document.addEventListener('DOMContentLoaded', function () {
+ fiveui.chrome.background();
+}); \ No newline at end of file
diff --git a/contexts/data/fiveui/ffcheck.js b/contexts/data/fiveui/ffcheck.js
new file mode 100644
index 0000000..2157ed0
--- /dev/null
+++ b/contexts/data/fiveui/ffcheck.js
@@ -0,0 +1,3 @@
+if (! /Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)) {
+ window.onload=fiveui.chrome.options.init;
+}
diff --git a/contexts/data/fiveui/options.html b/contexts/data/fiveui/options.html
index 1dd00dd..68b08d9 100644
--- a/contexts/data/fiveui/options.html
+++ b/contexts/data/fiveui/options.html
@@ -1,3 +1,4 @@
+
<!--
* Module : options.html
* Copyright : (c) 2011-2012, Galois, Inc.
@@ -32,11 +33,7 @@
<link rel="stylesheet" href="../lib/codemirror/codemirror.css"/>
<script src="../lib/codemirror/codemirror-compressed.js"></script>
<script src="../target/chrome-options.js"></script>
- <script type="text/javascript">
- if (! /Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)) {
- window.onload=fiveui.chrome.options.init;
- }
- </script>
+ <script src="ffcheck.js"></script>
</head>
<body>
diff --git a/contexts/manifest.json b/contexts/manifest.json
index 7ee8fb4..584f5d0 100644
--- a/contexts/manifest.json
+++ b/contexts/manifest.json
@@ -1,20 +1,30 @@
{
- "name": "Five UI",
- "version": "0.2",
- "description": "UI Constraint Checker",
+ "manifest_version": 2,
- "icons": { "16": "data/fiveui/images/fiveui-icon-16.png",
- "48": "data/fiveui/images/fiveui-icon-48.png",
- "128": "data/fiveui/images/fiveui-icon-128.png"
- },
+ "name": "Five UI",
+ "version": "0.2",
+ "description": "UI Constraint Checker",
- "background_page": "data/fiveui/chrome/background.html",
- "options_page": "data/fiveui/options.html",
- "browser_action": {
- "default_icon": "data/fiveui/images/fiveui-icon-disabled.png",
- "name": "Five UI"
- },
- "permissions": [
- "tabs", "http://*/*", "https://*/*", "history"
- ]
+ "icons": { "16": "data/fiveui/images/fiveui-icon-16.png",
+ "48": "data/fiveui/images/fiveui-icon-48.png",
+ "128": "data/fiveui/images/fiveui-icon-128.png"
+ },
+
+ "background": {
+ "persistent": true,
+ "page": "data/fiveui/chrome/background.html"
+ },
+
+ "options_page": "data/fiveui/options.html",
+
+ "browser_action": {
+ "default_icon": "data/fiveui/images/fiveui-icon-disabled.png",
+ "default_title": "Five UI"
+ },
+ "permissions": [
+ "tabs", "http://*/*", "https://*/*", "history"
+ ],
+
+ // We have to relax the content security policy to allow rules to be evaluated:
+ "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'"
}