diff --git a/.gitignore b/.gitignore index 165c512..a187011 100644 --- a/.gitignore +++ b/.gitignore @@ -14,5 +14,6 @@ proxy/test proxy/build proxy/node_modules proxy/spec/support +proxy/webext/snowflake.js ignore/ npm-debug.log diff --git a/proxy/Cakefile b/proxy/Cakefile index 7da528e..8013dac 100644 --- a/proxy/Cakefile +++ b/proxy/Cakefile @@ -21,14 +21,14 @@ FILES_SPEC = [ 'spec/websocket.spec.coffee' ] FILES_ALL = FILES.concat FILES_SPEC -OUTFILE = 'build/snowflake.js' +OUTFILE = 'snowflake.js' STATIC = 'static' copyStaticFiles = -> exec 'cp ' + STATIC + '/* build/' -compileCoffee = -> - exec 'cat ' + FILES.join(' ') + ' | coffee -cs > ' + OUTFILE, (err, stdout, stderr) -> +compileCoffee = (outDir) -> + exec 'cat ' + FILES.join(' ') + ' | coffee -cs > ' + outDir + '/' + OUTFILE, (err, stdout, stderr) -> throw err if err task 'test', 'snowflake unit tests', -> @@ -48,9 +48,13 @@ task 'test', 'snowflake unit tests', -> task 'build', 'build the snowflake proxy', -> exec 'mkdir -p build' copyStaticFiles() - compileCoffee() + compileCoffee('build') console.log 'Snowflake prepared.' +task 'webext', 'build the webextension', -> + compileCoffee('webext') + console.log 'Webextension prepared.' + task 'lint', 'ensure idiomatic coffeescript', -> proc = spawn 'coffeelint', FILES_ALL, { file: 'coffeelint.json' diff --git a/proxy/package.json b/proxy/package.json index cc4cc78..8bc5fb5 100644 --- a/proxy/package.json +++ b/proxy/package.json @@ -10,6 +10,7 @@ "test": "cake test", "lint": "cake lint", "build": "cake build", + "webext": "cake webext", "clean": "cake clean", "prepublish": "npm run build", "start": "node build/snowflake.js" diff --git a/proxy/webext/README.md b/proxy/webext/README.md new file mode 100644 index 0000000..bacaa94 --- /dev/null +++ b/proxy/webext/README.md @@ -0,0 +1,9 @@ +Build it, + +``` +cd .. +npm install +npm run webext +``` + +and then load this directory as an unpacked extension. diff --git a/proxy/webext/icons/16-on.png b/proxy/webext/icons/16-on.png new file mode 100644 index 0000000..5cb253d Binary files /dev/null and b/proxy/webext/icons/16-on.png differ diff --git a/proxy/webext/icons/16.png b/proxy/webext/icons/16.png new file mode 100644 index 0000000..110bae3 Binary files /dev/null and b/proxy/webext/icons/16.png differ diff --git a/proxy/webext/icons/32-on.png b/proxy/webext/icons/32-on.png new file mode 100644 index 0000000..fed8ea0 Binary files /dev/null and b/proxy/webext/icons/32-on.png differ diff --git a/proxy/webext/icons/32.png b/proxy/webext/icons/32.png new file mode 100644 index 0000000..ee4de34 Binary files /dev/null and b/proxy/webext/icons/32.png differ diff --git a/proxy/webext/manifest.json b/proxy/webext/manifest.json new file mode 100644 index 0000000..8d1649e --- /dev/null +++ b/proxy/webext/manifest.json @@ -0,0 +1,16 @@ +{ + "manifest_version": 2, + "name": "Snowflake", + "version": "0.0.0", + "description": "Snowflake ...", + "background": { + "page": "snowflake.html", + "persistent": true + }, + "browser_action": { + "default_icon": { + "16": "icons/16.png", + "32": "icons/32.png" + } + } +} diff --git a/proxy/webext/snowflake.html b/proxy/webext/snowflake.html new file mode 100644 index 0000000..6a5eca0 --- /dev/null +++ b/proxy/webext/snowflake.html @@ -0,0 +1,16 @@ + + +
+ + + + + + + +