diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2013-02-02 13:50:44 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2013-02-02 13:50:44 (GMT) |
commit | 6ead22274f5bdd5b88e652a5d6a1bba3e5c307d0 (patch) | |
tree | be03623c0a03f6e000c40701c4fceaea5b1f0857 | |
parent | 2cb5bb36e94a777ce4ab12f8d7fd755d8a24e331 (diff) |
Basic firefox addon
-rw-r--r-- | .gitignore | 6 | ||||
-rw-r--r-- | addon/lib/main.js | 23 | ||||
-rw-r--r-- | addon/package.json | 9 | ||||
-rw-r--r-- | addon/test/test-main.js | 12 | ||||
-rw-r--r-- | browser/sugar-html-browser.in | 3 |
5 files changed, 52 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ce2266e --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +Makefile*.in +aclocal.m4 +autom4te.cache/ +configure +install-sh +missing diff --git a/addon/lib/main.js b/addon/lib/main.js new file mode 100644 index 0000000..f99e0e9 --- /dev/null +++ b/addon/lib/main.js @@ -0,0 +1,23 @@ +const {Cu} = require("chrome"); +Cu.import("resource://gre/modules/ctypes.jsm"); + +libc = ctypes.open("libc.so.6"); +var getpid = libc.declare("getpid", + ctypes.default_abi, + ctypes.int); +console.log(getpid()); + +var windowUtils = require("window-utils"); + +windowUtils = new windowUtils.WindowTracker({ + onTrack: function (window) { + var toolbox = window.document.getElementById("navigator-toolbox"); + toolbox.style.display = "none"; + + var addonbar = window.document.getElementById("addon-bar"); + addonbar.style.display = "none"; + + var content = window.document.getElementById("content"); + content.getNotificationBox().removeCurrentNotification(); + } +}); diff --git a/addon/package.json b/addon/package.json new file mode 100644 index 0000000..6418ef5 --- /dev/null +++ b/addon/package.json @@ -0,0 +1,9 @@ +{ + "name": "firefox-addon", + "license": "MPL 2.0", + "author": "", + "version": "0.1", + "fullName": "firefox-addon", + "id": "jid1-RTyA5c7teVs4tA", + "description": "a basic add-on" +} diff --git a/addon/test/test-main.js b/addon/test/test-main.js new file mode 100644 index 0000000..9e7031a --- /dev/null +++ b/addon/test/test-main.js @@ -0,0 +1,12 @@ +var main = require("main"); + +exports["test main"] = function(assert) { + assert.pass("Unit test running!"); +}; + +exports["test main async"] = function(assert, done) { + assert.pass("async Unit test running!"); + done(); +}; + +require("test").run(exports); diff --git a/browser/sugar-html-browser.in b/browser/sugar-html-browser.in index 967ab8f..90cdd87 100644 --- a/browser/sugar-html-browser.in +++ b/browser/sugar-html-browser.in @@ -3,4 +3,5 @@ profile=$SUGAR_BUNDLE_PATH/firefox-profile mkdir -p $profile -exec firefox -no-remote -profile $profile + +exec firefox -no-remote -profile $profile index.html |