Greasy Fork镜像 还支持 简体中文。

Shrug Inserter

Appends the shrug emoji to the currently-focused input. No jQuery.

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

// ==UserScript==
// @name         Shrug Inserter
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  Appends the shrug emoji to the currently-focused input. No jQuery.
// @author       Cezille07
// @match        https://*/*
// @match        http://*/*
// @grant        none
// @license      GPL-3.0+
// ==/UserScript==

(function() {
    'use strict';
    var shrug = '¯\\_(ツ)_/¯';
    function inputAppend (el) {
        el.target.value = el.target.value + shrug;

    }
    function divAppend (el) {
        el.innerText = el.innerText + shrug;
    }

    window.addEventListener('keydown', function(e) {
        var key = e.keyCode || e.which || e.key.charCodeAt(0);
        var tag = e.target.tagName;
        console.debug('Input', key, tag);
        if (key === 191 && e.ctrlKey) {
            if (['TEXTAREA', 'INPUT'].indexOf(tag) !== -1) {
                // Regular
                inputAppend(e.target);
            } else if (location.host === 'twitter.com') {
                // Twitter
                divAppend(document.getElementById('tweet-box-home-timeline').children[0]);
            } else {
                // Noop
            }
        }
    });
})();

QingJ © 2025

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