Browser extension to hide view-reducing screen junk from websites.
Browse Source

webextension+babel scaffolding

tags/v1.0.0
Gerben 7 years ago
parent
commit
cc7d4160f8
6 changed files with 70 additions and 0 deletions
  1. +10
    -0
      .babelrc
  2. +6
    -0
      .gitignore
  3. +20
    -0
      extension/manifest.json
  4. +32
    -0
      package.json
  5. +1
    -0
      src/background_script.js
  6. +1
    -0
      src/content_script.js

+ 10
- 0
.babelrc View File

@@ -0,0 +1,10 @@
{
"presets": [
["env", {
"targets": {
"firefox": "55",
"chrome": "60"
}
}]
]
}

+ 6
- 0
.gitignore View File

@@ -0,0 +1,6 @@
node_modules
extension/*.js
dist
chrome-extension-key.pem
publish_firefox.sh
publish_chrome.sh

+ 20
- 0
extension/manifest.json View File

@@ -0,0 +1,20 @@
{
"name": "Nameless extension",
"description": "No description.",
"version": "0.0.0",
"background": {
"scripts": ["background_script.js"]
},
"content_scripts": [{
"matches": ["<all_urls>"],
"js": ["content_script.js"],
"run_at": "document_end"
}],
"permissions": [
"<all_urls>"
],
"applications": {
"gecko": {"id": "nameless@nameless"}
},
"manifest_version": 2
}

+ 32
- 0
package.json View File

@@ -0,0 +1,32 @@
{
"name": "nameless-webextension",
"version": "0.0.0",
"description": "No description.",
"scripts": {
"build": "npm run build-content-script && npm run build-background-script",
"watch": "npm run watch-content-script | : | npm run watch-background-script",
"build-content-script": "browserify -o extension/content_script.js src/content_script.js",
"watch-content-script": "watchify -o extension/content_script.js src/content_script.js -v",
"build-background-script": "browserify -o extension/background_script.js src/background_script.js",
"watch-background-script": "watchify -o extension/background_script.js src/background_script.js -v",
"fx-build": "web-ext build -s extension -a dist && rename -f 's/\\.zip$/.xpi/' dist/*.zip",
"fx-run": "web-ext run -s extension",
"cr-build": "crx pack extension -o dist/extension.crx -p chrome-extension-key.pem"
},
"devDependencies": {
"babel-preset-env": "^1.6.1",
"babelify": "^7.3.0",
"browserify": "^14.3.0",
"crx": "^3.2.1",
"watchify": "^3.9.0",
"web-ext": "^1.9.1"
},
"dependencies": {
"webextension-polyfill": "^0.1.1"
},
"browserify": {
"transform": [
"babelify"
]
}
}

+ 1
- 0
src/background_script.js View File

@@ -0,0 +1 @@
import browser from 'webextension-polyfill'

+ 1
- 0
src/content_script.js View File

@@ -0,0 +1 @@
import browser from 'webextension-polyfill'

Loading…
Cancel
Save