Skip to content

Produce MV2 build for Firefox instead #166

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module.exports = {
'@typescript-eslint/no-confusing-void-expression': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unused-expressions': 'off',

'linebreak-style': [
Expand Down
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ See https://livetl.app/hyperchat/install

## Building from Source

### ⚠️ WARNING ⚠️

For legacy reasons, we have a `mv2` branch for Firefox support while the `main` branch houses the main MV3 version.

TODO: we need to confirm whether the MV2 variant is still required for modern versions of Firefox.

### Development

> Note: The repo expects a Linux or Unix-like environment. If you are on Windows, use WSL.
Expand Down
31 changes: 23 additions & 8 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"manifest_version": 3,
"{{chrome}}.manifest_version": 3,
"{{firefox}}.manifest_version": 2,
"name": "HyperChat [Improved YouTube Chat]",
"version": "0.0.0",
"homepage_url": "https://livetl.app/hyperchat",
Expand All @@ -11,7 +12,7 @@
"permissions": [
"storage"
],
"host_permissions": [
"{{chrome}}.host_permissions": [
"https://www.youtube.com/live_chat*",
"https://www.youtube.com/live_chat_replay*",
"https://studio.youtube.com/live_chat*",
Expand All @@ -25,9 +26,12 @@
"https://studio.youtube.com/live_chat*",
"https://studio.youtube.com/live_chat_replay*"
],
"js": [
"{{chrome}}.js": [
"scripts/chat-injector.ts"
],
"{{firefox}}.js": [
"scripts/mv2/chat-injector.ts"
],
"css": [
"stylesheets/titlebar.css"
],
Expand All @@ -47,25 +51,36 @@
"all_frames": true
}
],
"{{firefox}}.background": {
"scripts": ["scripts/chat-background.ts"]
},
"{{chrome}}.background": {
"service_worker": "scripts/chat-background.ts"
},
"action": {
"{{firefox}}.background": {
"scripts": ["scripts/mv2/chat-background.ts"],
"persistent": true
},
"{{chrome}}.action": {
"default_icon": {
"48": "assets/logo-48.png",
"128": "assets/logo-128.png"
},
"default_popup": "options.html"
},
"web_accessible_resources": [
"{{firefox}}.browser_action": {
"default_icon": {
"48": "assets/logo-48.png",
"128": "assets/logo-128.png"
},
"default_popup": "options.html"
},
"{{chrome}}.web_accessible_resources": [
{
"resources": ["*"],
"matches": ["<all_urls>"]
}
],
"{{firefox}}.web_accessible_resources": [
"*"
],
"options_ui": {
"page": "options.html",
"open_in_tab": true
Expand Down
Loading
Loading