Copy the repository clone URL
Builds the HTTPS git clone URL of the current repository and copies it to the clipboard.
Code to copy
// Copy the repository git clone URL to the clipboard
var path = location.pathname.split('/').filter(Boolean).slice(0, 2).join('/');
if (path.split('/').length === 2) {
var url = 'https://github.com/' + path + '.git';
navigator.clipboard.writeText(url);
JZ.toast('Copied: ' + url);
} else {
JZ.toast('Open a repository first');
}
How to use this example
- Copy the code with the button above.
- Install JustZix (2 minutes) and open the extension on the target page.
- Add a new rule matching that page.
- Enable the action panel, add a button in the Actions tab and paste the code into it — run it with one click.
Rate this example
No ratings yet — be the first.