Can I code a web browser in a Pharo GUI window (Morphic or other)?
Hi, for a project I need this kind of program: 1. client side only 2. must be able to programmatically show a web browser in a window (Morphic??); only local content will be shown 3. must also be able to show other windows, containing simple games Now, I guess that 1 and 3 are possible straight away, but I am unsure about option 2. I found out that there are a few ways to do it: - using C#, which has: - standard web browser control out-of-the-box - third-party open source chromium web browser component - using Java, which (afaict) is a coding effort, but possible anyway That saiud, since I'd very much like to start using Pharo for more tasks (just starting) I wonder if Pharo has something to offer in this case. Many thx! /Arie
There was a thread about this two years ago. http://forum.world.st/Smalltalk-Internet-Browser-td4944879.html There is Scamper for Squeak, https://github.com/HPI-SWA-Teaching/Scamper It used to come standard in Squeak. When I knew it, it couldn't quite handle HTML 3.2. I imagine it was removed from Squeak (and SqueakMap) because it was quite impractical to keep up with the rapid changes in the web. It would be cruel to say that some browser engineers never saw a feature they didn't like; the truth often hurts. There is already something called tODE, which apparently can make Pharo tools visible in browser windows. That may be a better way to go. ST/X went to the trouble of including its own Javascript and JVM implementations, but of course JS changes quite rapidly too and is no longer the little language it was when introduced. Heck, the ECMAScript specification is bigger than the source code listing of the mainframe operating system I used as an undergraduate. We already have the tools needed to talk to WebKit; there is very little benefit to the Pharo team from pouring vast resources into duplicating what already exists. On Fri, 14 Jun 2019 at 19:46, Arie van Wingerden <xapwing@gmail.com> wrote:
Hi,
for a project I need this kind of program:
1. client side only 2. must be able to programmatically show a web browser in a window (Morphic??); only local content will be shown 3. must also be able to show other windows, containing simple games
Now, I guess that 1 and 3 are possible straight away, but I am unsure about option 2.
I found out that there are a few ways to do it:
- using C#, which has: - standard web browser control out-of-the-box - third-party open source chromium web browser component - using Java, which (afaict) is a coding effort, but possible anyway
That saiud, since I'd very much like to start using Pharo for more tasks (just starting) I wonder if Pharo has something to offer in this case.
Many thx! /Arie
Hi Richard, Op vr 14 jun. 2019 om 12:58 schreef Richard O'Keefe <raoknz@gmail.com>:
There was a thread about this two years ago. http://forum.world.st/Smalltalk-Internet-Browser-td4944879.html
Mmmm. Sounds not like a ready to use solution at all. Given the fact that I am a Pharo n00b it wouldn't be an easy way to go I guess. There is Scamper for Squeak, https://github.com/HPI-SWA-Teaching/Scamper
It used to come standard in Squeak. When I knew it, it couldn't quite handle HTML 3.2. I imagine it was removed from Squeak (and SqueakMap) because it was quite impractical to keep up with the rapid changes in the web. It would be cruel to say that some browser engineers never saw a feature they didn't like; the truth often hurts.
Same "problem" here I guess?
There is already something called tODE, which apparently can make Pharo tools visible in browser windows. That may be a better way to go.
This one? https://github.com/dalehenrich/tode/blob/master/repository/Tode-Client-Pharo... And what do you mean with "Pharo tools" here? ...
We already have the tools needed to talk to WebKit; there is very
little benefit to the Pharo team from pouring vast resources into duplicating what already exists.
Of course, I agree! Would you be so kind to point me to some docs about this? May I conclude that *maybe* "tODE" and "the tools needed to talk to WebKit" are the best ways to achieve my goal(s)? But, between the lines I read that it would be a rough way (for me at least), which would be a bit too rough for me as aa Pharo n00b. In C# I can do this literally in a few hours, given the fact that ready made components exist. So, maybe I'd better stick with that for this project and try my hands on a bit easier and smaller Pharo projects :-) Anyway, I really appreciate the help! Many thx! /Arie
On Fri, 14 Jun 2019 at 15:46, Arie van Wingerden <xapwing@gmail.com> wrote:
Hi,
for a project I need this kind of program:
1. client side only 2. must be able to programmatically show a web browser in a window (Morphic??); only local content will be shown 3. must also be able to show other windows, containing simple games
Now, I guess that 1 and 3 are possible straight away, but I am unsure about option 2.
I found out that there are a few ways to do it:
- using C#, which has: - standard web browser control out-of-the-box - third-party open source chromium web browser component - using Java, which (afaict) is a coding effort, but possible anyway
That said, since I'd very much like to start using Pharo for more tasks (just starting) I wonder if Pharo has something to offer in this case.
The easier path is probably to connect to Chrome externally... http://forum.world.st/Chrome-DevTools-Protocol-and-Pharo-td4947589.html http://forum.world.st/Pharo-Chrome-was-Soup-bug-fix-td5020666.html http://forum.world.st/Web-scrapping-with-Pharo-Chrome-td5066882.html A heavier path is integrating Chromium via FFI. This is probably the most feasible path to a fully functioning browser. Many web browsers are a wrappers around Chromium, letting it do all the heavy lifting. https://en.wikipedia.org/wiki/Chromium_(web_browser)#Browsers_based_on_Chrom... Pharo could do the same thing. Even Microsoft is doing this... https://www.theverge.com/2018/12/6/18128648/microsoft-edge-chrome-chromium-b... I've previously linked a small sub-part of Chromium with Pharo. https://blog.openinworld.com/2017/11/pharo-pdf-part-1/
In C# I can do this literally in a few hours, given the fact that ready made components exist.
Depends on how you can balance your particular goals and time constraints, wrt the effort of getting a connection versus the effort of processing the data you get out of it. https://imgs.xkcd.com/comics/is_it_worth_the_time.png cheers -ben
Hi Arie, Do you really need to code web browser, or is it acceptable to control a web browser from Pharo. This is what we do in PharoJS (http://pharojs.org <http://pharojs.org/>), for running tests. We also have a custom playground, so evaluate pharo expressions that are translated to javascript and executed by the web browser. Noury
On 14 Jun 2019, at 09:45, Arie van Wingerden <xapwing@gmail.com> wrote:
Hi,
for a project I need this kind of program: client side only must be able to programmatically show a web browser in a window (Morphic??); only local content will be shown must also be able to show other windows, containing simple games Now, I guess that 1 and 3 are possible straight away, but I am unsure about option 2.
I found out that there are a few ways to do it: using C#, which has: standard web browser control out-of-the-box third-party open source chromium web browser component using Java, which (afaict) is a coding effort, but possible anyway
That saiud, since I'd very much like to start using Pharo for more tasks (just starting) I wonder if Pharo has something to offer in this case.
Many thx! /Arie
At this time I'd say that PharoJS would probably my first choice to check out for such project in the future. Given my Pharo n00bness however I have decided to stick with C# for this project for now to avoid (too) long implementation times. But I'll definitely dive into the options you tell me about, specifically PharoJS. Thx to you all! /Arie Op vr 14 jun. 2019 om 14:57 schreef Noury Bouraqadi <bouraqadi@gmail.com>:
Hi Arie,
Do you really need to code web browser, or is it acceptable to control a web browser from Pharo. This is what we do in PharoJS (http://pharojs.org), for running tests. We also have a custom playground, so evaluate pharo expressions that are translated to javascript and executed by the web browser.
Noury
On 14 Jun 2019, at 09:45, Arie van Wingerden <xapwing@gmail.com> wrote:
Hi,
for a project I need this kind of program:
1. client side only 2. must be able to programmatically show a web browser in a window (Morphic??); only local content will be shown 3. must also be able to show other windows, containing simple games
Now, I guess that 1 and 3 are possible straight away, but I am unsure about option 2.
I found out that there are a few ways to do it:
- using C#, which has: - standard web browser control out-of-the-box - third-party open source chromium web browser component - using Java, which (afaict) is a coding effort, but possible anyway
That saiud, since I'd very much like to start using Pharo for more tasks (just starting) I wonder if Pharo has something to offer in this case.
Many thx! /Arie
participants (4)
-
Arie van Wingerden -
Ben Coman -
Noury Bouraqadi -
Richard O'Keefe