quarantiner
Version:
A script isolator that runs scripts inside a sandbox iframe
38 lines • 1.15 kB
TypeScript
export default class Sandbox {
private readonly iframe;
private readonly name;
private readonly globalObject;
private pendingSandboxeeSpecs;
private pendingSandboxeesPromise;
constructor(iframe: HTMLIFrameElement, name: string);
/**
* Fetches the inner document of the sandbox <iframe>.
*/
getContentDocument(): Document;
/**
* Fetches the inner window of the sandbox <iframe>.
*/
getContentWindow(): Window;
/**
* Fetches the value of a global from inside the sandbox.
*/
getGlobal(name: string): unknown;
/**
* Fetches the sandbox <iframe> DOM element.
*/
getIframe(): HTMLIFrameElement;
/**
* Fetches the unique name of the sandbox.
*/
getName(): string;
/**
* Fetches the promise for all currently pending sandboxee scripts,
* allowing external code to await any pending loads at a given point.
*/
getPendingSandboxeePromise(): Promise<Sandbox>;
/**
* Adds a script to be loaded inside the sandbox.
*/
loadScript(scriptSrc: string): Promise<Sandbox>;
}
//# sourceMappingURL=Sandbox.d.ts.map