mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-25 06:57:22 +00:00
replace innerHTML to safer textContent where possible
This commit is contained in:
parent
9b09d369d9
commit
c4cc50ca39
@ -1,5 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var community_data = JSON.parse(document.getElementById('community_data').innerHTML);
|
var community_data = JSON.parse(document.getElementById('community_data').textContent);
|
||||||
|
|
||||||
String.prototype.supplant = function (o) {
|
String.prototype.supplant = function (o) {
|
||||||
return this.replace(/{([^{}]*)}/g, function (a, b) {
|
return this.replace(/{([^{}]*)}/g, function (a, b) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var video_data = JSON.parse(document.getElementById('video_data').innerHTML);
|
var video_data = JSON.parse(document.getElementById('video_data').textContent);
|
||||||
|
|
||||||
function get_playlist(plid, retries) {
|
function get_playlist(plid, retries) {
|
||||||
if (retries === undefined) retries = 5;
|
if (retries === undefined) retries = 5;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var notification_data = JSON.parse(document.getElementById('notification_data').innerHTML);
|
var notification_data = JSON.parse(document.getElementById('notification_data').textContent);
|
||||||
|
|
||||||
var notifications, delivered;
|
var notifications, delivered;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var player_data = JSON.parse(document.getElementById('player_data').innerHTML);
|
var player_data = JSON.parse(document.getElementById('player_data').textContent);
|
||||||
var video_data = JSON.parse(document.getElementById('video_data').innerHTML);
|
var video_data = JSON.parse(document.getElementById('video_data').textContent);
|
||||||
|
|
||||||
var options = {
|
var options = {
|
||||||
preload: 'auto',
|
preload: 'auto',
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var playlist_data = JSON.parse(document.getElementById('playlist_data').innerHTML);
|
var playlist_data = JSON.parse(document.getElementById('playlist_data').textContent);
|
||||||
|
|
||||||
function add_playlist_video(target) {
|
function add_playlist_video(target) {
|
||||||
var select = target.parentNode.children[0].children[1];
|
var select = target.parentNode.children[0].children[1];
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var subscribe_data = JSON.parse(document.getElementById('subscribe_data').innerHTML);
|
var subscribe_data = JSON.parse(document.getElementById('subscribe_data').textContent);
|
||||||
|
|
||||||
var subscribe_button = document.getElementById('subscribe');
|
var subscribe_button = document.getElementById('subscribe');
|
||||||
subscribe_button.parentNode['action'] = 'javascript:void(0)';
|
subscribe_button.parentNode['action'] = 'javascript:void(0)';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var video_data = JSON.parse(document.getElementById('video_data').innerHTML);
|
var video_data = JSON.parse(document.getElementById('video_data').textContent);
|
||||||
|
|
||||||
String.prototype.supplant = function (o) {
|
String.prototype.supplant = function (o) {
|
||||||
return this.replace(/{([^{}]*)}/g, function (a, b) {
|
return this.replace(/{([^{}]*)}/g, function (a, b) {
|
||||||
@ -11,10 +11,10 @@ String.prototype.supplant = function (o) {
|
|||||||
function toggle_parent(target) {
|
function toggle_parent(target) {
|
||||||
var body = target.parentNode.parentNode.children[1];
|
var body = target.parentNode.parentNode.children[1];
|
||||||
if (body.style.display === null || body.style.display === '') {
|
if (body.style.display === null || body.style.display === '') {
|
||||||
target.innerHTML = '[ + ]';
|
target.textContent = '[ + ]';
|
||||||
body.style.display = 'none';
|
body.style.display = 'none';
|
||||||
} else {
|
} else {
|
||||||
target.innerHTML = '[ - ]';
|
target.textContent = '[ - ]';
|
||||||
body.style.display = '';
|
body.style.display = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -23,10 +23,10 @@ function toggle_comments(event) {
|
|||||||
var target = event.target;
|
var target = event.target;
|
||||||
var body = target.parentNode.parentNode.parentNode.children[1];
|
var body = target.parentNode.parentNode.parentNode.children[1];
|
||||||
if (body.style.display === null || body.style.display === '') {
|
if (body.style.display === null || body.style.display === '') {
|
||||||
target.innerHTML = '[ + ]';
|
target.textContent = '[ + ]';
|
||||||
body.style.display = 'none';
|
body.style.display = 'none';
|
||||||
} else {
|
} else {
|
||||||
target.innerHTML = '[ - ]';
|
target.textContent = '[ - ]';
|
||||||
body.style.display = '';
|
body.style.display = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ function hide_youtube_replies(event) {
|
|||||||
var body = target.parentNode.parentNode.children[1];
|
var body = target.parentNode.parentNode.children[1];
|
||||||
body.style.display = 'none';
|
body.style.display = 'none';
|
||||||
|
|
||||||
target.innerHTML = sub_text;
|
target.textContent = sub_text;
|
||||||
target.onclick = show_youtube_replies;
|
target.onclick = show_youtube_replies;
|
||||||
target.setAttribute('data-inner-text', inner_text);
|
target.setAttribute('data-inner-text', inner_text);
|
||||||
target.setAttribute('data-sub-text', sub_text);
|
target.setAttribute('data-sub-text', sub_text);
|
||||||
@ -65,7 +65,7 @@ function show_youtube_replies(event) {
|
|||||||
var body = target.parentNode.parentNode.children[1];
|
var body = target.parentNode.parentNode.children[1];
|
||||||
body.style.display = '';
|
body.style.display = '';
|
||||||
|
|
||||||
target.innerHTML = sub_text;
|
target.textContent = sub_text;
|
||||||
target.onclick = hide_youtube_replies;
|
target.onclick = hide_youtube_replies;
|
||||||
target.setAttribute('data-inner-text', inner_text);
|
target.setAttribute('data-inner-text', inner_text);
|
||||||
target.setAttribute('data-sub-text', sub_text);
|
target.setAttribute('data-sub-text', sub_text);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var watched_data = JSON.parse(document.getElementById('watched_data').innerHTML);
|
var watched_data = JSON.parse(document.getElementById('watched_data').textContent);
|
||||||
|
|
||||||
function mark_watched(target) {
|
function mark_watched(target) {
|
||||||
var tile = target.parentNode.parentNode.parentNode.parentNode.parentNode;
|
var tile = target.parentNode.parentNode.parentNode.parentNode.parentNode;
|
||||||
|
Loading…
Reference in New Issue
Block a user