From 5fa0b779281e1546ca1d7c4f3dc3835dcba364fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20Kadir=20Ak=C4=B1n?= Date: Fri, 16 Dec 2022 03:28:52 +0300 Subject: [PATCH] Update default.html --- _layouts/default.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/_layouts/default.html b/_layouts/default.html index 90a8c2c..c853229 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -36,13 +36,14 @@ button.style.padding = '0'; button.style.backgroundColor = 'transparent'; button.innerHTML = '✂️'; - button.addEventListener('click', () => { + button.addEventListener('click', async () => { if (navigator.clipboard) { - navigator.clipboard.writeText(x.innerText).then(() => alert('Prompt is copied, now paste this into ChatGPT.')); + await navigator.clipboard.writeText(x.innerText); + alert('Prompt is copied, now paste this into ChatGPT.'); } else { alert('Your browser does not support clipboard copy. Please select the prompt and copy.') } - }); + }, false); x.previousElementSibling.previousElementSibling.prepend(button); });