Make Ctrl+Shift+C Copy

Make Ctrl+Shift+C perform copy instead of open developer tool

  1. // ==UserScript==
  2. // @name Make Ctrl+Shift+C Copy
  3. // @namespace garyguo.net
  4. // @version 0.1
  5. // @description Make Ctrl+Shift+C perform copy instead of open developer tool
  6. // @author Gary Guo
  7. // @match *://*/*
  8. // @grant none
  9. // @license Unlicense
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. document.body.addEventListener('keydown', function(evt){
  16. if (evt.ctrlKey && evt.shiftKey && evt.key == "C"){
  17. // Copy the selection to the clipboard
  18. document.execCommand('copy');
  19. // Throw away this event and don't do the default stuff
  20. evt.stopPropagation();
  21. evt.preventDefault();
  22. }
  23. }, false);
  24.  
  25. document.body.addEventListener('keyup', function(evt){
  26. if (evt.ctrlKey && evt.shiftKey && evt.key == "C"){
  27. // Throw away this event and don't do the default stuff
  28. evt.stopPropagation();
  29. evt.preventDefault();
  30. }
  31. }, false);
  32. })();