Last active
November 21, 2019 17:00
-
-
Save bitlather/08febadcd09cc5a0431b37783b1e0a09 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function copyToClipboard(str) { | |
const el = document.createElement('textarea'); | |
el.value = str; | |
document.body.appendChild(el); | |
el.select(); | |
document.execCommand('copy'); | |
document.body.removeChild(el); | |
}; | |
str = $("h1.title").textContent | |
+ "\n" + window.location.href | |
+ "\n" + "Description:" | |
+ "\n" + $("yt-formatted-string.content").textContent.split("\n»")[0] | |
copyToClipboard(str); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Creating Chrome Extension
From https://developer.chrome.com/extensions/getstarted
manifest.json
getPagesSource.js
popup.html
popup.js