* Register an in-flight action button on the awaiting bar. * Use to expose things like "🛑 Abort download" while we wait for a verdict. * The button auto-hides when the verdict resolves (or the next showAwaiting() is called). * @param {string} label Button text. * @param {() => void} onC
(label, onClick)
| 419 | * @param {() => void} onClick Click handler. Stays attached until the bar hides. |
| 420 | */ |
| 421 | function showAwaitingAction(label, onClick) { |
| 422 | $awaitingAction.textContent = label; |
| 423 | $awaitingAction.style.display = ""; |
| 424 | $awaitingAction.onclick = (ev) => { |
| 425 | ev.preventDefault(); |
| 426 | try { onClick(); } catch (e) { console.error("awaiting action handler threw:", e); } |
| 427 | }; |
| 428 | } |
| 429 | |
| 430 | |
| 431 | // ---------- GM_download wrappers ---------- |
no test coverage detected