Skip to content

Commit 45a3638

Browse files
committed
feat: upgrade to Manifest V3 in Chrome
BREAKING CHANGE: browser versions older than Chrome 123, Edge 123, Opera 109 and Safari 16.4 are no longer supported
1 parent 0ae1d74 commit 45a3638

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+5375
-7427
lines changed

Diff for: .browserslistrc

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
[chrome]
2-
Chrome >= 92
3-
Edge >= 92
4-
Opera >= 78
2+
Chrome >= 123
3+
Edge >= 123
4+
Opera >= 109
55

66
[edge]
7-
Edge >= 92
7+
Edge >= 123
88

99
[firefox]
1010
Firefox >= 115
1111
FirefoxAndroid >= 115
1212

1313
[opera]
14-
Opera >= 78
14+
Opera >= 109
1515

1616
[safari]
17-
Safari >= 14.1
18-
iOS >= 15
17+
Safari >= 16.4
18+
iOS >= 16.4
1919

2020
[samsung]
2121
Samsung >= 14

Diff for: .github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: sha256sum artifacts/*/*
3232
if: startsWith(github.ref, 'refs/tags/v')
3333
- name: Upload artifacts
34-
uses: actions/upload-artifact@v3
34+
uses: actions/upload-artifact@v4
3535
if: startsWith(github.ref, 'refs/tags/v')
3636
with:
3737
name: artifacts
@@ -46,14 +46,14 @@ jobs:
4646
contents: write
4747
steps:
4848
- name: Download artifacts
49-
uses: actions/download-artifact@v3
49+
uses: actions/download-artifact@v4
5050
with:
5151
name: artifacts
5252
path: artifacts/
5353
- name: Hash artifacts
5454
run: sha256sum artifacts/*/*
5555
- name: Create GitHub release
56-
uses: softprops/action-gh-release@v1
56+
uses: softprops/action-gh-release@v2
5757
with:
5858
tag_name: ${{ github.ref_name }}
5959
name: ${{ github.ref_name }}

Diff for: .github/workflows/label-actions.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ jobs:
1212
action:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: dessant/label-actions@v3
15+
- uses: dessant/label-actions@v4

Diff for: .github/workflows/lockdown.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
action:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: dessant/repo-lockdown@v3
14+
- uses: dessant/repo-lockdown@v4
1515
with:
1616
exclude-pr-created-before: '2022-01-01T00:00:00Z'
1717
pr-comment: 'This project does not accept pull requests. Please use issues to report bugs or suggest new features.'

Diff for: .nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20.9.0
1+
20.12.2

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ https://github.com/dessant/web-archives/wiki/Search-engines
6464

6565
## License
6666

67-
Copyright (c) 2017-2023 Armin Sebastian
67+
Copyright (c) 2017-2024 Armin Sebastian
6868

6969
This software is released under the terms of the GNU General Public License v3.0.
7070
See the [LICENSE](LICENSE) file for further information.

Diff for: gulpfile.js

+32-11
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ const targetEnv = process.env.TARGET_ENV || 'chrome';
2323
const isProduction = process.env.NODE_ENV === 'production';
2424
const enableContributions =
2525
(process.env.ENABLE_CONTRIBUTIONS || 'true') === 'true';
26+
27+
const mv3 = ['chrome'].includes(targetEnv);
28+
2629
const distDir = path.join(__dirname, 'dist', targetEnv);
2730

2831
function initEnv() {
@@ -46,12 +49,17 @@ function js(done) {
4649
}
4750

4851
function html() {
49-
return src(
50-
enableContributions
51-
? 'src/**/*.html'
52-
: ['src/**/*.html', '!src/contribute/*.html'],
53-
{base: '.'}
54-
)
52+
const htmlSrc = ['src/**/*.html'];
53+
54+
if (mv3) {
55+
htmlSrc.push('!src/background/*.html');
56+
}
57+
58+
if (!enableContributions) {
59+
htmlSrc.push('!src/contribute/*.html');
60+
}
61+
62+
return src(htmlSrc, {base: '.'})
5563
.pipe(gulpif(isProduction, htmlmin({collapseWhitespace: true})))
5664
.pipe(dest(distDir));
5765
}
@@ -71,7 +79,10 @@ async function images(done) {
7179
// Chrome Web Store does not correctly display optimized icons
7280
if (isProduction && targetEnv !== 'chrome') {
7381
await new Promise(resolve => {
74-
src(path.join(distDir, 'src/assets/icons/app/*.png'), {base: '.'})
82+
src(path.join(distDir, 'src/assets/icons/app/*.png'), {
83+
base: '.',
84+
encoding: false
85+
})
7586
.pipe(imagemin())
7687
.pipe(dest('.'))
7788
.on('error', done)
@@ -94,7 +105,10 @@ async function images(done) {
94105
}
95106
if (isProduction) {
96107
await new Promise(resolve => {
97-
src(path.join(distDir, 'src/assets/icons/engines/*.png'), {base: '.'})
108+
src(path.join(distDir, 'src/assets/icons/engines/*.png'), {
109+
base: '.',
110+
encoding: false
111+
})
98112
.pipe(imagemin())
99113
.pipe(dest('.'))
100114
.on('error', done)
@@ -104,7 +118,10 @@ async function images(done) {
104118
}
105119

106120
await new Promise(resolve => {
107-
src('src/assets/icons/@(app|engines|misc)/*.@(png|svg)', {base: '.'})
121+
src('src/assets/icons/@(app|engines|misc)/*.@(png|svg)', {
122+
base: '.',
123+
encoding: false
124+
})
108125
.pipe(gulpif(isProduction, imagemin()))
109126
.pipe(dest(distDir))
110127
.on('error', done)
@@ -113,7 +130,10 @@ async function images(done) {
113130

114131
if (enableContributions) {
115132
await new Promise(resolve => {
116-
src('node_modules/vueton/components/contribute/assets/*.@(png|svg)')
133+
src(
134+
'node_modules/vueton/components/contribute/assets/*.@(png|webp|svg)',
135+
{encoding: false}
136+
)
117137
.pipe(gulpif(isProduction, imagemin()))
118138
.pipe(dest(path.join(distDir, 'src/contribute/assets')))
119139
.on('error', done)
@@ -133,7 +153,8 @@ async function fonts(done) {
133153

134154
await new Promise(resolve => {
135155
src(
136-
'node_modules/@fontsource/roboto/files/roboto-latin-@(400|500|700)-normal.woff2'
156+
'node_modules/@fontsource/roboto/files/roboto-latin-@(400|500|700)-normal.woff2',
157+
{encoding: false}
137158
)
138159
.pipe(dest(path.join(distDir, 'src/assets/fonts/files')))
139160
.on('error', done)

0 commit comments

Comments
 (0)