forked from rDrama/rDrama
fix error in console
parent
7544be2f0f
commit
c10342e835
|
@ -895,7 +895,9 @@
|
||||||
const detectionDiv = document.querySelector('#detection');
|
const detectionDiv = document.querySelector('#detection');
|
||||||
const isAutoDark = getComputedStyle(detectionDiv).backgroundColor != 'rgb(255, 255, 255)';
|
const isAutoDark = getComputedStyle(detectionDiv).backgroundColor != 'rgb(255, 255, 255)';
|
||||||
if (!isAutoDark) {
|
if (!isAutoDark) {
|
||||||
const element = document.getElementsByClassName('comment-section')[0];
|
let element = document.getElementsByClassName('comment-section')
|
||||||
|
if (element) {
|
||||||
|
element = element[0];
|
||||||
let color = getComputedStyle(element).getPropertyValue('background-color');
|
let color = getComputedStyle(element).getPropertyValue('background-color');
|
||||||
color = 'rgba' + color.slice(3,-1) + ', 0.1)'
|
color = 'rgba' + color.slice(3,-1) + ', 0.1)'
|
||||||
|
|
||||||
|
@ -908,6 +910,7 @@
|
||||||
style.innerHTML = `.actual-post:not(.deleted):not(.banned),.comment-section>.comment{background-image:url("data:image/svg+xml;base64,${base64Mark}")}`;
|
style.innerHTML = `.actual-post:not(.deleted):not(.banned),.comment-section>.comment{background-image:url("data:image/svg+xml;base64,${base64Mark}")}`;
|
||||||
document.getElementsByTagName('head')[0].appendChild(style);
|
document.getElementsByTagName('head')[0].appendChild(style);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue