dev-ui icon indicating copy to clipboard operation
dev-ui copied to clipboard

Open a browser shell instead of a tab

Open Haroenv opened this issue 8 years ago • 4 comments

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

  1. Get the default browser on the system (with x-default-browser for example)
  2. try to spawn a window with as little window chrome as possible

Haroenv avatar Jan 05 '18 14:01 Haroenv

I've heard Windows treats PWAs as apps, so that might be useful

Haroenv avatar Jan 05 '18 14:01 Haroenv

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}`]);
 });
screen shot 2018-01-06 at 1 00 16 am

azz avatar Jan 05 '18 14:01 azz

We should probably have it as an option instead of default, and publish content shell on npm as a dependency?

Haroenv avatar Jan 07 '18 16:01 Haroenv

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

ranfdev avatar Jan 07 '18 19:01 ranfdev