Improved typescript visualizer. Opens browser window in chrome appmode by default.
This commit is contained in:
@@ -43,7 +43,11 @@ export class ConnectionHandler {
|
||||
);
|
||||
},
|
||||
openInBrowser: async ({}) => {
|
||||
open(server.indexUrl);
|
||||
try {
|
||||
await launchChrome(server.indexUrl);
|
||||
} catch (e) {
|
||||
open(server.indexUrl);
|
||||
}
|
||||
},
|
||||
setPreferredDataExtractor: async ({ dataExtractorId }) => {
|
||||
if (this.watcher) {
|
||||
@@ -70,3 +74,13 @@ export class ConnectionHandler {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
import chromeLauncher = require("chrome-launcher");
|
||||
|
||||
async function launchChrome(url: string): Promise<void> {
|
||||
const chrome = await chromeLauncher.launch({
|
||||
startingUrl: url,
|
||||
// `--window-size=${width},${height}`
|
||||
chromeFlags: ["--app=" + url],
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user