Invisible Typer

Type an invisible character when pressing CTRL + Space.

目前為 2016-12-03 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Invisible Typer
// @namespace    Royalgamer06
// @version      0.1
// @description  Type an invisible character when pressing CTRL + Space.
// @author       Royalgamer06
// @include      *
// @grant        unsafeWindow
// @run-at       document-idle
// ==/UserScript==

unsafeWindow.onkeydown = function (e) {
    if (e.ctrlKey && e.keyCode == 32) {
        document.activeElement.value = document.activeElement.value.slice(0, document.activeElement.selectionStart) + String.fromCharCode(8290) + document.activeElement.value.slice(document.activeElement.selectionEnd);
    }
};