dev-ui
dev-ui copied to clipboard
Open a browser shell instead of a tab
Bug or a feature
feature
Describe the current situation
We open a browser tab, which is nice, but can be confusing to reach to from within browsing if you have a lot open
How should it be changed
- Get the default browser on the system (with
x-default-browserfor example) - try to spawn a window with as little window chrome as possible
I've heard Windows treats PWAs as apps, so that might be useful
This was my quick hack with Chrome content shell:
diff --git a/bin/dev-ui.js b/bin/dev-ui.js
index 4f957c4..0c659d3 100755
--- a/bin/npm-ui.js
+++ b/bin/npm-ui.js
@@ -2,10 +2,15 @@
const micro = require('micro');
const getPort = require('get-port');
-const open = require('open');
+const execa = require('execa');
const app = require('..');
+const p =
+ '/Users/azz/Downloads/content-shell/Content Shell.app/Contents/MacOS/Content Shell';
+
getPort().then(port => {
micro(app).listen(port);
- open(`http://127.0.0.1:${port}`);
+ execa(p, ['--content-shell-hide-toolbar', `http://127.0.0.1:${port}`]);
});
We should probably have it as an option instead of default, and publish content shell on npm as a dependency?
I just discovered that if you have chrome installed you can run it with the argument --app=http://localhost:3000 and it will launch without any interface