diff --git a/README.md b/README.md index 6deeae5..297fef4 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,20 @@ You can read more about this in its official documentation: [Web Extension Polyf Run `npm run watch:firefox` or `npm run watch:chrome` to running the project and open on the browser. +### Using devbox.json + +You can also use [devbox](https://www.jetify.com/docs/devbox/installing_devbox/) for more reproducible builds: + +```bash +devbox run watch:firefox +``` + +or + +```bash +devbox run watch:chrome +``` + ## Support and credits - Author - [Andry Mendoza](https://dreez.dev/) diff --git a/devbox.json b/devbox.json new file mode 100644 index 0000000..acdc73e --- /dev/null +++ b/devbox.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.15.0/.schema/devbox.schema.json", + "packages": [ + "nodejs@latest" + ], + "shell": { + "init_hook": [ + "test -d node_modules || npm ci", + "rm -rf dist" + ], + "scripts": { + "watch:firefox": [ + "npm run watch:firefox" + ], + "watch:chrome": [ + "npm run watch:chrome" + ] + } + }, + "env": { + "PATH":"$PATH:$PWD/node_modules/.bin" + } +} diff --git a/devbox.lock b/devbox.lock new file mode 100644 index 0000000..5fede27 --- /dev/null +++ b/devbox.lock @@ -0,0 +1,90 @@ +{ + "lockfile_version": "1", + "packages": { + "github:NixOS/nixpkgs/nixpkgs-unstable": { + "last_modified": "2025-09-15T20:13:12Z", + "resolved": "github:NixOS/nixpkgs/0d7c15863b251a7a50265e57c1dca1a7add2e291?lastModified=1757967192&narHash=sha256-%2FaA9A%2FOBmnuOMgwfzdsXRusqzUpd8rQnQY8jtrHK%2BTo%3D" + }, + "nodejs@latest": { + "last_modified": "2025-08-11T07:05:29Z", + "plugin_version": "0.0.2", + "resolved": "github:NixOS/nixpkgs/9585e9192aadc13ec3e49f33f8333bd3cda524df#nodejs_24", + "source": "devbox-search", + "version": "24.5.0", + "systems": { + "aarch64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/b1j05q96hwagn787p2jlgqcjg2nf5x49-nodejs-24.5.0", + "default": true + }, + { + "name": "dev", + "path": "/nix/store/j6ayg4xpqy9xdxgrhpqylzq8v7v07c6r-nodejs-24.5.0-dev" + }, + { + "name": "libv8", + "path": "/nix/store/3ys6v5s5gvd9snwnl4saynl6av7mz3vy-nodejs-24.5.0-libv8" + } + ], + "store_path": "/nix/store/b1j05q96hwagn787p2jlgqcjg2nf5x49-nodejs-24.5.0" + }, + "aarch64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/1kn0vh4gf3a22arldrw694apq3fhgp15-nodejs-24.5.0", + "default": true + }, + { + "name": "dev", + "path": "/nix/store/i3lqaj3j6znhnzh8ayka6q85r81ppxnw-nodejs-24.5.0-dev" + }, + { + "name": "libv8", + "path": "/nix/store/jjw6xgmg6qynp336g9igqnzlfbhzxr2i-nodejs-24.5.0-libv8" + } + ], + "store_path": "/nix/store/1kn0vh4gf3a22arldrw694apq3fhgp15-nodejs-24.5.0" + }, + "x86_64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/sbcg21wp4bdzyh2542v77sp535kvfbfq-nodejs-24.5.0", + "default": true + }, + { + "name": "libv8", + "path": "/nix/store/75b7iix0pbmxmfnmv90l3q0ll1gc75az-nodejs-24.5.0-libv8" + }, + { + "name": "dev", + "path": "/nix/store/fg7pi9s6m0spci1pfqbny0kxmk832i3r-nodejs-24.5.0-dev" + } + ], + "store_path": "/nix/store/sbcg21wp4bdzyh2542v77sp535kvfbfq-nodejs-24.5.0" + }, + "x86_64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/357id3rjy9417k4dkvxxmpgd9bxrwc7l-nodejs-24.5.0", + "default": true + }, + { + "name": "dev", + "path": "/nix/store/0drh8jjq84sji6889l2k3ysmvy7sc9sg-nodejs-24.5.0-dev" + }, + { + "name": "libv8", + "path": "/nix/store/kdlv4q7sgap0z43cylklhxz1g1q7751b-nodejs-24.5.0-libv8" + } + ], + "store_path": "/nix/store/357id3rjy9417k4dkvxxmpgd9bxrwc7l-nodejs-24.5.0" + } + } + } + } +} diff --git a/package-lock.json b/package-lock.json index 4d2f85a..3ca06a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "@angular/compiler-cli": "^18.2.0", "@types/chrome": "^0.0.279", "@types/jasmine": "~5.1.0", - "concurrently": "^9.0.1", + "concurrently": "^9.2.1", "jasmine-core": "~5.2.0", "karma": "~6.4.0", "karma-chrome-launcher": "~3.2.0", @@ -6750,18 +6750,18 @@ } }, "node_modules/concurrently": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.0.1.tgz", - "integrity": "sha512-wYKvCd/f54sTXJMSfV6Ln/B8UrfLBKOYa+lzc6CHay3Qek+LorVSBdMVfyewFhRbH0Rbabsk4D+3PL/VjQ5gzg==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.2.1.tgz", + "integrity": "sha512-fsfrO0MxV64Znoy8/l1vVIjjHa29SZyyqPgQBwhiDcaW8wJc2W3XWVOGx4M3oJBnv/zdUZIIp1gDeS98GzP8Ng==", "dev": true, + "license": "MIT", "dependencies": { - "chalk": "^4.1.2", - "lodash": "^4.17.21", - "rxjs": "^7.8.1", - "shell-quote": "^1.8.1", - "supports-color": "^8.1.1", - "tree-kill": "^1.2.2", - "yargs": "^17.7.2" + "chalk": "4.1.2", + "rxjs": "7.8.2", + "shell-quote": "1.8.3", + "supports-color": "8.1.1", + "tree-kill": "1.2.2", + "yargs": "17.7.2" }, "bin": { "conc": "dist/bin/concurrently.js", @@ -6844,6 +6844,16 @@ "node": ">=8" } }, + "node_modules/concurrently/node_modules/rxjs": { + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, "node_modules/concurrently/node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -14452,10 +14462,14 @@ } }, "node_modules/shell-quote": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", - "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", + "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==", "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } diff --git a/package.json b/package.json index 33d8aba..fd2cb65 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "ng": "ng", "start": "ng serve", "build": "ng build && webpack --config webpack.config.js --mode production", - "watch:firefox": "concurrently \"nodemon\" \"wait-on ./dist/angular-web-extension/browser/manifest.json && web-ext run --target firefox-desktop --source-dir ./dist/angular-web-extension/browser\"", - "watch:chrome": "concurrently \"nodemon\" \"wait-on ./dist/angular-web-extension/browser/manifest.json && web-ext run --target chromium --source-dir ./dist/angular-web-extension/browser\"", + "watch:firefox": "cp src/manifest.firefox.json src/manifest.json && concurrently \"nodemon\" \"wait-on ./dist/angular-web-extension/browser/manifest.json && web-ext run --target firefox-desktop --source-dir ./dist/angular-web-extension/browser\"", + "watch:chrome": "cp src/manifest.chrome.json src/manifest.json && concurrently \"nodemon\" \"wait-on ./dist/angular-web-extension/browser/manifest.json && web-ext run --target chromium --source-dir ./dist/angular-web-extension/browser\"", "test": "ng test" }, "private": true, @@ -29,7 +29,7 @@ "@angular/compiler-cli": "^18.2.0", "@types/chrome": "^0.0.279", "@types/jasmine": "~5.1.0", - "concurrently": "^9.0.1", + "concurrently": "^9.2.1", "jasmine-core": "~5.2.0", "karma": "~6.4.0", "karma-chrome-launcher": "~3.2.0", diff --git a/src/.gitignore b/src/.gitignore new file mode 100644 index 0000000..2ddf5f2 --- /dev/null +++ b/src/.gitignore @@ -0,0 +1 @@ +manifest.json diff --git a/src/app/app.component.html b/src/app/app.component.html index a934b94..67c94d8 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -62,7 +62,7 @@ } main { - width: 100%; + width: 100vw; min-height: 100%; display: flex; justify-content: center; @@ -72,6 +72,12 @@ position: relative; } + @supports (-moz-appearance: none) { + main { + width: 100%; + } + } + .angular-logo { max-width: 9.2rem; } diff --git a/src/manifest.chrome.json b/src/manifest.chrome.json new file mode 100644 index 0000000..0c29203 --- /dev/null +++ b/src/manifest.chrome.json @@ -0,0 +1,30 @@ +{ + "manifest_version": 3, + "name": "Angular Web Extension Template by Dreez", + "description": "A starter template for Angular web extensions.", + "version": "1.0", + "short_name": "angular-web-extension", + "icons": { + "16": "icons/16.png", + "32": "icons/32.png", + "48": "icons/48.png", + "96": "icons/96.png", + "128": "icons/128.png" + }, + "author": "", + "background": { + "service_worker": "background.js" + }, + "content_scripts": [ + { + "matches": [""], + "js": ["content-script.js"] + } + ], + "permissions": ["storage", "activeTab"], + "host_permissions": [""], + "action": { + "default_title": "Angular Web Extension by Dreez", + "default_popup": "index.html" + } +} diff --git a/src/manifest.json b/src/manifest.firefox.json similarity index 78% rename from src/manifest.json rename to src/manifest.firefox.json index 42ae5b1..ce50e35 100644 --- a/src/manifest.json +++ b/src/manifest.firefox.json @@ -1,5 +1,5 @@ { - "manifest_version": 2, + "manifest_version": 3, "name": "Angular Web Extension Template by Dreez", "description": "A starter template for Angular web extensions.", "version": "1.0", @@ -13,8 +13,7 @@ }, "author": "", "background": { - "scripts": ["background.js"], - "persistent": false + "scripts": ["background.js"] }, "content_scripts": [ { @@ -22,8 +21,9 @@ "js": ["content-script.js"] } ], - "permissions": ["storage", "activeTab", "tabs"], - "browser_action": { + "permissions": ["storage", "activeTab"], + "host_permissions": [""], + "action": { "default_title": "Angular Web Extension by Dreez", "default_popup": "index.html" }