generated from chibat/chrome-extension-typescript-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: zFernand0 <[email protected]>
- Loading branch information
Showing
15 changed files
with
71 additions
and
216 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
**/.DS_Store | ||
npm-debug.log | ||
node_modules/ | ||
dist/ | ||
|
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Function to create the copy button | ||
function createCopyButton() { | ||
const button = document.createElement('button'); | ||
button.innerText = 'Copy to Clipboard'; | ||
button.id = 'copy-to-clipboard-button'; | ||
button.style.position = 'fixed'; | ||
button.style.bottom = '10px'; | ||
button.style.right = '10px'; | ||
button.style.zIndex = '1000'; | ||
button.addEventListener('click', copyToClipboard); | ||
document.body.appendChild(button); | ||
} | ||
|
||
// Function to copy the current PR URL to the clipboard | ||
function copyToClipboard() { | ||
const url = window.location.href; | ||
navigator.clipboard.writeText(url).then(() => { | ||
alert('URL copied to clipboard!'); | ||
}).catch(err => { | ||
console.error('Failed to copy: ', err); | ||
}); | ||
} | ||
|
||
// Run the function to create the button | ||
createCopyButton(); |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#copy-to-clipboard-button { | ||
background-color: #2ea44f; | ||
color: white; | ||
border: none; | ||
padding: 10px 20px; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
font-size: 16px; | ||
} | ||
|
||
#copy-to-clipboard-button:hover { | ||
background-color: #218c3c; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"manifest_version": 3, | ||
|
||
"name": "Copy-to-clipboard for GiHub Pull Requests", | ||
"description": "Copy-to-clipboard for GiHub Pull Requests", | ||
"version": "1.0", | ||
|
||
"icons": { | ||
"256": "res/icon.png" | ||
}, | ||
|
||
"content_scripts": [ | ||
{ | ||
"matches": ["https://github.com/*/pull/*"], | ||
"js": ["content.js"], | ||
"css": ["css/content.css"] | ||
} | ||
], | ||
"permissions": [ | ||
"activeTab", "scripting" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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