Commits

Brian McKenna  committed 09841cf Merge

Merge pull request #161 from brow/chrome-ext-v2

Chrome 23 refuses to load Rome extension

  • Participants
  • Parent commits 9ecd6e9, 2869ad2

Comments (0)

Files changed (3)

File misc/chrome-extension/add-compile-listener.js

+chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
+  var js;
+  try {
+    js = roy.compile(request.code).output;
+  } catch(e) {
+    js = e.toString();
+  }
+  sendResponse({js: js});
+});

File misc/chrome-extension/background.htm

 <html>
   <head>
     <script src="roy-min.js"></script>
-    <script>
-      chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
-        var js;
-        try {
-          js = roy.compile(request.code).output;
-        } catch(e) {
-          js = e.toString();
-        }
-        sendResponse({js: js});
-      });
-    </script>
+    <script src="add-compile-listener.js"></script>
   </head>
 </html>

File misc/chrome-extension/manifest.json

 {
   "name": "Rome - Roy Compiler",
   "version": "0.1",
+  "manifest_version": 2,
   "description": "Compiles and executes local Roy files.",
 
   "icons": { "16": "roy_16.png",
              "48": "roy_48.png",
              "128": "roy_128.png" },
-  "background_page": "background.htm",
+  "background": { "page": "background.htm" },
   "content_scripts": [
     {
       "matches": ["file:///*/*.roy"],