debugger_shortcut

debugger_shortcut_desc

  1. // ==UserScript==
  2. // @name debugger_shortcut
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.3
  5. // @description debugger_shortcut_desc
  6. // @author XT
  7. // @match *://*/*
  8. // @grant none
  9. // @license Apache-2.0
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. 'use strict';
  14. var statusDiv = document.createElement('div');
  15. statusDiv.style.position = 'fixed';
  16. statusDiv.style.bottom = '10px';
  17. statusDiv.style.right = '10px';
  18. statusDiv.style.backgroundColor = '#333';
  19. statusDiv.style.color = 'white';
  20. statusDiv.style.padding = '10px';
  21. statusDiv.style.zIndex = '10000';
  22. statusDiv.style.borderRadius = '5px';
  23. statusDiv.style.fontFamily = 'Arial, sans-serif';
  24. statusDiv.innerHTML = 'click F2';
  25. document.body.appendChild(statusDiv);
  26. document.addEventListener('keydown', function (event) {
  27. if (event.key === 'F2') {
  28. statusDiv.innerHTML = 'debugger sucessful';
  29. debugger;
  30. }
  31. });
  32. // 显示脚本成功运行的信息
  33. console.log("Tampermonkey Loaded");
  34. })();