From 7d767ff9ce77391e11c60b7cae6c1d41d93d6a04 Mon Sep 17 00:00:00 2001 From: zrose584 <57181548+zrose584@users.noreply.github.com> Date: Sat, 30 Jul 2022 17:37:29 +0200 Subject: copyTextToClipboard: support fullscreen --- youtube/static/js/common.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'youtube') diff --git a/youtube/static/js/common.js b/youtube/static/js/common.js index 79f8834..599d578 100644 --- a/youtube/static/js/common.js +++ b/youtube/static/js/common.js @@ -94,7 +94,8 @@ function copyTextToClipboard(text) { textArea.value = text; - document.body.appendChild(textArea); + let parent_el = video.parentElement; + parent_el.appendChild(textArea); textArea.focus(); textArea.select(); @@ -106,7 +107,7 @@ function copyTextToClipboard(text) { console.log('Oops, unable to copy'); } - document.body.removeChild(textArea); + parent_el.removeChild(textArea); } -- cgit v1.2.3