www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Browsers in D

reply Adam D Ruppe <destructionator gmail.com> writes:
I wrote a little blog about my browsers in D, with some 
discussion about how you might be able to embed them in your 
application too:

http://dpldocs.info/this-week-in-d/Blog.Posted_2023_12_18.html

With Firefox getting worse by the year, you might want to 
consider also making your own partially-usable chromium/edge skin 
(also known as "pukes")!
Dec 19 2023
next sibling parent reply Doigt <labog outlook.com> writes:
On Tuesday, 19 December 2023 at 21:15:19 UTC, Adam D Ruppe wrote:
 With Firefox getting worse by the year, you might want to 
 consider also making your own partially-usable chromium/edge 
 skin (also known as "pukes")!
Firefox is getting better, not worse. That's strictly your opinion.
Dec 19 2023
parent reply Adam D Ruppe <destructionator gmail.com> writes:
On Tuesday, 19 December 2023 at 22:42:16 UTC, Doigt wrote:
 Firefox is getting better, not worse. That's strictly your 
 opinion.
Firefox has a number of major problems: * They invested in Rust instead of D. * Its engine is not particularly embeddable. This means you're at the mercy of Mozilla's bad UI decisions. Something I was able to fix with the chromium engines with a simple url.addEventListener((DoubleClickEvent ev) { url.selectAll(); ev.preventDefault(); }); Has no solution for Firefox. This was a major strategic mistake on Mozilla's part: they could have been the base of countless tools and applications, but they ceded all this ground to their competition. * They don't even support "app mode", to open one page in a window with its own icon and minimal ui, which could be a potential substitute for using its engine as an API; you can spin up a local web server and spawn an instance of the browser to display things. But firefox has very little support for this use case. * The firefox engine has poor platform integration out of the box. Chrome's engine, on the other hand, works actually quite well in varied uses across platforms without requiring much custom code (they do break the X spec in places, but you can kinda tame that, you can see this in the source of the minigui_addons.webview module). Even if you could embed the firefox, it is possible it wouldn't work on your system anyway! It is a pity that Mozilla didn't take this use more seriously, but they didn't...
Dec 19 2023
parent reply Hors <q q.com> writes:
On Wednesday, 20 December 2023 at 00:00:24 UTC, Adam D Ruppe 
wrote:
 On Tuesday, 19 December 2023 at 22:42:16 UTC, Doigt wrote:
 Firefox is getting better, not worse. That's strictly your 
 opinion.
Firefox has a number of major problems: * They invested in Rust instead of D. [...]
Rust is better choice than D if you have to run code from untrusted resources (html, javascript, webassembly...) it's safer, plus faster.
Dec 19 2023
next sibling parent reply Anonymouse <zorael gmail.com> writes:
On Wednesday, 20 December 2023 at 06:29:30 UTC, Hors wrote:
 Rust is better choice than D if you have to run code from 
 untrusted resources (html, javascript, webassembly...) it's 
 safer, plus faster.
[citation needed]
Dec 20 2023
parent Sergey <kornburn yandex.ru> writes:
On Wednesday, 20 December 2023 at 08:17:20 UTC, Anonymouse wrote:
 On Wednesday, 20 December 2023 at 06:29:30 UTC, Hors wrote:
 Rust is better choice than D if you have to run code from 
 untrusted resources (html, javascript, webassembly...) it's 
 safer, plus faster.
[citation needed]
I would add *sarcasm* sign :)
Dec 20 2023
prev sibling parent Adam D Ruppe <destructionator gmail.com> writes:
On Wednesday, 20 December 2023 at 06:29:30 UTC, Hors wrote:
 Rust is better choice than D if you have to run code from 
 untrusted resources (html, javascript, webassembly...) it's 
 safer, plus faster.
That's not how it actually works in any of the browsers though. The code that implements those things is pretty universally C++, and the sandbox is provided through operating system resources instead of language features. In the blog example program, you saw that there must be a `Wv2App` (or `CefApp`) declared in main before doing anything else. That object might appear to do nothing, but it actually encapsulates a key part of the security sandboxing of the newer browser: that's responsible for spawning the worker processes for different jobs on different domains. This is also why there's so much message passing in the implementations - they can't see each other's memory directly!
Dec 20 2023
prev sibling next sibling parent reply Antonio <antoniocabreraperez gmail.com> writes:
On Tuesday, 19 December 2023 at 21:15:19 UTC, Adam D Ruppe wrote:

 With Firefox getting worse by the year, you might want to 
 consider also making your own partially-usable chromium/edge 
 skin (also known as "pukes")!
Really? It is my primary development browser. In fact, chromium has left me in the lurch more than once with its bugs (mainly with svg and resources memory management). Imagine a company with products based on svg (complex ones with a lot of user interaction) and a new version of chrome that fails managing mouse events in some circunstances... my company begun to receive emails/phone calls from our customers telling that "our software bug" was making them lose thousands of euros every hour. (Our company was a "personalization" service used by a lot of manufacturers eCommerce in Spain). It was not the first neither the last problem that a new version of chrome caused to our company: You can't say to a customer "tell your users to browse your ecommerce with Firefox or Safari" because Chromium dominates browsers market (it is a monopolistic control). I remember when reported a bug about canvas/images memory leak (Our software processed hundred of images directly on web)... we find the solution to assigning 0 to width/height... but the chromium bug remained YEARS until it was solved. It gives you the magnitude of what a monopolistic control signifies. Adam, I really heated Chrome... and I simply don't tolerate each new browser based on chromium. I consider it a giant error. "One ring to rule them all" Firefox protection is a must.
Dec 19 2023
next sibling parent Antonio <antoniocabreraperez gmail.com> writes:
On Tuesday, 19 December 2023 at 23:40:48 UTC, Antonio wrote:
 Really? It is my primary development browser. ...
I apologize for the tone of my last post. I consider that what it express does not fit the rules of this forum. If possible, I would like it to be removed by the moderator. Thanks in advance.
Dec 19 2023
prev sibling parent reply Adam D Ruppe <destructionator gmail.com> writes:
On Tuesday, 19 December 2023 at 23:40:48 UTC, Antonio wrote:
 It was not the first neither the last problem that a new 
 version of chrome caused to our company
Oh, I'm old enough to remember the Chrome auto-update that broke standard HTML links! It was such a pain supporting it in the first few years, while IE and Firefox were both working pretty well at the time. But, like I just said in the other post, Firefox has near-zero support for being embedded in other applications. If you know of a way that we could reasonably use from D, let me know, but the only time I've seen an embedded Gecko is actually in the Wine project... and this had no other way to access it that I could find.
 I remember when reported a bug about canvas/images memory leak 
 (Our software processed hundred of images directly on web)... 
 we find the solution to assigning 0 to width/height... but the 
 chromium bug remained YEARS until it was solved.
Mozilla has closed *dozens* of bugs that affect me directly as WONTFIX, including fairly simple to fix regressions. That's why I can't use it anymore.
 Adam, I really heated Chrome... and I simply don't tolerate 
 each new browser based on chromium.
If you wanna work on my other engine to bring it up to spec, feel free lol, but the screenshots speak to the functionality gap...
Dec 19 2023
parent reply Paolo Invernizzi <paolo.invernizzi gmail.com> writes:
On Wednesday, 20 December 2023 at 00:07:44 UTC, Adam D Ruppe 
wrote:
 On Tuesday, 19 December 2023 at 23:40:48 UTC, Antonio wrote:
 [...]
Oh, I'm old enough to remember the Chrome auto-update that broke standard HTML links! It was such a pain supporting it in the first few years, while IE and Firefox were both working pretty well at the time. But, like I just said in the other post, Firefox has near-zero support for being embedded in other applications. If you know of a way that we could reasonably use from D, let me know, but the only time I've seen an embedded Gecko is actually in the Wine project... and this had no other way to access it that I could find.
 [...]
Mozilla has closed *dozens* of bugs that affect me directly as WONTFIX, including fairly simple to fix regressions. That's why I can't use it anymore.
 [...]
If you wanna work on my other engine to bring it up to spec, feel free lol, but the screenshots speak to the functionality gap...
When I was the CTO of my previous company, we embedded Gecko into a custom C++ GUI framework, to allow ALS people browse the web using gazes as an input method: it was a real pain ...
Dec 20 2023
parent reply Adam D Ruppe <destructionator gmail.com> writes:
On Wednesday, 20 December 2023 at 09:29:36 UTC, Paolo Invernizzi 
wrote:
 When I was the CTO of my previous company, we embedded Gecko 
 into a custom C++ GUI framework, to allow ALS people browse the 
 web using gazes as an input method: it was a real pain ...
Wow, yeah, I know it must be possible, but I couldn't even figure out how to get started. Like I said, pity Mozilla didn't recognize this use case, I think they could have really done something with it. Microsoft and WebKit (both from its KDE days and now with Apple in charge of it) have both really done a nice job making their things easy to adapt.
Dec 20 2023
parent aberba <karabutaworld gmail.com> writes:
On Wednesday, 20 December 2023 at 14:24:45 UTC, Adam D Ruppe 
wrote:
 On Wednesday, 20 December 2023 at 09:29:36 UTC, Paolo 
 Invernizzi wrote:
 When I was the CTO of my previous company, we embedded Gecko 
 into a custom C++ GUI framework, to allow ALS people browse 
 the web using gazes as an input method: it was a real pain ...
Wow, yeah, I know it must be possible, but I couldn't even figure out how to get started. Like I said, pity Mozilla didn't recognize this use case, I think they could have really done something with it. Microsoft and WebKit (both from its KDE days and now with Apple in charge of it) have both really done a nice job making their things easy to adapt.
Lot's to say about Mozilla. There's the reason they've got that small market share. They lost focus on the real product they were offering
Dec 21 2023
prev sibling next sibling parent Hors <q q.com> writes:
On Tuesday, 19 December 2023 at 21:15:19 UTC, Adam D Ruppe wrote:
 I wrote a little blog about my browsers in D, with some 
 discussion about how you might be able to embed them in your 
 application too:

 http://dpldocs.info/this-week-in-d/Blog.Posted_2023_12_18.html

 With Firefox getting worse by the year, you might want to 
 consider also making your own partially-usable chromium/edge 
 skin (also known as "pukes")!
Neither any browsers are good In firefox sometimes pages simply crashes without any error message, you have to close tab and open it again. In chromium sometimes caret becomes invisible, and page crashes the entire app becomes irresponsive. Also I find it funny how people tell they use firefox for privacy, yet firefox have telemetry on by default.
Dec 19 2023
prev sibling parent reply aberba <karabutaworld gmail.com> writes:
On Tuesday, 19 December 2023 at 21:15:19 UTC, Adam D Ruppe wrote:
 I wrote a little blog about my browsers in D, with some 
 discussion about how you might be able to embed them in your 
 application too:

 http://dpldocs.info/this-week-in-d/Blog.Posted_2023_12_18.html

 With Firefox getting worse by the year, you might want to 
 consider also making your own partially-usable chromium/edge 
 skin (also known as "pukes")!
I have this idea of building a web view based desktop app with a webserver and db backend for CRUD functionality. This looks like a great option.
Dec 21 2023
parent reply Adam D Ruppe <destructionator gmail.com> writes:
On Thursday, 21 December 2023 at 11:55:50 UTC, aberba wrote:
 I have this idea of building a web view based desktop app with 
 a webserver and db backend for CRUD functionality. This looks 
 like a great option.
Yeah, it is a solid choice with a long history. Did you know the Unix Printing System used to (I don't think it still does but im not sure) work this way? Some 15 years ago, it'd start up a local web server and you'd work with it through the browser. I do kinda wish that the common browsers supported connecting through a local unix socket, so you wouldn't have to allocate a port... but you don't really have to allocate a port anyway - you can let the OS give you a random available one then you see what it assigned you and pop open the browser. So it still works. Another interesting thing available nowadays is some programs will run a webview ui but also open a websocket server, allowing other websites to interact with it. With a websocket server, any random internet page is allowed to try to connect to it - yes, normal javascript is allowed to try to connect a websocket to localhost - and your server checks the `origin` header to see if it is a website you want to talk to. The Discord desktop client uses this, for example, to let their official sites detect the local client and ask if you want to "open link in app" (which i kinda hate lol but it does) and also to communicate some special features to it, like a discord website can show who is currently speaking in the voice to display on your web streams. (I know this cuz i hooked into it to make my own thing lol). But it is still a potential way to combine all these options for your users.
Dec 21 2023
parent aberba <karabutaworld gmail.com> writes:
On Thursday, 21 December 2023 at 22:29:03 UTC, Adam D Ruppe wrote:
 On Thursday, 21 December 2023 at 11:55:50 UTC, aberba wrote:
 [...]
Yeah, it is a solid choice with a long history. Did you know the Unix Printing System used to (I don't think it still does but im not sure) work this way? Some 15 years ago, it'd start up a local web server and you'd work with it through the browser. [...]
Interesting. Security and privacy on the web is an illusion.
Dec 22 2023