Initial commit

This commit is contained in:
2025-04-13 20:29:39 +02:00
commit 95d51e3c57
7 changed files with 229 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
function copyToClipboard(text) {
const input = document.createElement('input');
input.style.position = 'fixed';
input.style.opacity = 0;
input.value = text;
document.body.appendChild(input);
input.select();
document.execCommand('Copy');
document.body.removeChild(input);
};
chrome.browserAction.onClicked.addListener(function() {
var toClipboard = ""
var separator = "";
chrome.tabs.query({}, function(tabs) {
$.each(tabs, function() {
var url = new URL(this.url);
var domain = url.hostname;
if ((domain == "geocaching.com" || domain == "www.geocaching.com") && url.pathname.startsWith("/geocache")) {
toClipboard += separator + this.title.split(" ")[0];
separator = ",";
}
});
copyToClipboard(toClipboard);
});
});