Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manifest v3 compatibility #73

Draft
wants to merge 32 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b6862ff
Proper basename
jelmervdl Jul 17, 2023
f99890e
Remove async main
jelmervdl Jul 17, 2023
3691388
Simpler auto-reconnect to background script
jelmervdl Jul 17, 2023
4013ee9
Upgrade dependencies
jelmervdl Jul 17, 2023
6efcb4b
Convert to manifest v3 for Firefox
jelmervdl Jul 17, 2023
c8efa84
Fix missing UI
jelmervdl Jul 17, 2023
76ac832
Remove reference to unused `compat`
jelmervdl Jul 19, 2023
500094c
Use offscreen in Chrome to access Worker
jelmervdl Jul 19, 2023
8c9bd9e
Fix content-script css references in Chrome
jelmervdl Jul 19, 2023
2c89665
Properly abstract away the Chrome-only implementation
jelmervdl Jul 19, 2023
b9f1f78
Rewrite plumbing
jelmervdl Aug 4, 2023
178a091
Prioritise title
jelmervdl Aug 4, 2023
4111ede
Add chrome specific name
jelmervdl Aug 15, 2023
f085d47
Make better use of local ports
jelmervdl Aug 15, 2023
1cb7f07
Fix outbound and selection translation
jelmervdl Aug 16, 2023
8c76571
Fix popup progress updates
jelmervdl Aug 16, 2023
89b3c37
Fix translation cancellation, less debugging
jelmervdl Aug 16, 2023
f9727b3
Fix outbound translation scrolling
jelmervdl Aug 16, 2023
f052a6b
Fix "Download & Translate" button when it's already downloaded
jelmervdl Aug 16, 2023
3e8629a
Fix InPageTranslation and tables in Chrome
jelmervdl Aug 16, 2023
3b14e6c
Stupid but effective progress communication
jelmervdl Aug 16, 2023
f5751ec
Fix error message over message passing
jelmervdl Aug 16, 2023
d05a67a
Remove cruft
jelmervdl Aug 16, 2023
0b12e07
Remove spurious `async`
jelmervdl Aug 16, 2023
2296dbf
Fix saving preferences
jelmervdl Aug 17, 2023
b3ec8dd
Fix building chrome bundle
jelmervdl Aug 17, 2023
314134c
All downloads now support addProgressListener
jelmervdl Aug 17, 2023
edf1e67
Minor fixes to local translation
jelmervdl Aug 17, 2023
6191e03
Add Chrome screenshots
jelmervdl Aug 17, 2023
7930d3e
Add key
jelmervdl Aug 17, 2023
182bcf0
Rework publishing logic a bit
jelmervdl Aug 17, 2023
66e7d62
Fix action typo
jelmervdl Aug 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .github/screenshot-chrome-dynamic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/screenshot-chrome-outbound.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/screenshot-chrome-popup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/screenshot-chrome-selection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/screenshot-chrome-translating.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 58 additions & 16 deletions .github/workflows/publish_artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ on:
jobs:
build-extension:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- firefox-desktop
- chromium
steps:
- uses: actions/checkout@v2
- name: Use Node.js
Expand All @@ -22,35 +27,54 @@ jobs:
run: bash .github/deploy-tag.sh
- name: Install dependencies
run: npm install
- name: Run linter
run: npm run lint:js
continue-on-error: true
- name: Build
run: npm run build
run: npm run build -- --env=target=${{matrix.target}}
- name: Upload extension artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: extension-artefacts
name: translatelocally-${{matrix.target}}
if-no-files-found: error
path: ${{github.workspace}}/web-ext-artifacts/translatelocally.xpi
path: ${{github.workspace}}/extension/web-ext-artifacts/translatelocally-${{matrix.target}}.zip

upload-prerelease:
if: github.ref == 'refs/heads/main'
needs: build-extension
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifacts@v3
- name: Update development prerelease
uses: marvinpinto/action-automatic-releases@latest
if: github.ref == 'refs/heads/main'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: development-latest
prerelease: true
title: "Latest Development Build"
files: |
./web-ext-artifacts/translatelocally.xpi
- name: Sign extension
if: startsWith(github.ref, 'refs/tags/v')
continue-on-error: true
./translatelocally-*/translatelocally-*.zip

publish-firefox:
if: startsWith(github.ref, 'refs/tags/v')
needs: build-extension
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '17.x'
- name: Download artifacts
uses: actions/download-artifacts@v3
with:
name: translatelocally-firefox-desktop
- name: Unpack extension
run: unzip -d extension ./translatelocally-firefox-desktop.zip
- name: Sign & publish extension
env:
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }}
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }}
run: |
npm run sign
npx web-ext sign -s extension --no-config-discovery --channel listed
- name: Create release
id: create_release
if: startsWith(github.ref, 'refs/tags/v')
Expand All @@ -59,7 +83,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
release_name: Release ${{ github.ref }} for Firefox
draft: false
prerelease: false
- name: Upload release
Expand All @@ -69,6 +93,24 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./web-ext-artifacts/translatelocally.xpi
asset_path: web-ext-artifacts/translatelocally.xpi
asset_name: translatelocally.xpi
asset_content_type: application/zip
asset_content_type: application/zip

publish-chrome:
if: startsWith(github.ref, 'refs/tags/v')
needs: build-extension
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifacts@v3
with:
name: translatelocally-chromium
- name: Publish extension
uses: mnao305/[email protected]
with:
file-path: translatelocally-chromium.zip
extension-id: fenadanhohmncaemmgiklcpkeooflaeg
client-id: ${{ secrets.CLIENT_ID }}
client-secret: ${{ secrets.CLIENT_SECRET }}
refresh-token: ${{ secrets.REFRESH_TOKEN }}
Loading