Are there any options that are close to an HTML rendering engine and JavaScript engine that can be used to build an application apart from a “full/real” browser? I do not need it to connect to the internet at all, apart from my little local application-specific Tcl server or through some other channel/socket that does not have to use HTTP protocols but can.
I see that there is a Qt option that is built from the chromium framework but I don’t think I’d like that. It appears that the Webkit port WPE is in the official repository but I don’t quite understand what it is from reading their web site. It sounds like what I’m looking for but also sounds miles over my head and skill level.
My application works with a browser, now, but it seems a little stupid at times in that I’m passing data locally from SQLite via a Tcl socket (connected as a web socket and HTTP) to a browser and then caching it or making a blob url in the browser to use it as a source for image/audio/PDF. It seems like an unnecessary layer.
I don’t want an embeddable browser to offer internet browsing within my application but would like something that renders HTML and handles JS for user interaction to serve as the GUI for my application in a top-level window. If I need to connect to a server (to check for an update or new resource) that can be done through Tcl directly.
Tcl claims to be the glue that can connect other applications together and it appears that if I could just get Tcl to “talk” to a rendering engine and JS engine apart from a browser, my application would be safer for the user and perhaps a bit more efficient.
Regarding safety, I use a separate Firefox profile when running the application (which is started programmatically using the off line and private flags) and was looking through the cache to try to determine whether blob urls are stored only in memory or also on disk in the cache and noticed a number of merchant icons in the cache loaded in the previous few minutes. The machine was connected to the internet but that profile was set as work offline and is always set that way. Every setting available is turned off or set to as strict as possible. I also have never visited those merhcnat’s site under any profile. How did they get loaded into the cache under that profile? I’m not expecting an answer to that question but am just having a rant that it’s hard to trust a browser and would like another cross-platform option.
Thank you for any guidance you may be able to provide.
And why would that be? You may dislike Google but chromium is a very good framework for such projects.
just saying: electron? don’t rain on me, tomatoes and what not for suggesting electon but I think that is exactly what you are looking for.
It can stay completely local to your system. How it interacts with the outside is defined by you as the developer.
If you don’t like electron you can use node.js (which is based on Googles V8 javascript engine)
Node.js is a cross-platform, open-source JavaScript runtime environment that can run on Windows, Linux, Unix, macOS, and more. Node.js runs on the V8 JavaScript engine, and executes JavaScript code outside a web browser. According to the Stack Overflow Developer Survey, Node.js is one of the most commonly used web technologies. Node.js allows developers to use JavaScript for writing command line tools and server-side scripting.
– Node.js - Wikipedia
– https://v8.dev
Thank you for responding. I recall looking at these before, around two years ago.
Then I think it was claimed that Electron required 50 MB to write Hello World and was rather bloated; but I don’t know, I never tried it.
I use node.js sometimes to test things but don’t you still need a GUI? There is NodeGui which appears to require that you use Qt widgets via a Node wrapper rather than HTML. I have over 2 MB of JS code that builds the UI programmatically rather than using an HTML string and would not want to rewrite that using widgets and change the event handling structure.
The CEF sounds like the most preferrable option for my scenario of the three but I have to read much more. Supposedly Tcl can make a starkit that packages everything together (apart from a large SQLite database) such that the user does not need to have Tcl, SQLite, or any other dependencies installed. You just have to build the executable for each platform. If that can somehow work with an embedded browser, especially if the user does not have to install anything new, that might be a good option. I’m still unclear also what is meant by embeddable—is it compiled into part of my program like the SQLite C code amalgamation file is compiled into once C code; or is still a separate application?
As I understand - you need an interface which can read JavaScript, parse it and display the interface dynamically as HTML, right?
In my world that translates to a small JavaScript capable browser of some sort.
If I understand correctly, you want to strip it down to the most basic components preferably the most simple browser, with the requirement that it should not connect to the internet without consent.
The last one is difficult, given the nature of a browser.
In AUR there is custom package for the webui project.
The project initially used the installed browser as display engine, but has grown to be able to run standalone.
pamac search ^webui --aur
Only you can judge if it may be suitable for your purpose.
Thank you for taking the time to provide these links. I apologize for an unclear question. I’ll look these over.
@Alinux-aarhus Sorry for the terse response, it was 5 AM here and I hadn’t slept yet.
I looked over these and WebUI reminds of something called Entice https://www.tcl-lang.org/community/tcl2007/papers/Steve_Landers/Entice.pdf that someone sent me a PDF of a couple years ago (for “inspiration” as they put it), which was a Tcl project from 2007 that was reparenting a Firefox browser in a Tk top-level window. Today’s web sockets would probably have made Entice a bit easier for them.
I’m not suggesting that it exists or is currently possible (although chromium embedded framework might be similar and maybe WPE) but what would be helpful is to open the rendering and javscript engines in the Tk window and leave out the rest of the browser, apart from some communication channel with Tcl.
The Entice program somehow determined which process id was Firefox and reparented it. I don’t think it is maintained any longer and I couldn’t figure out how to do that, or why it would be a single process.
So, I opened the browers using the command line flags from within Tcl using its exec ... & command. Chrome (at least Brave) has the desktop application mode which isn’t a Tk window but, in that scenario, I don’t need to use Tk at all. Firefox dropped their app mode but I found an example where you add a folder named “chrome” with a userChrome.css file that sort of removes the browser’s chrome; and you have to set a legacy item in about:config.
I think many of the tools related to this type of thing try to provide everything apart from the HTML/CSS/JS. I’ve already built the back end in Tcl and SQLite and was just frustrated with the separation between it and the front end.
I was most likely just complaining when I shouldn’t have. In one sense, it’s pretty nice that a user could have the Tcl server open their default browser to a new tab and use the application while still browsing the web. Or use the flags and open the browser to appear as a separate application; and a user could always turn off functionality in a separate profile using about:config. So, really nothing to complain about. Thanks again; I didn’t know that some of these programs even existed.