forked from jabbany/CommentCoreLibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWorker.js
More file actions
32 lines (26 loc) · 1022 Bytes
/
Worker.js
File metadata and controls
32 lines (26 loc) · 1022 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var __OOAPI;
importScripts("OOAPI.js");
if(!__OOAPI){
console.log("Error: OOAPI Not Loaded");
self.close();
};
/** Hook independant channels, channel will not be deletable **/
__OOAPI.createChannel("::eval", 1, Math.round(Math.random() * 100000));
__OOAPI.createChannel("::debug", 1, Math.round(Math.random() * 100000));
/** Load the BSE Abstraction Runtime **/
importScripts('api/Runtime.js', 'api/ScriptManager.js', 'api/Player.js', 'api/Display.js', 'api/Tween.js', 'api/Utils.js','api/Global.js', 'api/Function.js');
/** Immediately Hook into the eval channel, blocking future hooks **/
__schannel("::eval", function(msg){
if(Tween && Tween.extendWithEasingFunctions){
Tween.extendWithEasingFunctions(this);
}
var clearTimeout = Utils.clearTimeout;
var clearInterval = Utils.clearInterval;
eval(msg);
});
__schannel("::debug", function(msg){
if(msg.action === "list_channels"){
__achannel("::worker:debug", "worker", __OOAPI.listChannels());
}
});
__achannel("::worker:state", "worker", "running");