Skip to content

Commit

Permalink
Merge pull request #144 from zrose584/fix_t
Browse files Browse the repository at this point in the history
copyTextToClipboard: support fullscreen
  • Loading branch information
user234683 authored Jul 30, 2022
2 parents 8b63556 + 2c0d1ac commit 0e5ffd5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions youtube/static/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ function copyTextToClipboard(text) {

textArea.value = text;

document.body.appendChild(textArea);
let parent_el = video.parentElement;
parent_el.appendChild(textArea);
textArea.focus();
textArea.select();

Expand All @@ -103,7 +104,7 @@ function copyTextToClipboard(text) {
console.log('Oops, unable to copy');
}

document.body.removeChild(textArea);
parent_el.removeChild(textArea);
}


Expand Down
1 change: 1 addition & 0 deletions youtube/static/js/hotkeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ function onKeyDown(e) {

// console.log(e);
let v = Q("video");
if (!e.isTrusted) return; // plyr CustomEvent
let c = e.key.toLowerCase();
if (e.ctrlKey) return;
else if (c == "k") {
Expand Down

0 comments on commit 0e5ffd5

Please sign in to comment.