'use strict'; // Constants const DEVICE_ID = '031_04'; // Found in the APK as the resource @string/device_id. (Default: "001") const BRAND_ID = '011'; // Selected from the function mapBrandCode(), which is found in embed.min.js (a script loaded by the website). (Default: "004") // Lock the reported app name and version to a known working value. (The reported app name and version can determine the video stream format.) const APP_NAME = 'webplayer-dc'; const APP_VERSION = '1.2.7.49'; // Target File const TARGET_FILE = 'playmanifest_secure.json'; // Patch XMLHttpRequest.open const oldOpen = XMLHttpRequest.prototype.open; Object.defineProperty(XMLHttpRequest.prototype, 'open', { value: function (method, url, ...args) { // Flag this._isTargetUrl = (new URL(url)).pathname.endsWith('/' + TARGET_FILE); // Call Original Method oldOpen.call(this, method, url, ...args); }, enumerable: false, configurable: false, writable: false }); // Patch XMLHttpRequest.setRequestHeader const oldSetRequestHeader = XMLHttpRequest.prototype.setRequestHeader; Object.defineProperty(XMLHttpRequest.prototype, 'setRequestHeader', { value: function (name, value) { // Lock App Version if (this._isTargetUrl && name.toLowerCase() === 'appversion') { value = APP_VERSION; } // Call Original Method oldSetRequestHeader.call(this, name, value); }, enumerable: false, configurable: false, writable: false }); // Add resolution info to video player. function addResolutionInfo(player) { // Remove existing

element (if possible). const id = '__disneynow_resolution_info__'; let p = document.getElementById(id); if (p) { p.remove(); } // Create

element p = document.createElement('P'); p.id = id; // Add

element to DOM. player.parentElement.insertBefore(p, player); // Set initial resolution text. function setResolutionText(resolution) { p.innerText = `Video Quality: ${resolution}`; } setResolutionText('N/A'); // Hook into