diff --git a/CHANGELOG.md b/CHANGELOG.md index abcb7f4..9623ca9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## Changelog -## 0.0.4 +## 0.0.5 # Alpha release -- Updated the copyurl.js file to fix the error +- Update the manifest.json file to include a shortcut keybind. +- Update the copyurl.js file to copy the url based on the shortcut +- Update the style.css file to add a larger width, and some color other than gray and black diff --git a/copyurl.js b/copyurl.js index e18a85b..978acb4 100644 --- a/copyurl.js +++ b/copyurl.js @@ -1,11 +1,13 @@ -const url = window.location.href; -navigator.clipboard.writeText(url).then( - function () { - console.log(`Copied URL: ${url}`); - }, - function (err) { - console.error(`Something went wrong..`, err); - }, -); - -console.log(`Wrote URL: ${url}`); +chrome.commands.onCommand.addListener(function (command) { + if (command === "Copy URL") { + const url = window.location.href; + navigator.clipboard.writeText(url).then( + function () { + console.log(`Copied URL: ${url}`); + }, + function (err) { + console.error(`Something went wrong..`, err); + }, + ); + } +}); diff --git a/manifest.json b/manifest.json index b77df97..c421bca 100644 --- a/manifest.json +++ b/manifest.json @@ -9,5 +9,13 @@ }, "background": { "service_worker": "copyurl.js" + }, + "commands": { + "Copy URL": { + "suggested_key": { + "default": "Ctrl+Shift+C" + }, + "description": "Copy the URL of the current tab" + } } } diff --git a/style.css b/style.css index 74f4d39..7924c1e 100644 --- a/style.css +++ b/style.css @@ -1,4 +1,10 @@ * { background-color: gray; - width: 100px; + width: 200px; +} + +h3, +p, +a { + color: white; }