[Lazarus] Let's make a web browser

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Let's make a web browser

Free Pascal - Lazarus mailing list

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Let's make a web browser

Free Pascal - Lazarus mailing list


On Fri, 18 May 2018, Anthony Walter via Lazarus wrote:

> how-to instructions
> <https://www.getlazarus.org/learn/tutorials/examples/webbrowser/>
>

Pretty neat ! Deceptively easy to do :)

Question:
Where are the components you used, and where can I find the demo source code ?

Michael.
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Let's make a web browser

Free Pascal - Lazarus mailing list
On 2018-05-18 09:18, Michael Van Canneyt via Lazarus wrote:
>
>
> Question: Where are the components you used, and where can I find the
> demo source code ?
+1

-Torsten.
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Let's make a web browser

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 05/18/2018 09:18 AM, Michael Van Canneyt via Lazarus wrote:

>
>
> On Fri, 18 May 2018, Anthony Walter via Lazarus wrote:
>
>> how-to instructions
>> <https://www.getlazarus.org/learn/tutorials/examples/webbrowser/>
>>
>
> Pretty neat ! Deceptively easy to do :)
>
> Question: Where are the components you used, and where can I find the
> demo source code ?

Is this embedded Gecko engine ?

z.
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Let's make a web browser

Free Pascal - Lazarus mailing list


On Fri, 18 May 2018, zeljko wrote:

> On 05/18/2018 09:18 AM, Michael Van Canneyt via Lazarus wrote:
>>
>>
>> On Fri, 18 May 2018, Anthony Walter via Lazarus wrote:
>>
>>> how-to instructions
>>> <https://www.getlazarus.org/learn/tutorials/examples/webbrowser/>
>>>
>>
>> Pretty neat ! Deceptively easy to do :)
>>
>> Question: Where are the components you used, and where can I find the demo
>> source code ?
>
> Is this embedded Gecko engine ?

I thought it was perhaps chrome embedded ?

Michael.
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Let's make a web browser

Free Pascal - Lazarus mailing list
On 05/18/2018 10:46 AM, Michael Van Canneyt via Lazarus wrote:

>
> I thought it was perhaps chrome embedded ?

Maybe, there are Delphi bindings around for chrome embedded

z.
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Let's make a web browser

Free Pascal - Lazarus mailing list


On Fri, 18 May 2018, zeljko wrote:

> On 05/18/2018 10:46 AM, Michael Van Canneyt via Lazarus wrote:
>
>>
>> I thought it was perhaps chrome embedded ?
>
> Maybe, there are Delphi bindings around for chrome embedded

Indeed and for lazarus as well.
cef4delphi was ported at some point, I think.

Michael.
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Let's make a web browser

Free Pascal - Lazarus mailing list
On 2018-05-18 11:46, Michael Van Canneyt via Lazarus wrote:

>
>
> On Fri, 18 May 2018, zeljko wrote:
>
>> On 05/18/2018 10:46 AM, Michael Van Canneyt via Lazarus wrote:
>>
>>>
>>> I thought it was perhaps chrome embedded ?
>>
>> Maybe, there are Delphi bindings around for chrome embedded
>
> Indeed and for lazarus as well.
> cef4delphi was ported at some point, I think.

But afaik it was only ported for windows - and the video is from an
Ubuntu installation. :)

-Torsten
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Let's make a web browser

Free Pascal - Lazarus mailing list


On Fri, 18 May 2018, Torsten Bonde Christiansen via Lazarus wrote:

> On 2018-05-18 11:46, Michael Van Canneyt via Lazarus wrote:
>>
>>
>> On Fri, 18 May 2018, zeljko wrote:
>>
>>> On 05/18/2018 10:46 AM, Michael Van Canneyt via Lazarus wrote:
>>>
>>>>
>>>> I thought it was perhaps chrome embedded ?
>>>
>>> Maybe, there are Delphi bindings around for chrome embedded
>>
>> Indeed and for lazarus as well.
>> cef4delphi was ported at some point, I think.
>
> But afaik it was only ported for windows - and the video is from an
> Ubuntu installation. :)

Good point.

I guess Anthony Walter will have to enlighten us all... :)

Michael.
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Let's make a web browser

Free Pascal - Lazarus mailing list
This is an open source set of controls I am working on which will be released soon on gtihub. The browser is based on the wekbit engine, and it's accompanied by a collection of native controls and other code to make working with related materials easy/easier.

A related portion I am working on in parallel is an interface to the webkit javascript core engine. Although it is in a separate package, the jsc tools I am working on provide the ability to intermix pascal code and javascript in your applications. But also, you can use the jsc tools to take to talk your application from inside a webpage, and your application can call javascript to interact with a webpage.

Or, you can not use a web browser at all, and just work with javascript inside your pascal apps.

Stay tuned. If you want to help me test or give me feedback (forum linked below) on some demo ideas or the programming interface (code design) before I publish, let me know.


--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Let's make a web browser

Free Pascal - Lazarus mailing list


On Fri, 18 May 2018, Anthony Walter via Lazarus wrote:

> This is an open source set of controls I am working on which will be
> released soon on gtihub. The browser is based on the wekbit engine, and
> it's accompanied by a collection of native controls and other code to make
> working with related materials easy/easier.
>
> A related portion I am working on in parallel is an interface to the webkit
> javascript core engine. Although it is in a separate package, the jsc tools
> I am working on provide the ability to intermix pascal code and javascript
> in your applications. But also, you can use the jsc tools to take to talk
> your application from inside a webpage, and your application can call
> javascript to interact with a webpage.
>
> Or, you can not use a web browser at all, and just work with javascript
> inside your pascal apps.
>
> Stay tuned. If you want to help me test or give me feedback (forum linked
> below) on some demo ideas or the programming interface (code design) before
> I publish, let me know.

Great news !

It means we can create native embedded pas2js applications:
a "Phonegap" (think cordova, native react etc.) like approach for lazarus !
This is going to be heaps of fun... :)

Keep up the good work, I look forward to seeing the final product :)

Michael.
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Let's make a web browser

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 2018-05-18 12:00, Anthony Walter via Lazarus wrote:
This is an open source set of controls I am working on which will be released soon on gtihub. The browser is based on the wekbit engine, and it's accompanied by a collection of native controls and other code to make working with related materials easy/easier.

A related portion I am working on in parallel is an interface to the webkit javascript core engine. Although it is in a separate package, the jsc tools I am working on provide the ability to intermix pascal code and javascript in your applications. But also, you can use the jsc tools to take to talk your application from inside a webpage, and your application can call javascript to interact with a webpage.

Or, you can not use a web browser at all, and just work with javascript inside your pascal apps.

Stay tuned. If you want to help me test or give me feedback (forum linked below) on some demo ideas or the programming interface (code design) before I publish, let me know.



I would love to help you with both testing and feedback. Is there any way I can help you with development too?

I would love to add (at least the browser part) to our product.

best regrads,
Torsten.

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Let's make a web browser

Free Pascal - Lazarus mailing list
As for chrome embedding;

I used it couple years ago and it worked very well.https://github.com/zbyna/vcfToGigaset
FpCEF3 is maintained so far.

18. 5. 2018 v 13:41, Torsten Bonde Christiansen via Lazarus <[hidden email]>:

On 2018-05-18 12:00, Anthony Walter via Lazarus wrote:
This is an open source set of controls I am working on which will be released soon on gtihub. The browser is based on the wekbit engine, and it's accompanied by a collection of native controls and other code to make working with related materials easy/easier.

A related portion I am working on in parallel is an interface to the webkit javascript core engine. Although it is in a separate package, the jsc tools I am working on provide the ability to intermix pascal code and javascript in your applications. But also, you can use the jsc tools to take to talk your application from inside a webpage, and your application can call javascript to interact with a webpage.

Or, you can not use a web browser at all, and just work with javascript inside your pascal apps.

Stay tuned. If you want to help me test or give me feedback (forum linked below) on some demo ideas or the programming interface (code design) before I publish, let me know.



I would love to help you with both testing and feedback. Is there any way I can help you with development too?

I would love to add (at least the browser part) to our product.

best regrads,
Torsten.
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Let's make a web browser

Free Pascal - Lazarus mailing list
On 2018-05-18 14:22, Zbyněk Fiala via Lazarus wrote:
> As for chrome embedding;
> https://github.com/dliw/fpCEF3
>
> I used it couple years ago and it worked very
> well.https://github.com/zbyna/vcfToGigaset
> FpCEF3 is maintained so far.

Even fpCEF3 has problems running well under linux - so I would love to
see (and help) with an approach like this :)

Best regards,
Torsten.
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Let's make a web browser

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
My plan is to finish the JavaScript Core package first, test on Windows, Mac, and Linux, create some compelling demos, record a few videos, and publish it on Github.

Then integrate the final published API of the JSC into the Webkit browser package, and again test on Windows, Mac, and Linux, create some compelling demos, record a few videos, and publish it on Github.

In JSC what's currently working

JSC ability to work on all platforms. Run any JavaScript plus latest ES6 support. Create Pascal callbacks for JavaScript. Call JavaScript functions/methods from Pascal. Create JavaScript objects dynamically from Pascal. Fully documented.

In JSC what needs work:

JSC ability to define native JavaScript classes in Pascal. testing, demos, and videos. Synchronize changes from the JSC package back into the Webkit browser package.

In Webkit browser package what's currently working:

Gtk2 and Gtk3 bindings. Custom controls working independently of bindings. Some designers and component editors. A lot of functionality has been included beyond what was shown in the demo, including browser element hit testing, intercepting resources before they load, custom alert/confirm/prompt handling. Mostly documented. 

In Webkit browser what needs work:

Needs download manager code for handling what to do when links that want to download files. Cocoa/Carbon and Qt4/5 all have a paths forward and I have the sources ready. They use the same basic API so changes should be minimal and mostly related to WSClass details. Windows has not been researched yet, but should be possible. I need to implement a few more helper controls. Testing, demos, and videos. Synchronize changes from the JSC package into the Webkit browser package.

So in summary:

I will finish the JSC package first, publish it, then do more work on the Webkit browser. The JSC package code is close to done, but demos will needs some time. Everything should work on all major platforms when complete and offer similar experiences. 

Notes about Gtk2:

Continued Gtk2 support for Webkit was stopped a few years ago. It works, but there have been no updates by the Webkit team for a few years and there are some security holes that won't be patched. Also it does not have the same performance enhancements or improvements as the Gtk3/Mac/Qt versions. I have made some improvements tot the LCL Gtk3 units which I will publish to Mantis as a patch when the Webkit web browser package is published.

Contributions:

I am going to be looking for ideas and testing with the JSC package relatively soon. The system I've come up with is very easy to use, and also quite powerful. Before publishing I want to create some demos, record a few videos, and of course test all platforms. The basic getting starting with JSC is this easy:

uses
  JavaScript.Core;

var
   Context: JSContext;
begin
  Context := JSContext.Create;
  Context.ScriptRun(SomeJavaScriptString);
end;

Note, JSContext and all related JS types (JSValue, JSObject, JSString) are all managed for you, meaning you do not need to free them. To create a JevaScript object in Pascal you can use code like:

O := Context.CreateObject('RegExp');

To define a callback for JavaScript to invoke your Pascal code you would write:

function PascalHello(Context: JSContext; Args: JSValueArray; var Error: JSValue): JSValue;
begin
  if Length(Args) > 0 then
    Result := Context.CreateString('Hi there ' + Args[0].AsString)
  else
    Result := Context.CreateString('Pascal says hello');
end;

...

Context.GlobalObject.CreateFunction('hello', PascalHello);

And in JavaScript you might write:

console.log(hello("i am javascript"));

I also provide a way to define and load entire Pascal modules in JavaScript. A Pascal module is a set of objects/functions that add functionality to JavaScript through native Pascal code. To use a Pascal module you write:

JSEnabledModuleSystem(Context);

And in JavaScript you might write:

system.modules.load('file', 'process');
file.writeText('hello.txt', 'hello world');
let s = process.execute('ls', '-al');
console.log(s);

Note, the module system provides a default console object even if you are operating outside a web browser. Also, the module system is available even if you are executing the JavaScript inside a web page. I will provide a reference on how to write your own modules.

Finally, I have included with JSC a demo application named jsc. The jsc application is a scripting program that allows you to run scripts on Mac/Linux via shebangs:

#!/home/user/bin/jsc
console.log("Hello World");

You can load modules in jsc scripts as well. To run your script, assuming it is called hello.js, from a terminal:

chmod +x hello.js
./hello.js

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus