Skip to content

Instantly share code, notes, and snippets.

@Steve-xmh
Created April 15, 2023 06:36
Show Gist options
  • Save Steve-xmh/b6be0405f35082b3f562ef17ec367792 to your computer and use it in GitHub Desktop.
Save Steve-xmh/b6be0405f35082b3f562ef17ec367792 to your computer and use it in GitHub Desktop.
PTA 强制解除粘贴限制 用户脚本
// ==UserScript==
// @name PTA 强制解除粘贴限制
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 用来线下输入然后线上直接粘贴提交,该敲的代码还是得敲
// @author SteveXMH
// @match https://pintia.cn/problem-sets/*/exam/problems/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=pintia.cn
// @grant none
// ==/UserScript==
(function () {
'use strict';
const original = EventTarget.prototype.addEventListener;
EventTarget.prototype.addEventListener = function (type, listener) {
if (type === "input" && listener.toString().includes("粘贴")) {
return;
}
original.call(this, type, listener);
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment