fffffff
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 225 B |
Binary file not shown.
|
After Width: | Height: | Size: 225 B |
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"name": "ug-copy-extention",
|
||||
"version": "1.0",
|
||||
"description": "Adds a copy tab button to ultimate-guitar.com chord and tab pages.",
|
||||
"icons": {
|
||||
"48": "./icons/border-48.png",
|
||||
"96": "./icons/border-96.png"
|
||||
},
|
||||
"browser_action": {
|
||||
"default_title": "UG Copy",
|
||||
"default_icons": {
|
||||
"48": "./icons/border-48.png",
|
||||
"96": "./icons/border-96.png"
|
||||
},
|
||||
"default_popup": "popup/index.html"
|
||||
},
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
"id": "ug-copy@mozilla.org",
|
||||
"data_collection_permissions": {
|
||||
"required": ["none"]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"content_scripts": [
|
||||
{
|
||||
// "matches": ["*://tabs.ultimate-guitar.com/tab/**"],
|
||||
"matches": ["<all_urls>"],
|
||||
"js": ["./ug-copy.js"]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="style.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<button type="button" onclick="copyTab()">Copy Tab</button>
|
||||
<script src="ug-copy.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,12 @@
|
||||
.ug-copy-btn {
|
||||
background-color: #e76486;
|
||||
border-radius: 10px;
|
||||
bottom: 0;
|
||||
color: #292929;
|
||||
cursor: pointer;
|
||||
font-size: large;
|
||||
font-weight: bold;
|
||||
padding: 10px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
console.log("ug-copy running")
|
||||
/* const ugCopyBtnId = 'ug-copy-btn'
|
||||
const ugCopyBtnEl = document.createElement('button')
|
||||
ugCopyBtnEl.id = ugCopyBtnId
|
||||
ugCopyBtnEl.className = 'ug-copy-btn'
|
||||
ugCopyBtnEl.type = 'button'
|
||||
ugCopyBtnEl.innerHTML = "Copy Tab" */
|
||||
const copyTab = () => {
|
||||
const clip = document.querySelector('pre').innerText
|
||||
navigator.clipboard.writeText(clip).then(
|
||||
() => {},
|
||||
(e) => {
|
||||
console.log('ug-copy error;', e)
|
||||
},
|
||||
)
|
||||
}
|
||||
/* ugCopyBtnEl.addEventListener('click', copyTab)
|
||||
document.body.appendChild(ugCopyBtnEl)
|
||||
|
||||
const styleEl = document.createElement("link")
|
||||
styleEl.rel = "stylesheet"
|
||||
styleEl.setAttribute("href", "resource://ug-copy/style.css");
|
||||
document.getElementsByTagName("head")[0].appendChild(styleEl); */
|
||||
Reference in New Issue
Block a user