diff --git a/.wrangler/state/v3/cache/miniflare-CacheObject/metadata.sqlite b/.wrangler/state/v3/cache/miniflare-CacheObject/metadata.sqlite new file mode 100644 index 0000000..0b58f0d Binary files /dev/null and b/.wrangler/state/v3/cache/miniflare-CacheObject/metadata.sqlite differ diff --git a/.wrangler/state/v3/cache/miniflare-CacheObject/metadata.sqlite-shm b/.wrangler/state/v3/cache/miniflare-CacheObject/metadata.sqlite-shm new file mode 100644 index 0000000..881ccc6 Binary files /dev/null and b/.wrangler/state/v3/cache/miniflare-CacheObject/metadata.sqlite-shm differ diff --git a/.wrangler/state/v3/cache/miniflare-CacheObject/metadata.sqlite-wal b/.wrangler/state/v3/cache/miniflare-CacheObject/metadata.sqlite-wal new file mode 100644 index 0000000..0315217 Binary files /dev/null and b/.wrangler/state/v3/cache/miniflare-CacheObject/metadata.sqlite-wal differ diff --git a/assets/extension-help-1.png b/assets/extension-help-1.png new file mode 100644 index 0000000..b48c340 Binary files /dev/null and b/assets/extension-help-1.png differ diff --git a/assets/extension-help-2.png b/assets/extension-help-2.png new file mode 100644 index 0000000..c8502e1 Binary files /dev/null and b/assets/extension-help-2.png differ diff --git a/bun.lockb b/bun.lockb index 6fe0ad6..846059b 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/extension/README.md b/extension/README.md new file mode 100644 index 0000000..442101f --- /dev/null +++ b/extension/README.md @@ -0,0 +1,16 @@ +# Monochrome Tidal Origin + +While the website works without the extension with the use of proxies, it is recommended to install it to prevent various annoying issues. The website works best with the extension on. + +## Installation + +1. Click on the **Code** button on the [home page](https://github.com/monochrome-music/monochrome) of the repo and click **Download ZIP**. (or download the [latest main branch ZIP](https://github.com/monochrome-music/monochrome/archive/refs/heads/main.zip)) +2. Unpack the **.zip** archive with your archive program (like WinRar or 7Zip on Windows) +3. Open extensions page in your Chromium-based browser (Or `chrome://extensions/`) and make sure **Developer mode** is turned on. +4. Click on the **Load unpacked** and navigate to the directory you just unpacked. + +![Extension Help - Enabling Dev Mode](/assets/extension-help-1.png) + +5. Inside of it, there's a directory **extension**. **SELECT THAT DIRECTORY INSTEAD OF THE MAIN ONE!** It should contain file "manifest.json". + +![Extension Help - Locating Correct Directory](/assets/extension-help-2.png) diff --git a/extension/content.js b/extension/content.js new file mode 100644 index 0000000..eeaed79 --- /dev/null +++ b/extension/content.js @@ -0,0 +1,4 @@ +const s = document.createElement('script'); +s.src = chrome.runtime.getURL('inject.js'); +(document.head || document.documentElement).appendChild(s); +s.remove(); diff --git a/extension/icons/128.png b/extension/icons/128.png new file mode 100644 index 0000000..c8f4d79 Binary files /dev/null and b/extension/icons/128.png differ diff --git a/extension/icons/16.png b/extension/icons/16.png new file mode 100644 index 0000000..91837c5 Binary files /dev/null and b/extension/icons/16.png differ diff --git a/extension/icons/48.png b/extension/icons/48.png new file mode 100644 index 0000000..5e05a0c Binary files /dev/null and b/extension/icons/48.png differ diff --git a/extension/inject.js b/extension/inject.js new file mode 100644 index 0000000..06126f9 --- /dev/null +++ b/extension/inject.js @@ -0,0 +1 @@ +window.__tidalOriginExtension = true; diff --git a/extension/manifest.json b/extension/manifest.json new file mode 100644 index 0000000..2c2f39c --- /dev/null +++ b/extension/manifest.json @@ -0,0 +1,51 @@ +{ + "manifest_version": 3, + "name": "Monochrome Tidal Bypass", + "version": "1.0.2", + "description": "Adds Origin: https://listen.tidal.com to Tidal CDN requests so audio plays without a proxy", + "browser_specific_settings": { + "gecko": { + "id": "monochrome-tidal-bypass@binimum.org", + "strict_min_version": "111.0", + "data_collection_permissions": { + "required": ["none"] + } + } + }, + "permissions": ["declarativeNetRequest", "scripting", "declarativeNetRequestWithHostAccess"], + "host_permissions": [ + "*://*.tidal.com/*", + "*://monochrome.tf/*", + "*://monochrome.samidy.com/*", + "*://lossless.wtf/*", + "*://localhost/*" + ], + "declarative_net_request": { + "rule_resources": [ + { + "id": "rules", + "enabled": true, + "path": "rules.json" + } + ] + }, + "content_scripts": [ + { + "matches": ["*://monochrome.samidy.com/*", "*://monochrome.tf/*", "*://lossless.wtf/*", "*://localhost/*"], + "js": ["content.js"], + "run_at": "document_start", + "all_frames": true + } + ], + "icons": { + "16": "icons/16.png", + "48": "icons/48.png", + "128": "icons/128.png" + }, + "web_accessible_resources": [ + { + "resources": ["inject.js"], + "matches": ["*://monochrome.samidy.com/*", "*://monochrome.tf/*", "*://lossless.wtf/*", "*://localhost/*"] + } + ] +} diff --git a/extension/rules.json b/extension/rules.json new file mode 100644 index 0000000..8e87651 --- /dev/null +++ b/extension/rules.json @@ -0,0 +1,55 @@ +[ + { + "id": 1, + "priority": 1, + "action": { + "type": "modifyHeaders", + "responseHeaders": [ + { + "header": "Access-Control-Allow-Origin", + "operation": "set", + "value": "*" + }, + { + "header": "Access-Control-Allow-Methods", + "operation": "set", + "value": "GET, POST, PUT, DELETE, PATCH, OPTIONS" + }, + { + "header": "Access-Control-Allow-Headers", + "operation": "set", + "value": "*" + } + ] + }, + "condition": { + "urlFilter": "||tidal.com*", + "initiatorDomains": ["monochrome.tf", "monochrome.samidy.com"], + "resourceTypes": ["xmlhttprequest", "media"] + } + }, + { + "id": 2, + "priority": 1, + "action": { + "type": "modifyHeaders", + "requestHeaders": [ + { + "header": "Origin", + "operation": "set", + "value": "https://listen.tidal.com" + }, + { + "header": "Referer", + "operation": "set", + "value": "https://listen.tidal.com/" + } + ] + }, + "condition": { + "urlFilter": "||tidal.com*", + "initiatorDomains": ["monochrome.tf", "monochrome.samidy.com"], + "resourceTypes": ["xmlhttprequest", "media"] + } + } +] diff --git a/index.html b/index.html index 0d46417..e7ce3ce 100644 --- a/index.html +++ b/index.html @@ -117,6 +117,12 @@ +