using this
instead of re-selecting element
This commit is contained in:
parent
fb9cf148e8
commit
7432e07e98
|
@ -107,10 +107,7 @@ function applyBackground(data: BackgroundData, list: Background[]) {
|
|||
link.onload = () => {
|
||||
var selector = this.getAttribute('href');
|
||||
if (selector) selector = selector.split(/(light|dark|transp)/)[2];
|
||||
setTimeout(() => {
|
||||
var prevLink = document.querySelector("link[href$=\'light"+selector+"\'], link[href$=\'dark"+selector+"\'], link[href$=\'transp"+selector+"\']");
|
||||
if (prevLink) prevLink.remove();
|
||||
}, 100);
|
||||
setTimeout(() => this.remove(), 100);
|
||||
}
|
||||
document.head.appendChild(link);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue