Invisible Typer

Type an invisible character when pressing CTRL + Space.

目前为 2016-12-03 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Invisible Typer
  3. // @namespace Royalgamer06
  4. // @version 0.1
  5. // @description Type an invisible character when pressing CTRL + Space.
  6. // @author Royalgamer06
  7. // @include *
  8. // @grant unsafeWindow
  9. // @run-at document-idle
  10. // ==/UserScript==
  11.  
  12. unsafeWindow.onkeydown = function (e) {
  13. if (e.ctrlKey && e.keyCode == 32) {
  14. document.activeElement.value = document.activeElement.value.slice(0, document.activeElement.selectionStart) + String.fromCharCode(8290) + document.activeElement.value.slice(document.activeElement.selectionEnd);
  15. }
  16. };