-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Dynamically load an external script | ||
let script = document.createElement('script'); | ||
script.src = chrome.runtime.getURL('script.js'); // For Chrome Extensions | ||
// script.src = 'script.js'; // For web applications | ||
document.head.appendChild(script); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"manifest_version": 3, | ||
"name": "iBroadcast Better", | ||
"description": "Forces the default streaming bitrate to 320kbps if \"Original Bitrate Streaming\" is not selected. Requires premium account to work. The player still shows 128kbps but you can actually hear the difference (or inspect the page source and see there).", | ||
"version": "0.37", | ||
"permissions": [], | ||
"icons": { | ||
"16": "images/icon16.png", | ||
"32": "images/icon32.png", | ||
"48": "images/icon48.png", | ||
"128": "images/icon128.png" | ||
}, | ||
"content_scripts": [ | ||
{ | ||
"matches": [ "*://*.ibroadcast.com/*" ], | ||
"js": ["content.js"], | ||
"run_at": "document_idle" | ||
} | ||
], | ||
"web_accessible_resources": [ | ||
{ | ||
"resources": ["script.js"], | ||
"matches": [ "*://*.ibroadcast.com/*" ] | ||
} | ||
], | ||
"action": { | ||
"default_icon": "images/icon32.png" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const originalSetup = iBroadcastPlay.prototype.setup; | ||
|
||
iBroadcastPlay.prototype.setup = function() { | ||
originalSetup.call(this); | ||
|
||
// Redefine `ongettrackurl` within setup to change the replacement | ||
this.ongettrackurl = (trackId)=>{ | ||
if (trackId == undefined || trackId == null) { | ||
return null; | ||
} | ||
let playurl = ib.hosts.streaming; | ||
playurl += music.library.tracks[trackId][music.library.tracks.map.file]; | ||
if (cookies.origbitrate && music.user.premium) { | ||
playurl = playurl.replace(/128/, 'orig'); | ||
} | ||
if (! cookies.origbitrate && music.user.premium) { | ||
playurl = playurl.replace(/128/, 320); | ||
document.getElementsByClassName('mgr-player-bitrate').innerHTML = ' • 320Kbps"' | ||
} | ||
playurl += "?Expires=" + music.library.expires + "&Signature=" + music.user.token + "&platform=" + ib.client + "&version=1.1&user_id=" + music.user.id + "&file_id=" + trackId; | ||
ib.log("- play url: " + playurl, this); | ||
return (playurl); | ||
}; | ||
}; |