Skip to content

Instantly share code, notes, and snippets.

@GroverChouT
Created March 11, 2020 08:27
Show Gist options
  • Save GroverChouT/a12486c32cd68e51c23cdcfc18b21637 to your computer and use it in GitHub Desktop.
Save GroverChouT/a12486c32cd68e51c23cdcfc18b21637 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Superstar Flash Disabler
// @namespace superstar-flash-disabler
// @version 0.1
// @description Disable Falsh Player on Superstar online course system by not using danmaku
// @author Grover Chou
// @match https://*.chaoxing.com/mycourse/studentstudy*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var frameElement = null;
var frameElementCatcher = setInterval(function(){
try {
frameElement = window.frames[0].frames[0].frameElement
} catch (error) {
// console.error(error);
}
}, 100);
var newDataSetter = setInterval(function(){
if (frameElement != null) {
clearInterval(frameElementCatcher);
var newData = frameElement.getAttribute("data").replace(/"danmaku":1/, "\"danmaku\":0");
frameElement.setAttribute("data", newData);
clearInterval(newDataSetter);
}
}, 100);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment