* cdp: add internal close api * inject: add Window.close() api * typedef: add Window.close() * roadmap: add close api for 0.8.0 * release: 0.8.0 * readme: update project age * paths: add more linux browsers * readme: update screenshot * readme: move trying gluon to earlier up * inject: add useSessionId to Window.cdp.send() * typedef: add useSessionId to CDPApi.send() * idle: rewrite to use CDP to get processes instead of exec * index: remove now unneeded parameters for idle creation * chore: bump version to 0.9.0-alpha.0 * inject: pass IPC browser engine * api: add Window.versions * typedef: add future BrowserEngine and update Browser values * typedef: add Window.versions * index: rename internal variable * idle: v2 - added sleep, utils, documenting, and more * typedef: update for IdleApi v2 * roadmap: update * chore: bump version to 0.9.0-alpha.2 * readme: add more feature specific statuses * readme: make specific feature statuses into a table * cdp: return protocol errors * idle: move to new api dir * controls: new Window.controls API * darwin: full support (#4) * meta: add pnpm-lock.yaml to .gitignore for my own sanity * darwin: preliminary support * chore: disable menubar key in firefox * Add support new browsers Mac OS (#20) Co-authored-by: a.artamonov <a.artamonov@sftpro.ru> * roadmap: tweak * roadmap: update done * roadmap: remove overall * typedef: change some voids to Promise<void>s * typedef: add Window.controls * release: 0.9.0 * add .vscode to gitignore * assets: new logo * readme: tweak features * readme: fancy header * readme: tweak description * paths>win: add alternate appdata paths * paths: add new browsers, refactor windows to auto append env * readme: update npm link * readme: fix license badge link * paths: add brave * chore: bump version to 0.10.0-alpha.2 * index: redo browser finding logging * index: rewrite data path gen (#6) * Added `.DS_Store` in .gitignore (#28) * `.DS_Store` Removed * Update .gitignore * roadmap: update * roadmap: add intended release date for 0.10 * launcher/inject: get browser info first, and always await * roadmap: update * cdp: make logging available via optional cli flag * chore: bump version to 0.10.0-alpha.3 * chore: update alpha version in package * inject: make eval return just result * inject: add window.loaded promise * ipc: add expose APIs * roadmap: update * gitignore: ignore gluon_data * inject: rename Window.window -> Window.page * typedef: rename Window.window -> page * typedef: add PageApi.loaded * typedef: add new IPC expose APIs * idle: minor cleanup * fix: hopefully remove all references to nodejs `process` * idle: add close handler (also move API creation into inject) * chore: bump version to alpha.5 * launcher: run Window.close on process close too * fix: firefox was still refering to node's `process` * gluworld: update to newest version from examples repo, fully convert to Deno * typedefs: fix errors that deno lsp was complaining about * release: v0.10.0 * deno: re-export src/index.ts in mod.ts to fit typical deno usage Co-authored-by: CanadaHonk <oj@oojmed.com> Co-authored-by: Beef <beefers@riseup.net> Co-authored-by: Alexander Artamonov <47431914+artamonovtech@users.noreply.github.com> Co-authored-by: a.artamonov <a.artamonov@sftpro.ru> Co-authored-by: Mantresh Khurana <120998049+mantreshkhurana@users.noreply.github.com>
40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
import * as Gluon from '../mod.ts';
|
|
|
|
const __dirname = new URL(".", import.meta.url).pathname;
|
|
|
|
const dirSize = async dir => {
|
|
const files = Array.from(await Deno.readDir(dir, { withFileTypes: true }));
|
|
|
|
const paths = files.map(async file => {
|
|
const path = `${dir}/${file.name}`;
|
|
|
|
if (file.isDirectory()) return await dirSize(path);
|
|
if (file.isFile()) return (await Deno.stat(path)).size;
|
|
|
|
return 0;
|
|
});
|
|
|
|
return (await Promise.all(paths)).flat(Infinity).reduce((acc, x) => acc + x, 0);
|
|
};
|
|
|
|
(async () => {
|
|
const browsers = Deno.args.slice(1).filter(x => !x.startsWith('-'));
|
|
|
|
if (browsers.length > 0) { // use argv as browsers to use
|
|
for (const forceBrowser of browsers) {
|
|
await Gluon.open(new URL(`file://${__dirname}/index.html`).href, {
|
|
windowSize: [ 800, 500 ],
|
|
forceBrowser
|
|
});
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
const Browser = await Gluon.open(new URL(`file://${__dirname}/index.html`).href, {
|
|
windowSize: [ 800, 500 ]
|
|
});
|
|
|
|
// const buildSize = await dirSize(__dirname);
|
|
// Chromium.ipc.send('build size', buildSize);
|
|
})(); |