Page 1 of 2

WebGadget()

Posted: Thu Jan 07, 2016 7:33 pm
by the.weavster
Update WebGadget() so it's underpinned by something that can display modern web pages.

Re: WebGadget()

Posted: Thu Jan 07, 2016 8:04 pm
by RSBasic
I'm sorry, but that's not the job of PureBasic. WebGadget based on windows control (ActiveX object) and Microsoft must update.

Re: WebGadget()

Posted: Thu Jan 07, 2016 8:26 pm
by the.weavster
RSBasic wrote:I'm sorry, but that's not the job of PureBasic.
Why not?
RSBasic wrote:WebGadget based on windows control (ActiveX object)
And my feature request is for it to be based on something else.

Re: WebGadget()

Posted: Thu Jan 07, 2016 8:57 pm
by HanPBF
At the moment the WebGadget is useless

Re: WebGadget()

Posted: Thu Jan 07, 2016 10:57 pm
by the.weavster
HanPBF wrote:I would not complain if
- browsers could be set into an desktop application mode (chromeless like HTA did)
- if Chrome and Opera, which can do this, would not be blocked from many companies for their "curiosity"
- at the moment You can use Firefox (portable avialable) or IE what ever version is installed and host PB as CGI on the desktop
You can use Firefox in chromeless mode too but it only works with the file protocol not when loading a web uri, e.g.:

firefox --chrome file:///home/whoever/public_html/index.html

I don't know if you can make ajaj web requests in that mode though, you'd have to try and see.

Re: WebGadget()

Posted: Thu Jan 07, 2016 11:25 pm
by the.weavster
A while ago I created a project in Qt using the WebKit bridge that enables you to expose C++ objects to JavaScript. Even though I was completely new to Qt it was remarkably easy to create and inject an object that enabled me to access SQLite and ODBC databases direct from JavaScript like this:

Code: Select all

function onNext(rec) {
    console.log(rec);
}

function onFieldData(fld) {
    console.log(fld);
}

function onError(msg) {
    console.log(msg);
}

window.onload = function() {
    sb_database.onNext.connect(onNext); //sb_database is the object I injected
    sb_database.onError.connect(onError);
    sb_database.onFieldData.connect(onFieldData);
    var db = sb_database.connect(0,"mydb.sdb","",""); // 0 = SQLite, 1 = ODBC
    if(db==0) { return; }
    if(sb_database.begin(db)!=1) { return; }
    var params = ["United Kingdom"];
    var jsparams = JSON.stringify(params);
    var rs = sb_database.select(db,"SELECT * FROM COUNTRIES WHERE COUNTRY=?",jsparams);
    if(rs==0) { return; }
    while(sb_database.moveNext(rs)==1) {
        // handled by callbacks...
    }
    sb_database.commit(db);
    sb_database.freeQuery(rs);
    if(sb_database.begin(db)!=1) { return; }
    params = ["No","United Kingdom"];
    jsparams = JSON.stringify(params);
    if(sb_database.execute(db,"UPDATE COUNTRIES SET IS_EU=? WHERE COUNTRY=?",jsparams)!=1) { return; }
    if(sb_database.commit(db)!=1) { return; }
    sb_database.close(db);
    console.log("done");
}

window.onunload = function() {
    sb_database.onNext.disconnect(onNext);
    sb_database.onError.disconnect(onError);
}
The problem with Qt is the runtime is huge.

Today I was experimenting with PureBasic to see if I could create a browser and server combined into one application with the network events and gadget events inside the same Repeat Until loop. To my surprise it didn't choke but I lost enthusiasm for my experiment the moment I got an error from an *.html file that included JQuery.

Re: WebGadget()

Posted: Wed May 10, 2017 2:30 am
by ramme
So, a year has gone by and PureBasic is still
using the same very obsolete webgadget!

It looks like SpiderBasic is also using the same
gadget, which is ludicrous. Don't you think that
it's time to really get on the HTML5 bandwagon?

PureBasic is great software. Why spoil it with
junk like this gadget?

Re: WebGadget()

Posted: Wed May 10, 2017 8:38 am
by Bisonte
Your program can use a newer IE version. You only have to create a key value in

HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION

with the name of your exe file with a value of 11001 and you have the latest IE. And all features of IE 11 are yours...

Re: WebGadget()

Posted: Wed May 10, 2017 10:56 am
by HanPBF
Hello Bisonte,

thanks for the tip.

If I can not change users registry settings due to admin rights is's a problem.

But, I think I have read something online maybe here in PB forum about setting users registry entries at runtime.
Or in context of the application built with PB.
Any hint?

IE11 is in fact the browser kept by Microsoft for big enterprises; enterprises don't like the Edge browser due to security reasons.
Anyway, IE11 gives alle the modern web things needed.

I think, first comment is right: PureBasic can not take care of all the things of off its context.

Re: WebGadget()

Posted: Wed May 10, 2017 10:47 pm
by Bisonte
I forget to mention :

At compileroptions, don't check "Request User Mode" and don't check "Request Admin Mode" and all is working in Windows "virtual store".

No special rights needed.

Re: WebGadget()

Posted: Wed May 10, 2017 10:52 pm
by IdeasVacuum
The problem with Qt is the runtime is huge.
.... the bigger problem is the bank-busting price!

Re: WebGadget()

Posted: Thu May 11, 2017 8:27 am
by Fred
ramme wrote:It looks like SpiderBasic is also using the same
gadget, which is ludicrous. Don't you think that
it's time to really get on the HTML5 bandwagon?
SB uses your browser for its gadget, it's not the same at all than PB.

About PB webgadget, MS doesn't seems to care to provide a good native webview for app, and we don't want to have a build server to compiler a 40 MB dll based on chrome which needs to be updated every month.

Re: WebGadget()

Posted: Thu May 11, 2017 12:52 pm
by IdeasVacuum
I was hoping that WebKit could be used for Windows OS.

Re: WebGadget()

Posted: Fri May 12, 2017 6:38 am
by DarkDragon
IdeasVacuum wrote:I was hoping that WebKit could be used for Windows OS.
There is no vanilla webkit implementation afaik. They are either connected to Qt or GTK.

Re: WebGadget()

Posted: Fri May 12, 2017 2:30 pm
by JHPJHP
Chromium WebGadget

Why the Chromium WebGadget :?:
1. No dependencies; works with or without WebView2 installed.
2. No worries about an abandon project; the Chromium WebGadget is not effected by changes to WebView2.
3. Most major browsers have adopted the Chrome DevTools Protocol, fully accessible from the Chromium WebGadget.
4. Can be used as a WebGadget or applied to any installed Chromium browser.
5. Can run in Headless Mode when applied to a Chromium browser.
6. Headless mode supports controlling any Chromium browser remotely.
7. There are a wide variety of examples including Progressive Web Apps (PWA) via ISAPI.
8. The WebSocket scripts are cross platform, used for accessing the Chrome DevTools Protocol.