UNPKG

rock-mod

Version:

Rock-Mod is a powerful framework designed for creating and managing mods for Grand Theft Auto (GTA) games.

49 lines (48 loc) 1.05 kB
class RageBrowserHandle { constructor(url) { this._browser = null; this._browser = mp.browsers.new(url); } get isAlive() { return this._browser !== null; } destroy() { if (this._browser) { this._browser.destroy(); this._browser = null; } } execute(code) { if (this._browser) { this._browser.execute(code); } } setOrderId(orderId) { if (this._browser) { this._browser.orderId = orderId; } } } export class RageBrowserManager { constructor() { this._browser = null; } create(url) { this.destroy(); this._browser = this.createInstance(url); } createInstance(url) { return new RageBrowserHandle(url); } destroy() { if (this._browser) { this._browser.destroy(); this._browser = null; } } execute(code) { if (this._browser) { this._browser.execute(code); } } }