Greasy Fork

Greasy Fork is available in English.

handleKey

快捷键处理函数

当前为 2018-12-02 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greasyfork.icu/scripts/375077/649955/handleKey.js

var handleKey = function(a,b,c) {
    var d = zdElement.filter(function (t) {
        if (t.hasAttribute && t.hasAttribute('accesskey') && t.getAttribute('accesskey') == a ||
            t.classList.contains(b)) {
            if (t.offsetParent !== null) {
                if (!t.classList.contains(b)) {
                    t.classList.add(b);
                    t.removeAttribute('accesskey', '*');
                }
                c.push(zdGetSubscript(zdElement, t));
                return t;
            }
        }
    });
return d;
}