Can I code a web browser in a Pharo GUI window (Morphic or other)?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Can I code a web browser in a Pharo GUI window (Morphic or other)?

Arie van Wingerden
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

Reply | Threaded
Open this post in threaded view
|

Re: Can I code a web browser in a Pharo GUI window (Morphic or other)?

Richard O'Keefe
There was a thread about this two years ago.
 

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 <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: Can I code a web browser in a Pharo GUI window (Morphic or other)?

Arie van Wingerden
Hi Richard,

Op vr 14 jun. 2019 om 12:58 schreef Richard O'Keefe <[hidden email]>:
There was a thread about this two years ago.

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.

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
Reply | Threaded
Open this post in threaded view
|

Re: Can I code a web browser in a Pharo GUI window (Morphic or other)?

Ben Coman
In reply to this post by Arie van Wingerden


On Fri, 14 Jun 2019 at 15:46, Arie van Wingerden <[hidden email]> 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...





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.  
Pharo could do the same thing.  Even Microsoft is doing this...

I've previously linked a small sub-part of Chromium with Pharo.  


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.  

cheers -ben
Reply | Threaded
Open this post in threaded view
|

Re: Can I code a web browser in a Pharo GUI window (Morphic or other)?

N. Bouraqadi
In reply to this post by Arie van Wingerden
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 <[hidden email]> 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


Reply | Threaded
Open this post in threaded view
|

Re: Can I code a web browser in a Pharo GUI window (Morphic or other)?

Arie van Wingerden
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 <[hidden email]>:
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 <[hidden email]> 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