Workaround for Chromium
This commit is contained in:
+5
-10
@@ -1,13 +1,11 @@
|
||||
function xmr_media_lazyload_add_handler(element) {
|
||||
element.addEventListener('play', (event) => {
|
||||
async function xmr_media_lazyload_perform(element) {
|
||||
let content = element.querySelector("noscript");
|
||||
if (content) {
|
||||
element.innerHTML = content.innerHTML;
|
||||
element.innerHTML = content.innerText;
|
||||
}
|
||||
});
|
||||
}
|
||||
function xmr_media_lazyload_initialize() {
|
||||
new Promise((resolve, reject) => {
|
||||
|
||||
async function xmr_media_lazyload_initialize() {
|
||||
// Figure out what to load.
|
||||
let elements = document.querySelectorAll(".block-media > [data-lazyload]");
|
||||
let stack = Array.from(elements);
|
||||
@@ -15,11 +13,8 @@ function xmr_media_lazyload_initialize() {
|
||||
|
||||
// Add a lazyloading handler to all entries.
|
||||
for (let el of stack) {
|
||||
xmr_media_lazyload_add_handler(el);
|
||||
xmr_media_lazyload_perform(el);
|
||||
}
|
||||
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
|
||||
(function() {
|
||||
|
||||
Reference in New Issue
Block a user