Running a browser with the puck

Posted on
  • Is it possible to have a screen that opens like a frameless chrome that you can talk to from the puck and interact with? like having access to the window object of a chrome that is running in the puck and visible in a screen.

    i know this sounds ridiculous, but how could one approach this idea?

  • Mon 2019.07.29

    I accidentally put the WebIDE into a state this past weekend, while rapidly typing in input, with an unknown finger f'd sequence that seems to be what you describe, a resizeable frameless view. Took a considerable amount of time to figure out what I did to accidentally get there, as one has to get out of the mode first, as the close button disappears, before learning how to get in to it!!

    I've since learned it is WebIDE Ctrl+F    For $10 (worth every penny) I'll explain how to get out of it.    ;-)

    Hint: DO THIS BEFORE entering the above cmd. See: WebIDE >> Settings >> About

    or, are you attempting to do the work with a rendered Html page, which could be accomplished with Javascript within a Html page and launching a new Window instance that way?

    Clarification EDIT:
    The 'which' in the sentence above refers to launching an Html page frameless Window using Javascript that would run the Puck.js page. That page would however need to be served from a remote server, like GitHub as Ollie describes below, as the 'https' protocol is required.

  • You should expand on what you want to do here, and maybe why.

    You "could", write a html/css/js page that talks to puck over web bluetooth. With some kind of application server, you could also get that to open in its own chrome window - or you might go the Electron route. This would not run on the Puck however, that isn't possible.

    Here's an example of web bluetooth interaction with Puck, you can view the source js and that could give you a steer.­cker/

  • Mon 2019.07.29

    Nicely done example @Ollie. I was about to suggest it be used in a 'Projects' example, as I hadn't come across this before. But, I see you were the first contributor to that exact forum, 3 years ago already!!­474/

  • What I meant was maybe a bit far fetched. But id like to build an app with a la Electron but then I want to be able to run that app in the puck and interact with it with buttons and pots and things from the physical world. I understand that I could have a site and talk to it through Web Bluetooth, but I was wondering if I could use puck as a computer running a browser hehe.

    Maybe this is more suitable for a RPi?

  • The Puck has its own JavaScript engine, so you could think of the Puck as running a Web Browser without a window.

    So if you're asking 'can I run code on the Puck itself and interact with it with buttons/pots/etc' then absolutely - that's pretty much what it's meant for.

    If you want the Puck itself to display/render a webpage via some external screen (or into an offscreen buffer) then I'm afraid that's not going to work - but it may well be that you can use the PC for rendering to the DOM, but you do all the actual 'application logic' sort of stuff in the Puck.

  • Gotcha! What i wanted to do was the puck itself to display and render. :)

    Thanks for the help!

  • You could connect up an ESP8266 to provide the Wifi/Internet. You could then run a server on the puck with the http module I think

    See this post:­989/

    Alternatively, if you don't need Bluetooth - just Wifi, then Espruino Wifi, ESP32 and ESP8266 will all allow you to run webservers on them - you don't need to go the RPi route.

  • @Ollie, I think @user101989 wants to render html on some puck attached/driven display. Quite a challenge..., especially since html is probably the worst to handle, since by its history - and XHMTL 1.0 / html 4.0 failure -it has to handle what ever was valid since Web came along. May be a simplified Mosaic implementation / Line browser renderer could do something here (it can be pretty simple if html is well-formed / valid xml - and has practically no tag attributes... as long as the html sent to this simplified renderer is under control of @user101989).

  • @allObjects is right! I want to make me like a portable web browser with a physical interface all run by puck

  • But not necessarily connected to the internet, lol it sounds ridiculous but fun

  • Wed 2019.07.31

    Just found this using Electron. Might generate some ideas.

  • Thanks @allObjects. Totally missed it. You've saved me, and no doubt the OP, some time for sure. Appreciated:)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Running a browser with the puck

Posted by Avatar for user101989 @user101989