Created
March 11, 2020 08:27
-
-
Save GroverChouT/a12486c32cd68e51c23cdcfc18b21637 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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