GitHubHideDesktop

hide "Open in GitHub Desktop" button

当前为 2019-11-19 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @author gaojr
  3. // @namespace https://github.com/gaojr/greasyfork-scripts
  4. // @name:CN-zh_cn GitHub隐藏Desktop按钮
  5. // @name GitHubHideDesktop
  6. // @version 0.1
  7. // @description hide "Open in GitHub Desktop" button
  8. // @license MIT
  9. // @match https://github.com/*
  10. // @grant none
  11. // @connect github.com
  12. // @icon https://github.githubassets.com/pinned-octocat.svg
  13. // ==/UserScript==
  14.  
  15. (function () {
  16. // 删除仓库页的 "Open in Desktop"
  17. if (!!document.querySelector('.get-repo-modal-options .mt-2 .tooltipped.js-get-repo')) {
  18. document.querySelector('.get-repo-modal-options .mt-2 .tooltipped.js-get-repo').remove();
  19. }
  20. // 删除文件页的 "Open this file in GitHub Desktop"
  21. if (!!document.querySelector(".btn-octicon.tooltipped")) {
  22. document.querySelector(".btn-octicon.tooltipped").remove();
  23. }
  24. })();