Some Changes
This commit is contained in:
parent
aa9dcf5adf
commit
b4fab3498b
@ -3,7 +3,7 @@
|
|||||||
"name": "Force High-Resolution DisneyNOW",
|
"name": "Force High-Resolution DisneyNOW",
|
||||||
"author": "TheBrokenRail",
|
"author": "TheBrokenRail",
|
||||||
"version": "1.2",
|
"version": "1.2",
|
||||||
"description": "This browser extension forces DisneyNOW to use their higher-resolution video stream by imitating the Android app. (It also blocks DisneyNOW ads.)",
|
"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",
|
"homepage_url": "https://gitea.thebrokenrail.com/TheBrokenRail/force-high-resolution-disneynow",
|
||||||
"content_scripts": [
|
"content_scripts": [
|
||||||
{
|
{
|
||||||
|
18
src/page.js
18
src/page.js
@ -45,18 +45,20 @@ Object.defineProperty(XMLHttpRequest.prototype, 'setRequestHeader', {
|
|||||||
|
|
||||||
// Add resolution info to video player.
|
// Add resolution info to video player.
|
||||||
function addResolutionInfo(player) {
|
function addResolutionInfo(player) {
|
||||||
// Create (or find existing) <p> element.
|
// Remove existing <p> element (if possible).
|
||||||
const id = '__disneynow_resolution_info__';
|
const id = '__disneynow_resolution_info__';
|
||||||
let p = document.getElementById(id);
|
let p = document.getElementById(id);
|
||||||
if (!p) {
|
if (p) {
|
||||||
// Create
|
p.remove();
|
||||||
p = document.createElement('P');
|
|
||||||
p.id = id;
|
|
||||||
|
|
||||||
// Add <p> element to DOM.
|
|
||||||
player.parentElement.insertBefore(p, player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create <p> element
|
||||||
|
p = document.createElement('P');
|
||||||
|
p.id = id;
|
||||||
|
|
||||||
|
// Add <p> element to DOM.
|
||||||
|
player.parentElement.insertBefore(p, player);
|
||||||
|
|
||||||
// Set initial resolution text.
|
// Set initial resolution text.
|
||||||
function setResolutionText(resolution) {
|
function setResolutionText(resolution) {
|
||||||
p.innerText = `Video Quality: ${resolution}`;
|
p.innerText = `Video Quality: ${resolution}`;
|
||||||
|
Loading…
Reference in New Issue
Block a user