webrepl icon indicating copy to clipboard operation
webrepl copied to clipboard

webrepl: Use HTML5 application cache and add favicon

Open zsquareplusc opened this issue 8 years ago • 3 comments

With these changes, one can load the page once with the browser, it will cache the application and later when connected to the e.g. ESP board, it is possible to use the page even if the original place is not reachable anymore.

You can also "add link to start page" on mobile devices and use it like an app (*).

For this to work you also need to publish the page, which github makes easy for you, just put a copy of the master branch into the gh-pages branch and it will be accessible under http://organization.github.io/repository

You can see the result of gh-pages for my fork here: https://zsquareplusc.github.io/webrepl/

(*) On my device (Chrome on Android) I had to ensure that only WIFI has a connection and no data connection was possible trough the mobile network, otherwise it would try to use the wrong network interface for the websocket. Also the term.js seems to have some quirks on small screens (e.g. rotating screen, show/hide keyboard) and input does not show up immediately. But it is working to execute commands. I'll leave fixing those to others...

zsquareplusc avatar Apr 12 '16 21:04 zsquareplusc

Thanks for the patch and sorry for late reply! WebREPL client is intended to be used in 2 modes: 1) hosted on http://micropython.org/webrepl , there's own favicon and redirection logic there; 2) locally on user's machine or host; proper naming is important here, likewise the minimal size.

HTML structure was at least partially fixed, it was inherited from upstream project's demo code and indeed, it's funny that it's broken. You may want to submit that patch upstream.

html5 manifest may be interesting feature when the client becomes stable, and can be support hazard otherwise, e.g. we issued update, something somewhere glitched, user doesn't get the updates, noone knows what happens, and there's zero visibility into that stuff. WebREPL is already a webapp, user installs it with git clone, updates with git pull, and enjoys complete control.

Also the term.js seems to have some quirks on small screens (e.g. rotating screen, show/hide keyboard) and input does not show up immediately. But it is working to execute commands. I'll leave fixing those to others...

That's true, I for example found that paste barely worked at all, and had to patch it in, learning another batch of creepy stuff about the modern browsers. And that's the area where help would be welcome (should be also shared with upstream project, alas, I didn't have a chance to post even the current changes so far).

pfalcon avatar May 14 '16 16:05 pfalcon

@pfalcon: the patch allows to use webrepl on mobile devices if the board is in AP mode.

That would be nice to have if the board cannot be in station mode (because it is mounted somewhere remote). Using an offline mobile webapp to access the board might be an intuitive way to configure it.

Maybe once the websocket client is stable this can be reevaluated?

hoihu avatar May 14 '16 18:05 hoihu

@hoihu : Did you test it? Does it work? On which devices? With which OS versions? With which browsers? Will you be around to help if someone has issues?

pfalcon avatar May 14 '16 18:05 pfalcon