diff --git a/main.meta.js b/main.meta.js index ecd0f2d..12f73a8 100644 --- a/main.meta.js +++ b/main.meta.js @@ -1,7 +1,7 @@ // ==UserScript== // @name PNGExtraEmbed // @namespace https://coom.tech/ -// @version 0.65 +// @version 0.66 // @description uhh // @author You // @match https://boards.4channel.org/* @@ -14,4 +14,5 @@ // @connect 4chan.org // @connect 4channel.org // @connect i.4cdn.org +// @connect * // ==/UserScript== diff --git a/main.user.js b/main.user.js index fa11a42..c590152 100644 --- a/main.user.js +++ b/main.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name PNGExtraEmbed // @namespace https://coom.tech/ -// @version 0.65 +// @version 0.66 // @description uhh // @author You // @match https://boards.4channel.org/* @@ -14,6 +14,7 @@ // @connect 4chan.org // @connect 4channel.org // @connect i.4cdn.org +// @connect * // ==/UserScript== (() => { var __create = Object.create; @@ -10619,10 +10620,6 @@ resolved_promise.then(flush); } } - function tick() { - schedule_update(); - return resolved_promise; - } function add_render_callback(fn) { render_callbacks.push(fn); } @@ -14233,9 +14230,7 @@ $$invalidate(3, isAudio = type.mime.startsWith("audio/")); $$invalidate(2, isImage = type.mime.startsWith("image/")); if (hovering) { - await tick(); - recompute(); - await tick(); + setTimeout(recompute, 10); } } async function bepis() { @@ -14268,7 +14263,6 @@ dims = [~~(iw * scale), ~~(ih * scale)]; $$invalidate(9, hoverElem.style.width = `${dims[0]}px`, hoverElem); $$invalidate(9, hoverElem.style.height = `${dims[1]}px`, hoverElem); - $$invalidate(7, hovering = true); } async function hoverStart(ev) { if ($settings.dh) @@ -14281,6 +14275,7 @@ if (!contracted) return; recompute(); + $$invalidate(7, hovering = true); if (isVideo) { try { await hoverVideo.play(); diff --git a/src/Embedding.svelte b/src/Embedding.svelte index 1bfb789..c90d225 100644 --- a/src/Embedding.svelte +++ b/src/Embedding.svelte @@ -56,9 +56,7 @@ isImage = type.mime.startsWith('image/') if (hovering) { // reset hovering to recompute proper image coordinates - await tick(); - recompute(); - await tick(); + setTimeout(recompute, 10); } } @@ -102,7 +100,6 @@ hoverElem.style.width = `${dims[0]}px` hoverElem.style.height = `${dims[1]}px` - hovering = true } async function hoverStart(ev?: MouseEvent) { @@ -115,6 +112,7 @@ if (!contracted) return recompute(); + hovering = true if (isVideo){ try {