Skip to main content
100%

Clone gist in Desktop

✓ Published0🌍 Public
Aabernier
Last edited Feb 4, 2014
Created on Aug 1, 2012

This userscript adds a “Clone in Desktop” button to individual gist pages on GitHub. It targets the existing download button’s list item and duplicates it, then rewrites the anchor’s `href` to use the `github-mac://openRepo/` protocol with the repository URL taken from the page’s hidden `url-field` input. The script also swaps the button’s label and icon classes (`octicon-cloud-download` to `octicon-device-desktop`) and inserts the new element before the original. It relies on plain DOM manipulation via `querySelector`, `createElement`, and `innerHTML`, with no external libraries.

AI-generated description

Download the user.js file and then drop it into your chrome://extensions/ tab and enjoy the Clone in Desktop button on your gists!

Similar vizzes