Allow Copy and Contex Menu Continued

Allow Copy (include hot keys and some css) & Contex Menu

当前为 2015-09-20 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Allow Copy and Contex Menu Continued
  3. // @version 3
  4. // @author Anonimous
  5. // @namespace https://gf.qytechs.cn/en/users/16081-lolipop
  6. // @description Allow Copy (include hot keys and some css) & Contex Menu
  7. // @include *
  8. // @license GPL version 3 or any later version; www.gnu.org/licenses/gpl-3.0.en.html
  9. // @grant GM_addStyle
  10. // @run-at document-start
  11. // ==/UserScript==
  12.  
  13. ;(function(){
  14.  
  15. /* handler names */
  16. var handlerNameArr = ['contextmenu', 'copy', 'cut', 'paste', 'mousedown', 'mouseup', 'beforeunload', 'beforeprint', 'keyup', 'keydown'];
  17.  
  18. /* remove protection of window */
  19. var removeProtection = function removeProtectionName(protectedWindow) {
  20.  
  21. /*
  22. * document object in frames is same as window https://developer.mozilla.org/en-US/docs/Web/API/Window/frames
  23. * frames == iframe + frame
  24. */
  25. for(var i=0; i < handlerNameArr.length; i++){
  26. var handlerName = handlerNameArr[i];
  27. var handlerOnName = 'on' + handlerName;
  28. if(protectedWindow[handlerName])
  29. protectedWindow[handlerName] = null;
  30. protectedWindow.addEventListener(handlerName, function(e){ e.stopPropagation(); }, true);
  31. }
  32.  
  33. };
  34.  
  35. /* remove main window protection */
  36. removeProtection(window);
  37.  
  38. /* remove frame window protection */
  39. var frameList = window.frames;
  40.  
  41. for(var i = 0; i < frameList.length; i++) {
  42. try{
  43. removeProtection(frameList[i]);
  44. } catch(e){
  45. }
  46. }
  47. /* remove css protection */
  48. GM_addStyle('* { -moz-user-select: text !important; user-select: text !important; } ');
  49. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址