WebGadget()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
the.weavster
Addict
Addict
Posts: 1537
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

WebGadget()

Post by the.weavster »

Update WebGadget() so it's underpinned by something that can display modern web pages.
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: WebGadget()

Post by RSBasic »

I'm sorry, but that's not the job of PureBasic. WebGadget based on windows control (ActiveX object) and Microsoft must update.
Image
Image
User avatar
the.weavster
Addict
Addict
Posts: 1537
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: WebGadget()

Post 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.
HanPBF
Enthusiast
Enthusiast
Posts: 563
Joined: Fri Feb 19, 2010 3:42 am

Re: WebGadget()

Post by HanPBF »

At the moment the WebGadget is useless
Last edited by HanPBF on Sun Jan 07, 2018 11:04 am, edited 1 time in total.
User avatar
the.weavster
Addict
Addict
Posts: 1537
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: WebGadget()

Post 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.
User avatar
the.weavster
Addict
Addict
Posts: 1537
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: WebGadget()

Post 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.
ramme
User
User
Posts: 72
Joined: Fri Mar 31, 2017 8:52 am
Location: Fortuna California

Re: WebGadget()

Post 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?
User avatar
Bisonte
Addict
Addict
Posts: 1226
Joined: Tue Oct 09, 2007 2:15 am

Re: WebGadget()

Post 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...
PureBasic 6.04 LTS (Windows x86/x64) | Windows10 Pro x64 | Asus TUF X570 Gaming Plus | R9 5900X | 64GB RAM | GeForce RTX 3080 TI iChill X4 | HAF XF Evo | build by vannicom​​
English is not my native language... (I often use DeepL to translate my texts.)
HanPBF
Enthusiast
Enthusiast
Posts: 563
Joined: Fri Feb 19, 2010 3:42 am

Re: WebGadget()

Post 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.
User avatar
Bisonte
Addict
Addict
Posts: 1226
Joined: Tue Oct 09, 2007 2:15 am

Re: WebGadget()

Post 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.
Last edited by Bisonte on Thu May 11, 2017 9:20 am, edited 1 time in total.
PureBasic 6.04 LTS (Windows x86/x64) | Windows10 Pro x64 | Asus TUF X570 Gaming Plus | R9 5900X | 64GB RAM | GeForce RTX 3080 TI iChill X4 | HAF XF Evo | build by vannicom​​
English is not my native language... (I often use DeepL to translate my texts.)
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: WebGadget()

Post by IdeasVacuum »

The problem with Qt is the runtime is huge.
.... the bigger problem is the bank-busting price!
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Fred
Administrator
Administrator
Posts: 16619
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: WebGadget()

Post 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.
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: WebGadget()

Post by IdeasVacuum »

I was hoping that WebKit could be used for Windows OS.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
DarkDragon
Addict
Addict
Posts: 2218
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: WebGadget()

Post 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.
bye,
Daniel
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: WebGadget()

Post 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.
Last edited by JHPJHP on Fri Dec 23, 2022 3:18 am, edited 5 times in total.
Post Reply