Compare commits
No commits in common. "master" and "1.1" have entirely different histories.
|
@ -2,8 +2,8 @@
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "Force High-Resolution DisneyNOW",
|
"name": "Force High-Resolution DisneyNOW",
|
||||||
"author": "TheBrokenRail",
|
"author": "TheBrokenRail",
|
||||||
"version": "1.3",
|
"version": "1.1",
|
||||||
"description": "This browser extension forces DisneyNOW to use their higher-resolution video stream by imitating the Android app. (It also blocks some DisneyNOW ads.)",
|
"description": "This browser extension forces DisneyNOW to use their higher-resolution video stream by imitating the Android app. (It also blocks DisneyNOW ads.)",
|
||||||
"homepage_url": "https://gitea.thebrokenrail.com/TheBrokenRail/force-high-resolution-disneynow",
|
"homepage_url": "https://gitea.thebrokenrail.com/TheBrokenRail/force-high-resolution-disneynow",
|
||||||
"content_scripts": [
|
"content_scripts": [
|
||||||
{
|
{
|
||||||
|
|
15
src/page.js
15
src/page.js
|
@ -45,19 +45,17 @@ Object.defineProperty(XMLHttpRequest.prototype, 'setRequestHeader', {
|
||||||
|
|
||||||
// Add resolution info to video player.
|
// Add resolution info to video player.
|
||||||
function addResolutionInfo(player) {
|
function addResolutionInfo(player) {
|
||||||
// Remove existing <p> element (if possible).
|
// Create (or find existing) <p> element.
|
||||||
const id = '__disneynow_resolution_info__';
|
const id = '__disneynow_resolution_info__';
|
||||||
let p = document.getElementById(id);
|
let p = document.getElementById(id);
|
||||||
if (p) {
|
if (!p) {
|
||||||
p.remove();
|
// Create
|
||||||
}
|
const p = document.createElement('P');
|
||||||
|
|
||||||
// Create <p> element
|
|
||||||
p = document.createElement('P');
|
|
||||||
p.id = id;
|
p.id = id;
|
||||||
|
|
||||||
// Add <p> element to DOM.
|
// Add <p> element to DOM.
|
||||||
player.parentElement.insertBefore(p, player);
|
player.parentElement.insertBefore(p, player);
|
||||||
|
}
|
||||||
|
|
||||||
// Set initial resolution text.
|
// Set initial resolution text.
|
||||||
function setResolutionText(resolution) {
|
function setResolutionText(resolution) {
|
||||||
|
@ -96,8 +94,7 @@ Object.defineProperty(XMLHttpRequest.prototype, 'send', {
|
||||||
// Log Video Stream URL
|
// Log Video Stream URL
|
||||||
this.addEventListener("load", function () {
|
this.addEventListener("load", function () {
|
||||||
const obj = JSON.parse(this.responseText);
|
const obj = JSON.parse(this.responseText);
|
||||||
const video = obj.video ? obj.video : obj.channels.channel[0];
|
const assetUrl = new URL(obj.video.assets.asset[0].value);
|
||||||
const assetUrl = new URL(video.assets.asset[0].value);
|
|
||||||
console.log('Video Stream URL: ' + assetUrl);
|
console.log('Video Stream URL: ' + assetUrl);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user