-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exclude discarded tabs; inject tabs progressively (#3)
- Loading branch information
Showing
22 changed files
with
9,697 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Test | ||
|
||
on: | ||
- pull_request | ||
- push | ||
|
||
jobs: | ||
Lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: package.json | ||
- run: npm ci | ||
- run: npx xo | ||
|
||
Build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: package.json | ||
- run: npm ci | ||
- run: npm run prepack | ||
|
||
Demo: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: package.json | ||
- run: npm ci | ||
- run: npm run demo:build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
env: | ||
IMPORT_TEXT: import | ||
NPM_MODULE_NAME: webext-inject-on-install | ||
|
||
# FILE GENERATED WITH: npx ghat fregante/ghatemplates/esm-lint | ||
# SOURCE: https://github.com/fregante/ghatemplates | ||
# OPTIONS: {"exclude":["jobs.Parcel"]} | ||
|
||
name: ESM | ||
on: | ||
pull_request: | ||
branches: | ||
- '*' | ||
push: | ||
branches: | ||
- master | ||
- main | ||
jobs: | ||
Pack: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: npm install | ||
- run: npm run build --if-present | ||
- run: npm pack --dry-run | ||
- run: npm pack | tail -1 | xargs -n1 tar -xzf | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: package | ||
Webpack: | ||
runs-on: ubuntu-latest | ||
needs: Pack | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- run: npm install ./artifact | ||
- run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.js | ||
- run: webpack --entry ./index.js | ||
- run: cat dist/main.js | ||
Rollup: | ||
runs-on: ubuntu-latest | ||
needs: Pack | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- run: npm install ./artifact rollup@2 @rollup/plugin-node-resolve | ||
- run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.js | ||
- run: npx rollup -p node-resolve index.js | ||
Vite: | ||
runs-on: ubuntu-latest | ||
needs: Pack | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- run: npm install ./artifact | ||
- run: >- | ||
echo '<script type="module">${{ env.IMPORT_TEXT }} "${{ | ||
env.NPM_MODULE_NAME }}"</script>' > index.html | ||
- run: npx vite build | ||
- run: cat dist/assets/* | ||
esbuild: | ||
runs-on: ubuntu-latest | ||
needs: Pack | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- run: echo '{}' > package.json | ||
- run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.js | ||
- run: npm install ./artifact | ||
- run: npx esbuild --bundle index.js | ||
TypeScript: | ||
runs-on: ubuntu-latest | ||
needs: Pack | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- run: npm install ./artifact @sindresorhus/tsconfig | ||
- run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.ts | ||
- run: | | ||
echo '{"extends":"@sindresorhus/tsconfig","files":["index.ts"]}' > tsconfig.json | ||
- run: tsc | ||
- run: cat index.js | ||
Node: | ||
runs-on: ubuntu-latest | ||
needs: Pack | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 16 | ||
- run: echo "${{ env.IMPORT_TEXT }} '${{ env.NPM_MODULE_NAME }}'" > index.mjs | ||
- run: npm install ./artifact | ||
- run: node index.mjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ Thumbs.db | |
*.bak | ||
*.log | ||
logs | ||
|
||
*.common-js.js | ||
*.es-modules.js | ||
*.map | ||
dist | ||
distribution | ||
.parcel-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "@parcel/config-webextension" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import 'webext-inject-on-install/register'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.count('content.js injected'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/chrome-manifest", | ||
"name": "webext-inject-on-install", | ||
"manifest_version": 2, | ||
"version": "1.0.0", | ||
"description": "Injects a script into the page when the extension is installed.", | ||
"permissions": [ | ||
"tabs", | ||
"https://ephiframe.vercel.app/*" | ||
], | ||
"content_scripts": [ | ||
{ | ||
"matches": ["https://ephiframe.vercel.app/*"], | ||
"js": ["content.js"] | ||
} | ||
], | ||
"background": { | ||
"scripts": ["background.js"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"type": "module", | ||
"alias": { | ||
"webext-inject-on-install": "../source/" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Test extension | ||
|
||
Run these 2 commands in parallel to open the extension: | ||
|
||
```sh | ||
npm run demo:watch | ||
npx web-ext run --target=chromium | ||
``` | ||
|
||
Also open the background script console to see any errors. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,9 @@ | ||
The MIT License (MIT) | ||
MIT License | ||
|
||
Copyright (c) Federico Brigante <[email protected].com> (twitter.com/bfred_it) | ||
Copyright (c) Federico Brigante <me@fregante.com> (https://fregante.com) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
Oops, something went wrong.