Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend browser support. #1

Open
dbuenzli opened this issue Aug 8, 2016 · 13 comments
Open

Extend browser support. #1

dbuenzli opened this issue Aug 8, 2016 · 13 comments

Comments

@dbuenzli
Copy link
Owner

dbuenzli commented Aug 8, 2016

For now the full browser reload strategy is only supported on osx with chrome and safari. Help for extending support along the documentation is welcome.

  • macosx support for firefox and other browsers
  • linux support beyond xdg-open
  • windows everything.
@apatil
Copy link

apatil commented Nov 19, 2017

@dbuenzli a slightly different approach in https://github.com/apatil/ocaml-webview should be cross-platform, at least in theory. Would that address the use case for which you wrote this library, or do you need a full-featured browser with forward and back buttons etc.?

@dbuenzli
Copy link
Owner Author

dbuenzli commented Nov 19, 2017

No. I want that to open/reload in the user's browser.

@apatil
Copy link

apatil commented Nov 19, 2017

Got it.

@Chris00
Copy link

Chris00 commented Oct 6, 2018

I think this approach should be used.

@dbuenzli
Copy link
Owner Author

dbuenzli commented Oct 6, 2018

I think this approach should be used.

That doesn't allow you to reload arbitrary pages. You need to have the script on your page.

@Chris00
Copy link

Chris00 commented Oct 6, 2018

Right. You have to send a local page with the script <iframe src="URI" mozbrowser remote>.

@Chris00
Copy link

Chris00 commented Oct 6, 2018

I suppose something similar is possible for other browsers.

@Chris00
Copy link

Chris00 commented Oct 7, 2018

Generating the page wrapper also allows us to programmatically choose the port (since it must be in the web page) and also have a single websocket server for several URL (each page connecting to a different path on websocket server) that could automatically die if there are no connections for a given time from both applications and web pages.

@Chris00
Copy link

Chris00 commented Oct 7, 2018

I forgot to point to the Firefox documentation.

@Chris00
Copy link

Chris00 commented Oct 7, 2018

I suppose JS could also reload the whole page using document.location.reload(true); — that should work on Chrome and Edge too.

@dbuenzli
Copy link
Owner Author

dbuenzli commented Oct 7, 2018

I'm not sure exactly how it can achieve what it's doing now (which is to reload any tab you might have in your browser) also TBH that feels like killing a fly with an atomic bomb.

@Chris00
Copy link

Chris00 commented Oct 7, 2018

how it can achieve what it's doing now (which is to reload any tab

It can't reload any tab (because that requires browser scripting which does not seem to be readily available — short of writing a browser plugin) but it can reload tabs that were opened through the library, which is usually what one wants (it's not bad not to touch existing tabs).

that feels like killing a fly with an atomic bomb.

I agree and there may be other solutions but, in the absence of browser scripting, I guess they will involve JS talking to a small local server — maybe one can use a simpler one than a websocket.

@Chris00
Copy link

Chris00 commented Oct 7, 2018

Note that livereload uses the above technology to reload tabs when the underlying file is updated, so I'm not very confident there is a much simpler solution...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants