Episode: 162 Title: HPR0162: Webkit Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr0162/hpr0162.mp3 Transcribed: 2025-10-07 12:36:46 --- Good night. I mean the way we decided this topic was because we were like okay so how are we gonna come together to a topic and then we realized that we both have internal issues and we both have the same issues so we were just browsing through the magazine and says like hey this sounds important let's talk about the same topic but now that you're we're three we can can I guess we evaluate what topic we want to talk about. What would you use WebKit for that and besides having a browser? In the article it tells you some examples of applications using it. A couple of them I didn't know what they were, ADM, colliquely, and then MSN Messenger, MacOS 10th dashboard, the iPhone uses it. So far we of course uses it Conquer. So the MSN Messenger actually uses HTML to display stuff? That's what MSN Messenger uses it. It doesn't really say what it used it for but I you know didn't get that out of the article just kind of said that it used it. Now yeah so basically you would use it like okay you see the browser right there but you you can use the engine as a component to your application. Now the future supposed to be is that well you can't draw instead of actually drawing all these interface within your application window. Let's say you have let's say you want to create an application but you know I best up application but you know mostly PHP or HTML or SVG or JavaScript or something. So just I guess web languages. So while you will do it so you will create your application, your window or the application let's say on Glade or let's say on Qt Composer or whatever and you'll create your window and in that window you will just drop WebKit and once WebKit is in you will say WebKit load this page on the land and then on the land you will have instead of drawing all these widgets inside the of the desktop application you will have to do it in HTML. So what that makes is that makes really a quick and easy collage of using HTML to draw whatever thing inside the window and the rest it will be and just just use the window huckle to call it the icon set and all those kind of stuff on a desktop app. Does that make sense? Yeah so can you put JavaScript inside of it and then CSS? Exactly, right. Are you going to do it on the server? You can just say WebKit will load the WebKit component and the WebKit component will statically load your application that resides on server. So all your HTML or your PHP or all that stuff it will be on the server and it will just inside that window you will have all your HTML widget tree and whatever. So that makes it really easy for you to generate interfaces dynamically. But then again you have to ask yourself what's the point? I mean I can just send them to URL that can do a dot from there. I guess the point is that you can merge it so you can send the information from the web or from whatever is displayed on the WebKit and send the two other components on the desktop. What I was asking was, Mario, can you like you client-side JavaScript inside like here? How do you interact? Is that how you interact with like UT applications? That's a very interesting question. I think they mentioned on that document in the review. They mentioned that in the sense that they do that for the sidebar on the application they did. Did you open the PDF? Yeah, I'm looking at it now. Yeah, check the third image, the third image. And you see that there is, you see the issues on a QT widget and then you click on the QT widget and it will render that issue on the HTML widget, which is I guess the workspace. Yeah. So I guess that's why you get the best of both worlds, you get the HTML and then you get the desktop widget tree. Which I guess you can do also using in Firefox, you can do this thing in the tool. But the point of why not just use how HTML then? Because it's faster I guess. We just are a little bit faster then. I suppose then you have to do the back and forward buttons. Right. So I mean, it's an example. Actually, personally, I don't see that much use. Like you said, you can just do the whole thing in HTML. I guess just because it would look like an application on your desktop. It would be an icon on your desktop and you can put it on your menus, for example. So it won't be a bookmark. It will be an actual application residing on your system menu. And I guess for corporate software, that makes much sense. Better sense, I guess. Yeah. So you can still retain some functionality if the server goes down maybe? Right. And then you have the functionality of the grid. Now, for example, Ajax has done a lot trying to implement that grid. That grid that you can sort and you can make all these kind of things. On Qt, you have a very powerful grid component. So you can just load that HTML or that XML data in the grid. And you don't have to worry about making it like Excel, for example, because most people do that on Excel. But then again, it's like, how can you load pages and pages? You know what I mean? So all of a sudden, you have the grid which is from Qt and then people can sort it. They can manipulate the data, whatever. And you don't have to worry. Otherwise, you have to code the whole thing and get a spread. By the way, I think this is what we would be talking if we were doing an actual show. So you can see the code here. It's actually quite simple. I mean, most of the code is like, even if you don't know, because I don't know C++ either, at least I know it to code it, but I can read it. The only problem that I see, for example, is that you're not doing here any protocol calls. It's not like Ajax. You're scrapping web content out of regular expressions. I don't know. Do you have that service command? Chrishy. Yeah. So for example, although it's an example, I mean, you could, I guess this is just a way they did it just because it was easier. But I wonder why they don't have like the code number, because I would really want to show you a piece of code where they actually put some regular expressions. Actually, the function is called qregxp, you know? Yeah, issue. And then class equals data data? Actually, no. It's something like DID talks and then the whole regular expression thing. If you're an article? Yeah, it's a new article. It's around almost at the end of the article. If you search for it, not that we have an issue, is the command right above it? Table of contents? Yeah. So you see that TLC? Yeah. So it's DID, TLC, dashed this. And it's just basically a regular expression. And what I'm saying is like, even though that's fine, it doesn't look very elegant. It would be better just to co-component and select the note, you know, from your XML. That would be a TIN code. Otherwise, you have to do a lot of logistics, I guess. I guess, I think to do an application like this, I would probably create a restful web service. Exactly. And then just get back the XML and pass it. And use maybe a native library, a next-mile library, I guess. Yeah, I will probably do the same thing. It's usually the cleanest way, but I guess that wasn't on the angle of the article. So is there a way that you have to get the HTML for an external server or is it more set up so that you have just download the file and then load the file in? Well, the way I was reading this, I think they have the whole HTML component, like template already done on the application. And they just scrap the thumbnail and the information. And then they just loop it, you know? Yeah, I guess I've got it in front of me a bit. You think you could, if you just made it a restful service, you could cash the articles and only request so much that you need. Like, tell it, give it the last article that you've received and then get all the future articles. You know why this could be useful or how can this be useful? Instead of making calls, actually you can grab the whole thing and use it as an ebook reader. You know what I mean? It's kind of like that's comic application. I can't remember the one that downloads your comics from different sources. I was just a Linux application that it will read your comic, comic reader or something like that. And it will go up and grab all these strips of comics. What are you going to say? I haven't seen anything like that. The only one I've seen really is comics with an X. Oh, okay. I see comics now. Yeah, I think it's kind of like that. Comic book viewer, right? Yeah, it's a little bit like that. So it will just go and grab your scripts, your images from the web. But the thing is that you can actually, like an RSS, that you can save it on your database or internal database. You can just say, hey, just download the newest one. And I will read it when it's kind of like a podcast. You know what I mean? It will save it on your hard disk. So it's like publicly available ones, right? Yeah, so let's say it's kind of like what the Wall Street did with the viewer or the reader. Do you remember that? The Wall Street Journal launched a thingy for looking at their newspaper. So you will come up every day and I will say, hey, what's the end of the Wall Street Journal? We've downloaded and then you can view it on your application. And then it's yours. So yeah, it gets to be like that. It sounds like it will be fun to develop. Yeah, it actually gets to test out like a mobile device. No, it was just an application that they came up. And it was only Windows version. So it doesn't be great about it. There's another one, the comic viewer, this one is in Java. Yeah, so I guess that will be a merge between an example to merge the best of application with the web content. And you will actually use the rendering engine quite a bit because trying to do that just with your toolkit, it will be a pain. You have to load like an image component and then if you want more information, you will have to basically redefine the interface. For the desktop application, you mean? Yeah, but let's say you don't have that HTML good in it. And you want to, let's say that we're taking the example of the one, the Linus Journal one. And they say, oh, but you know what? I actually wanted like, I wanted to have a third button. You say email PDF and there's the other download PDF. I want a third icon there. So if you, well, you will have to go to the search scope again and probably that is not the best example because you can just drop a button there. But let's say something that is very HTML like, you want to graph it as the background, you know? It's kind of impossible to do it with the toolkit. You cannot just see the toolkit for that specific window. Well, in an HTML, it's really simple. You just had the CSS and you're done. How come it hasn't been done for the desktop applications? I mean, it has been done. I mean, that comic reader is an example that has been done. It's just that I guess that, well, for example, if you're talking about the magazine, like the external why they haven't done an Linux journal client is because, well, firstly, so the magazine and second, they want to increase the traffic on their website. I mean, the like, have an XML based window specification.