Compare commits

...

3 Commits
1.1 ... master

Author SHA1 Message Date
TheBrokenRail 751fa6191c Fix On Livestream 2022-05-14 19:57:37 -04:00
TheBrokenRail b4fab3498b Some Changes 2022-03-26 14:45:18 -04:00
TheBrokenRail aa9dcf5adf Fix Bug 2022-03-20 17:15:37 -04:00
2 changed files with 14 additions and 11 deletions

View File

@ -2,8 +2,8 @@
"manifest_version": 2,
"name": "Force High-Resolution DisneyNOW",
"author": "TheBrokenRail",
"version": "1.1",
"description": "This browser extension forces DisneyNOW to use their higher-resolution video stream by imitating the Android app. (It also blocks DisneyNOW ads.)",
"version": "1.3",
"description": "This browser extension forces DisneyNOW to use their higher-resolution video stream by imitating the Android app. (It also blocks some DisneyNOW ads.)",
"homepage_url": "https://gitea.thebrokenrail.com/TheBrokenRail/force-high-resolution-disneynow",
"content_scripts": [
{

View File

@ -45,18 +45,20 @@ Object.defineProperty(XMLHttpRequest.prototype, 'setRequestHeader', {
// Add resolution info to video player.
function addResolutionInfo(player) {
// Create (or find existing) <p> element.
// Remove existing <p> element (if possible).
const id = '__disneynow_resolution_info__';
let p = document.getElementById(id);
if (!p) {
// Create
const p = document.createElement('P');
p.id = id;
// Add <p> element to DOM.
player.parentElement.insertBefore(p, player);
if (p) {
p.remove();
}
// Create <p> element
p = document.createElement('P');
p.id = id;
// Add <p> element to DOM.
player.parentElement.insertBefore(p, player);
// Set initial resolution text.
function setResolutionText(resolution) {
p.innerText = `Video Quality: ${resolution}`;
@ -94,7 +96,8 @@ Object.defineProperty(XMLHttpRequest.prototype, 'send', {
// Log Video Stream URL
this.addEventListener("load", function () {
const obj = JSON.parse(this.responseText);
const assetUrl = new URL(obj.video.assets.asset[0].value);
const video = obj.video ? obj.video : obj.channels.channel[0];
const assetUrl = new URL(video.assets.asset[0].value);
console.log('Video Stream URL: ' + assetUrl);
});