Greasy Fork

Greasy Fork is available in English.

破解超星作业和考试编辑器粘贴限制

破解超星作业和考试编辑器粘贴限制,基于https://github.com/zxf1023818103/enable-chaoxing-editor-paste修改而来。

// ==UserScript==
// @name         破解超星作业和考试编辑器粘贴限制
// @namespace    http://tampermonkey.net/
// @version      1.3
// @author       fcwys
// @compatible   chrome
// @compatible   firefox
// @compatible   edge
// @compatible   safari
// @description  破解超星作业和考试编辑器粘贴限制,基于https://github.com/zxf1023818103/enable-chaoxing-editor-paste修改而来。
// @license      MIT
// @match        *://mooc1*.chaoxing.com/mooc-ans/work/doHomeWorkNew*
// @match        *://mooc1*.chaoxing.com/mooc-ans/mooc2/work/dowork*
// @match        *://mooc1*.chaoxing.com/exam-ans/exam/test/reVersionTestStartNew*
// @match        *://mooc1*.chaoxing.com/work/doHomeWorkNew*
// @match        *://mooc1*.chaoxing.com/exam/test/reVersionTestStartNew*
// @grant        auto
// ==/UserScript==

var isFuck=false;
function pasteOK(){
  for (var editorName in UE.instants) { UE.instants[editorName].__allListeners.beforepaste = null }
  isFuck=true;
}

(function() {
  /*定时器轮询解决新版考试界面无效问题*/
  var pTimer=setInterval(function(){
    isFuck||pasteOK();
    isFuck&&clearInterval(pTimer);
  }, 500)
})();