Greasy Fork is available in English.

SourceTree Clone for GitLab

Add a "Clone with SourceTree" button to GitLab, if you're into that sort of thing

  1. // ==UserScript==
  2. // @name SourceTree Clone for GitLab
  3. // @namespace https://sanin.dev
  4. // @version 0.5
  5. // @description Add a "Clone with SourceTree" button to GitLab, if you're into that sort of thing
  6. // @author Cory Sanin
  7. // @match *://gitlab.com/*
  8. // @grant none
  9. // @icon https://www.sourcetreeapp.com/assets/img/favicons/sourcetree/android-chrome-192x192.png
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. var clonemenu = document.querySelector('ul.clone-options-dropdown');
  16. if(clonemenu){
  17. var openWithOptions = document.getElementsByClassName('open-with-link')[0].parentNode;
  18. var div = document.createElement('div');
  19. div.classList.add('gl-new-dropdown-item-text-wrapper');
  20. var a = document.createElement('a');
  21. a.classList.add('dropdown-item', 'open-with-link');
  22. a.href = `sourcetree://cloneRepo/${document.getElementById('ssh_project_clone').value}`
  23. div.appendChild(document.createTextNode('Clone In SourceTree'));
  24. a.appendChild(div);
  25. openWithOptions.appendChild(a);
  26. }
  27. })();