Weird bug

Nice
good
OK
This commit is contained in:
Cris Stringfellow 2024-08-01 01:07:13 +08:00
parent 3818428a8b
commit 78b74504cc
No known key found for this signature in database
5 changed files with 11 additions and 5 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
22120-arc
.*.swp
# Bundling and packaging

View File

@ -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);

View File

@ -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);

View File

@ -16,7 +16,7 @@ export const DEBUG = {
export const SHOW_FETCH = false;
if ( DEBUG.debug ) {
console.log({APP_ROOT});
console.log({__ROOT});
}
// server related

View File

@ -1,3 +1,4 @@
import sea from 'node:sea';
import http from 'http';
import https from 'https';
import fs from 'fs';