Some Changes
This commit is contained in:
parent
aa9dcf5adf
commit
b4fab3498b
@ -3,7 +3,7 @@
|
||||
"name": "Force High-Resolution DisneyNOW",
|
||||
"author": "TheBrokenRail",
|
||||
"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",
|
||||
"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.
|
||||
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
|
||||
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}`;
|
||||
|
Loading…
Reference in New Issue
Block a user