// ==UserScript== // @name 1111 // @namespace https://www.tuziang.com/combat/2212.html // @version 0.1 // @description 11111 // @author Tuziang // @match *://*.chinaredstar.21tb.com/* // @run-at document-end // @license MIT // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; var scriptContent = 'function okPlay() {\ if (info.scoId === undefined ) {\ return;\ }\ if (info.courseStandard =="SCORM12") {\ var scormObject = scormProcessor.init();\ scormObject.isLMSInitialized = true;\ scormObject.scoDataManager.core.lesson_progress.value = 100;\ scormProcessor.LMSFinish(info.courseId, info.scoId, scormObject, "");\ } else {\ var sourceUrl = "html/courseStudyItem/courseStudyItem.learn.do";\ $.ajax({\ type: "POST",\ url: CONFIG.ctx + sourceUrl + "?host=" + CONFIG.hostDomain + "&vbox_server=" + "&fromNetWorkSetting=false" + "&chooseHttp=" + document.location.protocol + "&courseType=NEW_COURSE_CENTER",\ data: "scoId=" + info.scoId\ + "&location=1",\ async: false,\ success: function (d) {\ var aLength = $("#courseItemId .cl-catalog-item .cl-catalog-item-sub a:visible").length;\ var aleadyPlay = $("#courseItemId .cl-catalog-item .cl-catalog-item-sub .cl-catalog-icon:visible").length;\ console.log("aLength:" + aLength);\ console.log("aleadyPlay:" + aleadyPlay);\ if (aLength != aleadyPlay) {\ document.location.reload();\ }\ },\ error: function () {\ }\ });\ }\ }\ $(function(){\ $("body").attr("onload","setTimeout(okPlay, 1000);")\ });'; })();