mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
JSO: make global objects available in WebWorker contexts (no hardcoded window)
This commit is contained in:
parent
6ac598b927
commit
7f333cc73e
|
@ -190,9 +190,9 @@ public abstract class Window implements JSObject, WindowEventTarget, StorageProv
|
|||
@JSProperty
|
||||
public abstract double getDevicePixelRatio();
|
||||
|
||||
@JSBody(params = "s", script = "return window.atob(s);")
|
||||
@JSBody(params = "s", script = "return atob(s);")
|
||||
public static native String atob(String s);
|
||||
|
||||
@JSBody(params = "s", script = "return window.btoa(s);")
|
||||
@JSBody(params = "s", script = "return btoa(s);")
|
||||
public static native String btoa(String s);
|
||||
}
|
||||
|
|
|
@ -25,10 +25,10 @@ import org.teavm.jso.typedarrays.Uint8Array;
|
|||
import org.teavm.jso.typedarrays.Uint8ClampedArray;
|
||||
|
||||
public abstract class Crypto implements JSObject {
|
||||
@JSBody(script = "return window.crypto != null;")
|
||||
@JSBody(script = "return crypto != null;")
|
||||
public static native boolean isSupported();
|
||||
|
||||
@JSBody(script = "return window.crypto;")
|
||||
@JSBody(script = "return crypto;")
|
||||
public static native Crypto current();
|
||||
|
||||
public abstract String randomUUID();
|
||||
|
|
|
@ -34,8 +34,7 @@ public abstract class IDBFactory implements JSObject {
|
|||
return factory;
|
||||
}
|
||||
|
||||
@JSBody(script = "return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || "
|
||||
+ "window.msIndexedDB;")
|
||||
@JSBody(script = "return indexedDB || mozIndexedDB || webkitIndexedDB || msIndexedDB;")
|
||||
static native IDBFactory getInstanceImpl();
|
||||
|
||||
public abstract IDBOpenDBRequest open(String name, int version);
|
||||
|
|
Loading…
Reference in New Issue
Block a user