Skip to content

Commit b77f2a2

Browse files
committed
Produce MV2 build for Firefox instead
1 parent 0895b31 commit b77f2a2

File tree

8 files changed

+809
-16
lines changed

8 files changed

+809
-16
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ module.exports = {
4242
'@typescript-eslint/no-confusing-void-expression': 'off',
4343
'@typescript-eslint/no-floating-promises': 'off',
4444
'@typescript-eslint/no-non-null-assertion': 'off',
45+
'@typescript-eslint/no-unsafe-argument': 'off',
4546
'@typescript-eslint/no-unused-expressions': 'off',
4647

4748
'linebreak-style': [

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ See https://livetl.app/hyperchat/install
1919

2020
## Building from Source
2121

22-
### ⚠️ WARNING ⚠️
23-
24-
For legacy reasons, we have a `mv2` branch for Firefox support while the `main` branch houses the main MV3 version.
25-
26-
TODO: we need to confirm whether the MV2 variant is still required for modern versions of Firefox.
27-
2822
### Development
2923

3024
> Note: The repo expects a Linux or Unix-like environment. If you are on Windows, use WSL.

src/manifest.json

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2-
"manifest_version": 3,
2+
"{{chrome}}.manifest_version": 3,
3+
"{{firefox}}.manifest_version": 2,
34
"name": "HyperChat [Improved YouTube Chat]",
45
"version": "0.0.0",
56
"homepage_url": "https://livetl.app/hyperchat",
@@ -11,7 +12,7 @@
1112
"permissions": [
1213
"storage"
1314
],
14-
"host_permissions": [
15+
"{{chrome}}.host_permissions": [
1516
"https://www.youtube.com/live_chat*",
1617
"https://www.youtube.com/live_chat_replay*",
1718
"https://studio.youtube.com/live_chat*",
@@ -25,9 +26,12 @@
2526
"https://studio.youtube.com/live_chat*",
2627
"https://studio.youtube.com/live_chat_replay*"
2728
],
28-
"js": [
29+
"{{chrome}}.js": [
2930
"scripts/chat-injector.ts"
3031
],
32+
"{{firefox}}.js": [
33+
"scripts/mv2/chat-injector.ts"
34+
],
3135
"css": [
3236
"stylesheets/titlebar.css"
3337
],
@@ -47,25 +51,36 @@
4751
"all_frames": true
4852
}
4953
],
50-
"{{firefox}}.background": {
51-
"scripts": ["scripts/chat-background.ts"]
52-
},
5354
"{{chrome}}.background": {
5455
"service_worker": "scripts/chat-background.ts"
5556
},
56-
"action": {
57+
"{{firefox}}.background": {
58+
"scripts": ["scripts/mv2/chat-background.ts"],
59+
"persistent": true
60+
},
61+
"{{chrome}}.action": {
5762
"default_icon": {
5863
"48": "assets/logo-48.png",
5964
"128": "assets/logo-128.png"
6065
},
6166
"default_popup": "options.html"
6267
},
63-
"web_accessible_resources": [
68+
"{{firefox}}.browser_action": {
69+
"default_icon": {
70+
"48": "assets/logo-48.png",
71+
"128": "assets/logo-128.png"
72+
},
73+
"default_popup": "options.html"
74+
},
75+
"{{chrome}}.web_accessible_resources": [
6476
{
6577
"resources": ["*"],
6678
"matches": ["<all_urls>"]
6779
}
6880
],
81+
"{{firefox}}.web_accessible_resources": [
82+
"*"
83+
],
6984
"options_ui": {
7085
"page": "options.html",
7186
"open_in_tab": true

0 commit comments

Comments
 (0)