From 0d6ffc339aaf7a29dc82913f467786543a70d800 Mon Sep 17 00:00:00 2001 From: xiaolongnk Date: Fri, 12 Jun 2026 12:09:50 +0800 Subject: [PATCH 1/2] fix: use documentReady instead of documentComplete for clipboard operations copyToClipboard and pasteFromClipboard were awaiting documentComplete() (the page load event) before constructing the HUD iframe. This caused yy / copy commands to silently defer on still-loading pages until all resources finished loading. documentReady() (DOMContentLoaded) is sufficient to inject the HUD iframe into the DOM and is what the init() path itself already uses. This makes copy/paste work immediately when the DOM is available, regardless of whether the page has fully loaded. --- content_scripts/hud.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content_scripts/hud.js b/content_scripts/hud.js index 18ff31a94..4f8f450f0 100644 --- a/content_scripts/hud.js +++ b/content_scripts/hud.js @@ -177,14 +177,14 @@ const HUD = { // * events. // * the HUD shouldn't be active for this frame while any of the copy/paste commands are running. async copyToClipboard(text) { - await DomUtils.documentComplete(); + await DomUtils.documentReady(); await this.init(); this.hudUI.postMessage({ name: "copyToClipboard", data: text }); }, async pasteFromClipboard(pasteListener) { this.pasteListener = pasteListener; - await DomUtils.documentComplete(); + await DomUtils.documentReady(); await this.init(); this.tween.fade(0, 0); this.hudUI.postMessage({ name: "pasteFromClipboard" }); From 6ecbb24955645b767e2c81d6b023954a18d83b6c Mon Sep 17 00:00:00 2001 From: xiaolongnk Date: Fri, 12 Jun 2026 15:45:18 +0800 Subject: [PATCH 2/2] fix: use documentReady for all HUD ops to unblock on loading pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit show(), showFindMode(), copyToClipboard(), and pasteFromClipboard() all waited for the load event (documentComplete) before initializing the HUD iframe. On a page whose load event is delayed (slow external resources, never-completing requests), pressing yy would silently do nothing: neither the URL was copied nor the 'Yanked' feedback appeared. documentReady() (DOMContentLoaded) is sufficient — the HUD is a chrome-extension iframe overlay independent of the page's resource load. showClipboardUnavailableMessage is left on documentComplete since it is only shown after a copy attempt already completed. --- content_scripts/hud.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content_scripts/hud.js b/content_scripts/hud.js index 4f8f450f0..904a646b2 100644 --- a/content_scripts/hud.js +++ b/content_scripts/hud.js @@ -74,7 +74,7 @@ const HUD = { // duration - if omitted, the message will show until dismissed. async show(text, duration) { - await DomUtils.documentComplete(); + await DomUtils.documentReady(); clearTimeout(this._showForDurationTimerId); // @hudUI.activate will take charge of making it visible await this.init(false); @@ -88,7 +88,7 @@ const HUD = { async showFindMode(findMode = null) { this.findMode = findMode; - await DomUtils.documentComplete(); + await DomUtils.documentReady(); await this.init(); this.hudUI.show({ name: "showFindMode" }); this.tween.fade(1.0, 150);