dbuenzli / webbrowser

Open and reload URIs in browsers from OCaml
http://erratique.ch/software/webbrowser
ISC License
7 stars 2 forks source link

Possibly incorporate some ideas from file-driven-development #5

Open jordwalke opened 5 years ago

jordwalke commented 5 years ago

I created a package that is similar to this one but with the additional goal of never having to spin up a server merely to serve static resources locally (I don't want one more daemon/server to babysit). (You cannot make "ajax" requests to other files on disk without running a web server, or starting Chrome in this particular way).

https://github.com/jordwalke/file-driven-development

See the arguments that I pass to Chrome: --args --no-startup-window --no-first-run --user-data-dir=/tmp/" & tmpSandboxName & " --allow-file-access-from-files --silent-launch

I then maintain the processID so that I know not to create another Chrome instance with the file system sandbox relaxed. There should be exactly one with the sandbox relaxed.

It would be nice to consolidate efforts into one opam package.

dbuenzli commented 5 years ago

While I use this for single page webapps and documentation development, one of the main usage of this package is to open/refresh documentation to consult (e.g. odig doc PKG, topkg browse homepage, etc.).

This means that I really want the open/refresh to occur in the user's regular browser. Do I understand correctly that your approach entails creating at east one more Chrome instance ?

jordwalke commented 5 years ago

It does require creating one more chrome instance because there is no other way. Still I think it should be an option to even enable this sandbox relaxation which requires opening a new chrome instance if one is not already open with relaxed sandbox. I think I’m requesting an option not a replacement for the current default.