commit cb316b97622fa79e3af661997f90a9b2dade4b37 Author: Kairo Date: Fri Jun 26 20:45:01 2026 -0400 fffffff diff --git a/icons/border-48.png b/icons/border-48.png new file mode 100644 index 0000000..90687de Binary files /dev/null and b/icons/border-48.png differ diff --git a/icons/border-96.png b/icons/border-96.png new file mode 100644 index 0000000..90687de Binary files /dev/null and b/icons/border-96.png differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..31d93f5 --- /dev/null +++ b/manifest.json @@ -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": [""], + "js": ["./ug-copy.js"] + } + ] +} diff --git a/popup/index.html b/popup/index.html new file mode 100644 index 0000000..e1e9d61 --- /dev/null +++ b/popup/index.html @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..b3bbdb9 --- /dev/null +++ b/style.css @@ -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; +} diff --git a/ug-copy.js b/ug-copy.js new file mode 100644 index 0000000..6f2b609 --- /dev/null +++ b/ug-copy.js @@ -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); */