├── templates ├── skeleton │ ├── src │ │ ├── content │ │ │ ├── images │ │ │ │ ├── icon-32.png │ │ │ │ ├── icon-40.png │ │ │ │ ├── icon-48.png │ │ │ │ └── icon-128.png │ │ │ ├── popup.html │ │ │ ├── settings.html │ │ │ ├── translation.html │ │ │ ├── styles.scss │ │ │ ├── translation.jsx │ │ │ ├── popup.jsx │ │ │ └── settings.jsx │ │ ├── manifest.json │ │ └── background │ │ │ └── main.js │ ├── src-modules │ │ └── default-prefs.js │ └── locales │ │ └── en_US │ │ └── messages.json └── inspector │ ├── src │ ├── content │ │ ├── images │ │ │ ├── icon-128.png │ │ │ ├── icon-32.png │ │ │ ├── icon-40.png │ │ │ └── icon-48.png │ │ ├── inspector.html │ │ ├── settings.html │ │ ├── translation.html │ │ ├── translation.jsx │ │ ├── settings.jsx │ │ ├── styles.scss │ │ └── inspector.jsx │ ├── manifest.json │ └── background │ │ └── main.js │ ├── package.json │ ├── src-modules │ └── default-prefs.js │ └── locales │ └── en_US │ └── messages.json ├── .gitignore ├── index.js ├── src ├── weh-worker-rpc.js ├── css │ ├── weh-form-states.css │ ├── weh-header.css │ ├── weh-shf.css │ └── weh-natmsg-shell.scss ├── react │ ├── weh-header.jsx │ ├── weh-natmsg-shell.jsx │ ├── weh-prefs-settings.jsx │ └── weh-translation.jsx ├── weh.js ├── weh-i18n.js ├── weh-inspect.js ├── weh-worker.js ├── weh-content.js ├── weh-rpc.js ├── weh-background.js ├── weh-ui.js ├── weh-natmsg.js └── weh-prefs.js ├── package.json ├── README.md ├── gulpfile.js └── LICENSE.txt /templates/skeleton/src/content/images/icon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aclap-dev/weh/HEAD/templates/skeleton/src/content/images/icon-32.png -------------------------------------------------------------------------------- /templates/skeleton/src/content/images/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aclap-dev/weh/HEAD/templates/skeleton/src/content/images/icon-40.png -------------------------------------------------------------------------------- /templates/skeleton/src/content/images/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aclap-dev/weh/HEAD/templates/skeleton/src/content/images/icon-48.png -------------------------------------------------------------------------------- /templates/inspector/src/content/images/icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aclap-dev/weh/HEAD/templates/inspector/src/content/images/icon-128.png -------------------------------------------------------------------------------- /templates/inspector/src/content/images/icon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aclap-dev/weh/HEAD/templates/inspector/src/content/images/icon-32.png -------------------------------------------------------------------------------- /templates/inspector/src/content/images/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aclap-dev/weh/HEAD/templates/inspector/src/content/images/icon-40.png -------------------------------------------------------------------------------- /templates/inspector/src/content/images/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aclap-dev/weh/HEAD/templates/inspector/src/content/images/icon-48.png -------------------------------------------------------------------------------- /templates/skeleton/src/content/images/icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aclap-dev/weh/HEAD/templates/skeleton/src/content/images/icon-128.png -------------------------------------------------------------------------------- /templates/inspector/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "weh-inspector", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "react-json-view": "^1.11.8" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | tmp/ 3 | npm-debug.log 4 | run-web-ext.sh 5 | inspector/ 6 | skeleton/ 7 | make-inspector.sh 8 | .DS_Store 9 | ._.DS_Store 10 | make-inspector-sign.sh 11 | inspector-tmp/ 12 | inspector-builds/ 13 | build-inspector-firefox.sh 14 | profile/ 15 | run-inspector.sh 16 | -------------------------------------------------------------------------------- /templates/skeleton/src/content/popup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /templates/inspector/src/content/inspector.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /templates/inspector/src/content/settings.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /templates/skeleton/src/content/settings.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /templates/inspector/src/content/translation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /templates/skeleton/src/content/translation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var spawn = require("child_process").spawn; 4 | 5 | var cwd = process.cwd(); 6 | process.chdir(__dirname); 7 | 8 | var gulpBin = process.platform=="win32" ? "gulp.cmd" : "gulp"; 9 | var cmd = spawn(gulpBin, process.argv.slice(2) , { 10 | env: Object.assign({},process.env,{ 11 | wehCwd: cwd 12 | }) 13 | }); 14 | 15 | cmd.stdout.on('data', function(data) { 16 | process.stdout.write(data); 17 | }); 18 | 19 | cmd.stderr.on('data', function(data) { 20 | process.stderr.write(data); 21 | }); 22 | 23 | cmd.on('close', function(code) { 24 | process.exit(code); 25 | }); 26 | -------------------------------------------------------------------------------- /templates/inspector/src-modules/default-prefs.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = [{ 3 | name: "messages_display_mode", 4 | type: "choice", 5 | defaultValue: "sync_reply", 6 | width: "20em", 7 | choices: ["async","sync_call","sync_reply"] 8 | },{ 9 | name: "display_timestamp", 10 | type: "boolean", 11 | defaultValue: false 12 | },{ 13 | name: "display_call_duration", 14 | type: "boolean", 15 | defaultValue: true 16 | },{ 17 | name: "max_messages", 18 | type: "integer", 19 | defaultValue: 100 20 | },{ 21 | name: "redux_logger", 22 | type: "boolean", 23 | defaultValue: false, 24 | hidden: true 25 | }]; 26 | -------------------------------------------------------------------------------- /src/weh-worker-rpc.js: -------------------------------------------------------------------------------- 1 | /* 2 | * weh - WebExtensions Helper 3 | * 4 | * @summary workflow and base code for developing WebExtensions browser add-ons 5 | * @author Michel Gutierrez 6 | * @link https://github.com/mi-g/weh 7 | * 8 | * This Source Code Form is subject to the terms of the Mozilla Public 9 | * License, v. 2.0. If a copy of the MPL was not distributed with this 10 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. 11 | */ 12 | 13 | /* setting up RPC */ 14 | const rpc = require('./weh-rpc'); 15 | 16 | /* connecting with main thread */ 17 | rpc.setPost(postMessage); 18 | global.onmessage = (event)=>{ 19 | rpc.receive(event.data, postMessage); 20 | }; 21 | 22 | module.exports = rpc; -------------------------------------------------------------------------------- /templates/skeleton/src/content/styles.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * weh - WebExtensions Helper 3 | * 4 | * @summary workflow and base code for developing WebExtensions browser add-ons 5 | * @author Michel Gutierrez 6 | * @link https://github.com/mi-g/weh 7 | * 8 | * This Source Code Form is subject to the terms of the Mozilla Public 9 | * License, v. 2.0. If a copy of the MPL was not distributed with this 10 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. 11 | */ 12 | 13 | #root { 14 | min-width: 500px; 15 | } 16 | 17 | .sample-popup { 18 | .sample-panel { 19 | padding: 2em; 20 | font-size: 20pt; 21 | text-align: center; 22 | } 23 | .sample-toolbar { 24 | overflow: hidden; 25 | padding: 8px; 26 | background-color: #eee; 27 | a { 28 | float: right; 29 | cursor: pointer; 30 | margin: 0 8px; 31 | } 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /src/css/weh-form-states.css: -------------------------------------------------------------------------------- 1 | /* 2 | * weh - WebExtensions Helper 3 | * 4 | * @summary workflow and base code for developing WebExtensions browser add-ons 5 | * @author Michel Gutierrez 6 | * @link https://github.com/mi-g/weh 7 | * 8 | * This Source Code Form is subject to the terms of the Mozilla Public 9 | * License, v. 2.0. If a copy of the MPL was not distributed with this 10 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. 11 | */ 12 | 13 | .has-success .form-control { 14 | border-color: #5cb85c; 15 | } 16 | 17 | .has-success .col-form-label { 18 | color: #5cb85c; 19 | } 20 | 21 | .has-warning .form-control { 22 | border-color: #f0ad4e; 23 | } 24 | 25 | .has-warning .col-form-label { 26 | color: #f0ad4e; 27 | } 28 | 29 | .has-danger .form-control { 30 | border-color: #d9534f; 31 | } 32 | 33 | .has-danger .col-form-label { 34 | color: #d9534f; 35 | } 36 | -------------------------------------------------------------------------------- /templates/inspector/src/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name": "Weh Inspector", 4 | "default_locale": "en_US", 5 | "version": "2.1.1", 6 | "version_name": "2.1.1", 7 | "author": "Michel Gutierrez", 8 | "description": "Trace remote procedure calls on Weh 2 addons", 9 | "background": { 10 | "scripts": [ 11 | "background/main.js" 12 | ], 13 | "persistent": true 14 | }, 15 | "icons": { 16 | "32": "content/images/icon-32.png", 17 | "40": "content/images/icon-40.png", 18 | "48": "content/images/icon-48.png", 19 | "128": "content/images/icon-128.png" 20 | }, 21 | "options_ui": { 22 | "page": "content/settings.html?panel=settings", 23 | "open_in_tab": false 24 | }, 25 | "permissions": [ 26 | "tabs", 27 | "contextMenus", 28 | "management", 29 | "storage", 30 | "downloads" 31 | ], 32 | "applications": { 33 | "gecko": { 34 | "id": "weh-inspector@downloadhelper.net" 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /templates/skeleton/src-modules/default-prefs.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = [{ 3 | name: "myparam_string", 4 | type: "string", 5 | defaultValue: "Default value", 6 | maxLength: 15, 7 | regexp: "^[a-zA-Z ]+$" 8 | },{ 9 | name: "myparam_integer", 10 | type: "integer", 11 | defaultValue: 42, 12 | minimum: -10, 13 | maximum: 100 14 | },{ 15 | name: "myparam_float", 16 | type: "float", 17 | defaultValue: 3.14159, 18 | minimum: 1.5, 19 | maximum: 10.8 20 | },{ 21 | name: "myparam_boolean", 22 | type: "boolean", 23 | defaultValue: true 24 | },{ 25 | name: "myparam_choice", 26 | type: "choice", 27 | defaultValue: "second", 28 | choices: [{ 29 | name: "First choice", 30 | value: "first" 31 | },{ 32 | name: "Second choice", 33 | value: "second" 34 | },{ 35 | name: "Third choice", 36 | value: "third" 37 | }] 38 | }]; 39 | -------------------------------------------------------------------------------- /templates/skeleton/src/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name": "Skeleton React", 4 | "default_locale": "en_US", 5 | "version": "0.1", 6 | "version_name": "0.1", 7 | "author": "Michel Gutierrez", 8 | "description": "Basic add-on code to start from", 9 | "background": { 10 | "scripts": [ 11 | "background/main.js" 12 | ], 13 | "persistent": true 14 | }, 15 | "icons": { 16 | "32": "content/images/icon-32.png", 17 | "40": "content/images/icon-40.png", 18 | "48": "content/images/icon-48.png", 19 | "128": "content/images/icon-128.png" 20 | }, 21 | "browser_action": { 22 | "default_icon": { 23 | "40": "content/images/icon-40.png" 24 | }, 25 | "default_title": "WebExtensions Helper", 26 | "default_popup": "content/popup.html?panel=main" 27 | }, 28 | "options_ui": { 29 | "page": "content/settings.html?panel=settings", 30 | "open_in_tab": true 31 | }, 32 | "permissions": [ 33 | "tabs", 34 | "contextMenus", 35 | "storage" 36 | ] 37 | } -------------------------------------------------------------------------------- /src/css/weh-header.css: -------------------------------------------------------------------------------- 1 | /* 2 | * weh - WebExtensions Helper 3 | * 4 | * @summary workflow and base code for developing WebExtensions browser add-ons 5 | * @author Michel Gutierrez 6 | * @link https://github.com/mi-g/weh 7 | * 8 | * This Source Code Form is subject to the terms of the Mozilla Public 9 | * License, v. 2.0. If a copy of the MPL was not distributed with this 10 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. 11 | */ 12 | 13 | header { 14 | min-height: 42px; 15 | line-height: 42px; 16 | } 17 | 18 | header .weh-header-title { 19 | background-repeat: no-repeat; 20 | background-position: 8px center; 21 | background-size: contain; 22 | padding-left: 42px; 23 | font-weight: bold; 24 | font-size: 1.2em; 25 | } 26 | 27 | header .weh-header-close { 28 | font-weight: 100; 29 | font-size: 1.5em; 30 | line-height: 1.5em; 31 | cursor: pointer; 32 | color: #808080; 33 | padding: 0 12px 0 0; 34 | } 35 | 36 | header .weh-header-close:hover { 37 | color: #404040; 38 | } 39 | -------------------------------------------------------------------------------- /templates/skeleton/src/background/main.js: -------------------------------------------------------------------------------- 1 | /* 2 | * weh - WebExtensions Helper 3 | * 4 | * @summary workflow and base code for developing WebExtensions browser add-ons 5 | * @author Michel Gutierrez 6 | * @link https://github.com/mi-g/weh 7 | * 8 | * This Source Code Form is subject to the terms of the Mozilla Public 9 | * License, v. 2.0. If a copy of the MPL was not distributed with this 10 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. 11 | */ 12 | 13 | var weh = require('weh-background'); 14 | require('weh-inspect'); 15 | 16 | weh.rpc.listen({ 17 | openSettings: () => { 18 | console.info("openSettings"); 19 | weh.ui.open("settings",{ 20 | type: "tab", 21 | url: "content/settings.html" 22 | }); 23 | weh.ui.close("main"); 24 | }, 25 | openTranslation: () => { 26 | console.info("openTranslation"); 27 | weh.ui.open("translation",{ 28 | type: "tab", 29 | url: "content/translation.html" 30 | }); 31 | weh.ui.close("main"); 32 | }, 33 | }); 34 | 35 | weh.prefs.declare(require('default-prefs')); 36 | 37 | -------------------------------------------------------------------------------- /templates/inspector/src/content/translation.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | * weh - WebExtensions Helper 3 | * 4 | * @summary workflow and base code for developing WebExtensions browser add-ons 5 | * @author Michel Gutierrez 6 | * @link https://github.com/mi-g/weh 7 | * 8 | * This Source Code Form is subject to the terms of the Mozilla Public 9 | * License, v. 2.0. If a copy of the MPL was not distributed with this 10 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. 11 | */ 12 | 13 | import React from 'react' 14 | import { render } from 'react-dom' 15 | import { Provider } from 'react-redux' 16 | import { applyMiddleware, createStore, combineReducers } from 'redux' 17 | import logger from 'redux-logger' 18 | import { reducer as translateReducer, WehTranslationForm } from 'react/weh-translation' 19 | 20 | import weh from 'weh-content'; 21 | 22 | let reducers = combineReducers({ 23 | translate: translateReducer 24 | }); 25 | 26 | let store = createStore(reducers, applyMiddleware(logger)); 27 | 28 | render( 29 |