parent
3818428a8b
commit
78b74504cc
|
@ -1,3 +1,5 @@
|
|||
22120-arc
|
||||
|
||||
.*.swp
|
||||
|
||||
# Bundling and packaging
|
||||
|
|
10
src/app.js
10
src/app.js
|
@ -71,6 +71,7 @@ async function start() {
|
|||
const browsers = [{chromeOpen}, {vivaldiOpen}, {braveOpen}, {edgeOpen}];
|
||||
|
||||
if ( browserOpen ) {
|
||||
let shutOne = false;
|
||||
for( const status of browsers ) {
|
||||
const keyName = Object.keys(status)[0];
|
||||
if ( !status[keyName] || !status[keyName].length ) continue;
|
||||
|
@ -85,16 +86,17 @@ async function start() {
|
|||
const answer = await question(`Would you like to shutdown ${openBrowserCode} browser now (y/N) ? `);
|
||||
if ( answer?.match(/^y/i) ) {
|
||||
await killBrowser(openBrowserCode);
|
||||
shutOne = true;
|
||||
} else {
|
||||
console.log(`OK, not shutting it!\n`);
|
||||
if ( browserOpen ) {
|
||||
process.exit(0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
await killBrowser(openBrowserCode);
|
||||
}
|
||||
}
|
||||
if ( !shutOne ) {
|
||||
process.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`Removing 22120's existing temporary browser cache if it exists...`);
|
||||
|
@ -118,7 +120,7 @@ async function start() {
|
|||
DEBUG.verboseSlow && console.info('Chrome launch error:', e);
|
||||
process.exit(1);
|
||||
}
|
||||
console.log(`Chrome started.`);
|
||||
console.log(`Browser started.`);
|
||||
|
||||
console.log(`Waiting 1 second...`);
|
||||
await sleep(1000);
|
||||
|
|
|
@ -410,6 +410,7 @@
|
|||
}
|
||||
|
||||
function neverCache(url) {
|
||||
if ( ! url ) return true;
|
||||
try {
|
||||
url = new URL(url);
|
||||
return url?.href == "about:blank" || url?.href?.startsWith('chrome') || NEVER_CACHE.has(url.origin);
|
||||
|
|
|
@ -16,7 +16,7 @@ export const DEBUG = {
|
|||
export const SHOW_FETCH = false;
|
||||
|
||||
if ( DEBUG.debug ) {
|
||||
console.log({APP_ROOT});
|
||||
console.log({__ROOT});
|
||||
}
|
||||
|
||||
// server related
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import sea from 'node:sea';
|
||||
import http from 'http';
|
||||
import https from 'https';
|
||||
import fs from 'fs';
|
||||
|
|
Loading…
Reference in New Issue