Text Changer

Allows you to change any text on a website by pressing the "Pos1" key. Change, use, modify the code as you wish, but if you post this script anywhere (modified or not), you MUST inform me. Failure to do so will be considered a violation of copyright laws and will be reported accordingly.

  1. // ==UserScript==
  2. // @name Text Changer
  3. // @namespace http://www.example.com/
  4. // @version 1.1
  5. // @description Allows you to change any text on a website by pressing the "Pos1" key. Change, use, modify the code as you wish, but if you post this script anywhere (modified or not), you MUST inform me. Failure to do so will be considered a violation of copyright laws and will be reported accordingly.
  6. // @author Cxsty
  7. // @license MIT
  8. // @match *://*/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. let isTextEditingEnabled = false;
  16.  
  17. function enableTextEditing() {
  18. isTextEditingEnabled = true;
  19. document.body.setAttribute('contenteditable', 'true');
  20. }
  21.  
  22. function disableTextEditing() {
  23. isTextEditingEnabled = false;
  24. document.body.removeAttribute('contenteditable');
  25. }
  26.  
  27. function handleKeyPress(event) {
  28. const isPos1Key = event.key === 'Home' || event.code === 'Numpad7';
  29. if (isPos1Key) {
  30. if (!isTextEditingEnabled) {
  31. enableTextEditing();
  32. } else {
  33. disableTextEditing();
  34. }
  35. }
  36. }
  37.  
  38. document.addEventListener('keydown', handleKeyPress);
  39. })();

QingJ © 2025

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