Skip to content

Commit a183af1

Browse files
committed
To MV3
1 parent b9621eb commit a183af1

40 files changed

+3149
-6897
lines changed

Diff for: .eslintrc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ module.exports = {
55
'plugin:import/warnings',
66
'plugin:import/typescript',
77
'plugin:@typescript-eslint/recommended',
8-
'prettier/@typescript-eslint',
98
'plugin:prettier/recommended',
109
],
1110
parserOptions: {
12-
ecmaVersion: 2018,
11+
ecmaVersion: 2020,
1312
sourceType: 'module',
1413
},
1514
rules: {
@@ -23,6 +22,7 @@ module.exports = {
2322
],
2423
'import/namespace': 0,
2524
'import/named': 0,
25+
'import/no-extraneous-dependencies': 1,
2626
'@typescript-eslint/no-var-requires': 'off',
2727
'@typescript-eslint/explicit-member-accessibility': 'off',
2828
'@typescript-eslint/explicit-function-return-type': 'off',

Diff for: README.md

+16-11
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
[![Discord](https://img.shields.io/discord/763927057549099028)](https://discord.com/invite/fQbzzdJ)
22

3-
# Spotify Lyrics
3+
# Lyrics for Spotify
44

5-
Install Extension:
6-
- Chrome/Chromium/Firefox: Download the zip on the [release](https://github.com/mantou132/Spotify-Lyrics/releases) page, and then load the extension on the extension management page of the browser. [reason](https://github.com/mantou132/Spotify-Lyrics/issues/68).
7-
- Safari(Soon)
8-
9-
The extension adds a button to the bottom left corner of Spotify Web Player,
5+
The **browser extension** adds a button to the bottom left corner of **Spotify Web Player**,
106
Click to switch the display status of the lyrics,
117
which is displayed in the Picture-in-Picture window by default setting.
128
Spotify can be [installed as pwa](https://support.google.com/chrome/answer/9658361) instead of desktop client.
@@ -15,9 +11,19 @@ If you have any questions, please submit an [issue](https://github.com/mantou132
1511

1612
![windows-pwa-spotify](./screenshot/windows-pwa-spotify.jpg)
1713

18-
The extension also supports Youtube Music, Apple Music, Deezer and Tidal, but songs with videos in Youtube Music cannot be perfectly supported(because the duration of the video is different from the duration of the officially released audio track).
14+
## Install
1915

20-
![macos-pwa-youtube](./screenshot/macos-pwa-youtube.jpg)
16+
- Chrome/Chromium/Firefox: Download the zip on the [release](https://github.com/mantou132/Spotify-Lyrics/releases) page, and then load the extension on the extension management page of the browser. [reason](https://github.com/mantou132/Spotify-Lyrics/issues/68).
17+
- Safari(Soon)
18+
19+
## Features
20+
21+
- Instant synchronized lyrics display
22+
- Lyrics style [setting](./screenshot/options-in-spotify.jpg)(Right Click)
23+
- Lyrics [editor](./screenshot/lrc-editor-in-spotify.jpg) and upload(Ctrl + Right Click)
24+
- [Experimental](https://github.com/mantou132/Spotify-Lyrics/issues/35) support Youtube Music, Apple Music, Deezer and Tidal
25+
26+
![macos-pwa-youtube](./screenshot/macos-pwa-youtube.jpg)
2127

2228
## How To Work
2329

@@ -52,9 +58,9 @@ Build:
5258
```bash
5359
yarn run build:zip
5460

55-
# firebase depoly and config update
61+
# firebase deploy and config update
5662
# npm i -g firebase-tools
57-
firebase depoly
63+
firebase deploy
5864
firebase functions:config:get
5965
firebase functions:config:set spotify-lyrics.manager-ids=xxx
6066
```
@@ -134,7 +140,6 @@ Fork it, submit PR.
134140
- If you can write code, you can fix [bugs](https://github.com/mantou132/Spotify-Lyrics/issues?q=is%3Aissue+is%3Aopen+label%3Abug) or improve [performance](https://github.com/mantou132/Spotify-Lyrics/issues?q=is%3Aissue+is%3Aopen+label%3Aperformance)
135141
- Optimize the matching rate of Chinese, Japanese and Korean lyrics.(edit [config.json](./src/page/config.json)). _Note: The extension already has automatic optimization, this list serves as a supplement_ . _[Unmatched lyrics report](https://datastudio.google.com/reporting/bfd79c68-f9f4-4af5-8e51-a12d3d6be450)_
136142

137-
138143
## Privacy Policy
139144

140145
[see](./public/privacy-policy.html).

Diff for: functions/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"firebase-functions": "^3.6.1"
1515
},
1616
"devDependencies": {
17-
"typescript": "^3.8.0",
17+
"typescript": "^5.4.5",
1818
"firebase-functions-test": "^0.2.0"
1919
},
2020
"private": true

Diff for: functions/yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -1640,10 +1640,10 @@ typedarray@^0.0.6:
16401640
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
16411641
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
16421642

1643-
typescript@^3.8.0:
1644-
version "3.9.10"
1645-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.10.tgz#70f3910ac7a51ed6bef79da7800690b19bf778b8"
1646-
integrity sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==
1643+
typescript@^5.4.5:
1644+
version "5.4.5"
1645+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611"
1646+
integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==
16471647

16481648
unbox-primitive@^1.0.1:
16491649
version "1.0.1"

Diff for: jest.config.js

-3
This file was deleted.

Diff for: package.json

+26-42
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,50 @@
11
{
22
"name": "spotify-lyrics",
33
"version": "1.5.33",
4-
"description": "Desktop Spotify Web Player Instant Synchronised Lyrics",
4+
"description": "Desktop Spotify Web Player Instant Synchronized Lyrics",
55
"scripts": {
66
"lint": "tsc --noEmit && eslint --ext .ts --fix src/",
7-
"test": "jest",
7+
"test": "vitest",
8+
"build": "vite build",
9+
"watch": "yarn build --watch",
810
"serve": "web-ext --config web-ext.config.js run --start-url open.spotify.com",
911
"serve:chromium": "yarn run serve -- -t chromium",
10-
"watch": "webpack --watch",
1112
"start": "concurrently npm:watch npm:serve:chromium",
12-
"test:matchrate": "cross-env TEST=matchrate concurrently npm:watch npm:serve:chromium",
13+
"test:rate": "cross-env TEST=rate concurrently npm:watch npm:serve:chromium",
1314
"release": "npx mantou132/release#b4228eed684d0e4a23ecc333d416f4ea7b67a845 -w public patch",
14-
"build": "cross-env NODE_ENV=production webpack",
1515
"start:firebase": "yarn --cwd functions run build && firebase emulators:start",
1616
"install": "yarn --cwd functions",
17-
"s:singer": "deno run --allow-read --allow-net script/singer.ts"
17+
"prepare": "husky install && yarn build",
18+
"s:singer": "deno run --allow-read --allow-net scripts/singer.ts"
1819
},
1920
"author": "mantou132",
2021
"license": "ISC",
2122
"dependencies": {
22-
"@mantou/gem": "^0.6.8",
23+
"@mantou/gem": "^1.7.12",
2324
"@sentry/browser": "^5.25.0",
24-
"@types/wicg-mediasession": "^1.0.4",
25-
"@webcomponents/webcomponentsjs": "^2.4.4",
25+
"@webcomponents/webcomponentsjs": "^2.8.0",
2626
"chinese-conv": "^1.0.1",
27-
"webextension-polyfill-ts": "^0.9.1"
27+
"webextension-polyfill": "^0.12.0"
2828
},
2929
"devDependencies": {
30-
"@types/jest": "^26.0.5",
31-
"@typescript-eslint/eslint-plugin": "^4.5.0",
32-
"@typescript-eslint/parser": "^4.5.0",
33-
"babel-eslint": "^10.1.0",
34-
"clean-webpack-plugin": "^3.0.0",
30+
"@types/webextension-polyfill": "^0.10.7",
31+
"@typescript-eslint/eslint-plugin": "^6.13.1",
32+
"@typescript-eslint/parser": "^6.13.1",
3533
"concurrently": "^5.2.0",
36-
"copy-webpack-plugin": "^6.0.2",
3734
"cross-env": "^7.0.2",
38-
"eslint": "^7.11.0",
39-
"eslint-config-prettier": "^6.14.0",
40-
"eslint-plugin-import": "^2.21.2",
41-
"eslint-plugin-prettier": "^3.1.4",
42-
"file-loader": "^4.3.0",
43-
"html-webpack-plugin": "^4.5.0",
44-
"husky": "^2.7.0",
45-
"jest": "^26.1.0",
46-
"lint-staged": "^8.2.1",
47-
"prettier": "^2.0.5",
48-
"replace-with-chunk-webpack-plugin": "0.0.1",
49-
"ts-jest": "^26.1.3",
50-
"ts-loader": "^6.2.2",
51-
"typescript": "^4.0.5",
52-
"url-loader": "^2.3.0",
53-
"web-ext": "^6.3.0",
54-
"webpack": "^4.43.0",
55-
"webpack-cli": "^3.3.12"
56-
},
57-
"engines": {
58-
"node": "^14.20.0"
59-
},
60-
"husky": {
61-
"hooks": {
62-
"pre-commit": "lint-staged"
63-
}
35+
"esbuild": "^0.20.2",
36+
"eslint": "^8.54.0",
37+
"eslint-config-prettier": "^9.0.0",
38+
"eslint-plugin-import": "^2.29.0",
39+
"eslint-plugin-prettier": "^5.0.1",
40+
"happy-dom": "^14.10.1",
41+
"husky": "^8.0.3",
42+
"lint-staged": "^15.1.0",
43+
"prettier": "^3.1.0",
44+
"typescript": "^5.4.5",
45+
"vite": "^5.2.10",
46+
"vitest": "^1.6.0",
47+
"web-ext": "^7.8.0"
6448
},
6549
"lint-staged": {
6650
"*.ts": "eslint --fix"

Diff for: public/_locales/en/messages.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
},
66

77
"extensionDescription": {
8-
"message": "Instant synchronised lyrics display in picture-in-picture window",
8+
"message": "Instant synchronized lyrics display in picture-in-picture window",
99
"description": "Description of the extension"
1010
},
1111

Diff for: public/manifest.json

+23-20
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
11
{
2+
"$schema": "https://raw.githubusercontent.com/extend-chrome/manifest-json-schema/main/schema/manifest.schema.json",
23
"name": "__MSG_extensionName__",
34
"version": "1.5.33",
4-
"manifest_version": 2,
5+
"manifest_version": 3,
56
"description": "__MSG_extensionDescription__",
67
"default_locale": "en",
78
"web_accessible_resources": [
8-
"*"
9+
{
10+
"resources": ["*"],
11+
"matches": ["*://*/*"]
12+
}
913
],
10-
"permissions": [
11-
"contextMenus",
12-
"storage",
13-
"tabs"
14+
"host_permissions": [
15+
"*://open.spotify.com/*",
16+
"*://www.deezer.com/*",
17+
"*://music.youtube.com/*",
18+
"*://music.apple.com/*",
19+
"*://listen.tidal.com/*"
1420
],
21+
"permissions": ["scripting", "contextMenus", "storage", "tabs"],
1522
"browser_specific_settings": {
1623
"gecko": {
1724
"id": "{9bbdd06f-4fe2-4d05-8c2d-1ef6bf71f84d}",
1825
"strict_min_version": "78.0"
1926
}
2027
},
2128
"background": {
22-
"scripts": [
23-
"background.js"
24-
]
29+
"service_worker": "background.js"
2530
},
2631
"content_scripts": [
2732
{
@@ -32,9 +37,7 @@
3237
"*://music.apple.com/*",
3338
"*://listen.tidal.com/*"
3439
],
35-
"js": [
36-
"content.js"
37-
],
40+
"js": ["content.js"],
3841
"run_at": "document_start"
3942
},
4043
{
@@ -45,14 +48,17 @@
4548
"*://music.apple.com/*",
4649
"*://listen.tidal.com/*"
4750
],
48-
"js": [
49-
"options.js"
50-
]
51+
"js": ["options/index.js"]
5152
}
5253
],
53-
"browser_action": {
54+
"options_ui": {
55+
"page": "options.html"
56+
},
57+
"action": {
5458
"default_popup": "popup.html",
55-
"default_icon": "icons/48.png"
59+
"default_icon": {
60+
"48": "icons/48.png"
61+
}
5662
},
5763
"commands": {
5864
"toggle": {
@@ -63,9 +69,6 @@
6369
"description": "Toggle lyrics"
6470
}
6571
},
66-
"options_ui": {
67-
"page": "options.html"
68-
},
6972
"icons": {
7073
"48": "icons/48.png",
7174
"96": "icons/96.png",

Diff for: script/singer.ts renamed to scripts/singer.ts

File renamed without changes.

0 commit comments

Comments
 (0)