as a followup to what @bloigge did in this topic, I made a minor upgrade to 3.1.3 plus added some of my nodes for other purposes and extended the settings with a few more options - can be viewed here. The code can be forked and modified at will (I started with what @bloigge did).
Unfortunately Stackblitz requires many tweeks and checkboxs until it works but then it does really work well - chromium based browsers are generally supported - I use Firefox.
Secondly the in-browser Node-RED is actually broken, at least in my Firefox. The problem appears to be an TypeError upon initialisation (as seen in my developer console):
Uncaught TypeError: n.head.appendChild(...).parentNode is null somewhere in the appendConfig function. It happens each time on initialisation and has the consequence that the inject node is empty:
Also custom sidebar nodes have no UI, i.e., are also blank when opened in the sidebar. The error occurs twice, once when appendNodeConfig is called and once when appendPluginConfig is called. It would be nice if someone can confirm this or whether this is my browser.
And generally to have a working instance of Node-RED in the browser is great way to show others how Node-RED works.