Greasy Fork

Greasy Fork is available in English.

Bunpro: Disable Backspace Undo

Disables the backspace functionality in reviews

当前为 2020-02-07 提交的版本,查看 最新版本

// ==UserScript==
// @name         Bunpro: Disable Backspace Undo
// @namespace    http://tampermonkey.net/
// @version      1.0.1
// @description  Disables the backspace functionality in reviews
// @author       Kumirei
// @include      *bunpro.jp/*
// @exclude      *community.bunpro.jp*
// @require      http://greasyfork.icu/scripts/5392-waitforkeyelements/code/WaitForKeyElements.js?version=115012
// @require      http://greasyfork.icu/scripts/370623-bunpro-helpful-events/code/Bunpro:%20Helpful%20Events.js?version=615700
// @grant        none
// ==/UserScript==

(function() {
    var $ = window.$;
    $('html')[0].addEventListener('quiz-page', ()=>{
        var input_elem = $('#study-answer-input');
        $('body').keydown((event)=>{
            if (event.keyCode == 8 && input_elem.css('background-color') == 'rgb(229, 115, 115)') {
                event.stopPropagation();
                input_elem.blur();
            }
        });
    });
})();