Chromium WebGadget v4

Developed or developing a new product in PureBasic? Tell the world about it.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Chromium Edge WebGadget

Post by JHPJHP »

Updated:
- modified CE_WebGadget_2.pb
- modified the event process to use JSON
- various small optimizations and improvements

CE_WebGadget_2.pb has been updated to process JavaScript events for multiple CE WebGadgets.

NB*: See previous post for an updated code example.

Image
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Chromium Edge WebGadget

Post by JHPJHP »

Updated:
- added the option to open internet URLs
- added a new example: CE_WebGadget_5.pb
- some minor code improvements

CE_WebGadget_5.pb
Includes three CE WebGadgets pointing to three seperate URLs.

Chromium Edge WebGadget was originally written to demonstrate how easy it is to include simple but robust (JavaScript, HTML5, CSS3) features into a PureBasic application (i.e. scrolling/marquee text), everything else is experimental.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Chromium Edge WebGadget

Post by JHPJHP »

Updated:
- better stability with non-standardize HTML
- various improvements to code structure
- combined all includes into a single file
- squashed a couple bugs

Rewrote part of the CE_WebGadget_Format Procedure to be less strict with non-standardize HTML.

NB*: Chromium Edge WebGadget free executables were also updated.
Last edited by JHPJHP on Fri Mar 18, 2022 3:07 pm, edited 1 time in total.
Morty
User
User
Posts: 35
Joined: Mon Mar 19, 2007 8:30 am
Location: Germany
Contact:

Re: Chromium Edge WebGadget

Post by Morty »

Hi JHPJHP

Is there an easy way to call a javascript function with parameters and get back a result? I have looked through your codes (even the html/js) and there are too many functions - so I don't get it.

In your PB-code you use the CE_WebGadget_Post function which refers to your website. And in your examples html/js files you are also refering to it, but with additional parameters.

Am I on the right way? Is this the way that I have to save the scripts on my server and change these proxy/url parameters?

Thanks

Morty
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Chromium Edge WebGadget

Post by JHPJHP »

Hi Morty,

CE_WebGadget_1.pb was experimental (not meant for practical use), as were the techniques (proxy, PHP, etc.) used to initiate the JavaScript calls.
JHPJHP wrote:Chromium Edge WebGadget was originally written to demonstrate how easy it is to include simple but robust (JavaScript, HTML5, CSS3) features into a PureBasic application (i.e. scrolling/marquee text), everything else is experimental.
If you're still determined to go down this path, I can provide additional information.

CE_WebGadget_2.pb which captures JavaScript events should probably be your starting point...

I've been doing some work with the IAccessible interface that I'm hoping can be used to assist with the "experimental" parts of Chromium Edge WebGadget, but there is still more to be done before it can be implemented; see the following post: https://www.purebasic.fr/english/viewto ... 51#p573751.

CE_WebGadget_3.pb demonstrates my original intent; a simple way to embed scrolling marquee text/images, not fully supported by the WebGadget, into a PureBasic application.
Last edited by JHPJHP on Sun May 01, 2022 9:14 pm, edited 1 time in total.
User avatar
skinkairewalker
Enthusiast
Enthusiast
Posts: 625
Joined: Fri Dec 04, 2015 9:26 pm

Re: Chromium Edge WebGadget

Post by skinkairewalker »

works on linux and macos too ?
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Chromium Edge WebGadget

Post by JHPJHP »

Windows only.
User avatar
Kiffi
Addict
Addict
Posts: 1346
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: Chromium Edge WebGadget

Post by Kiffi »

Hello JHPJHP,

when I start the code on my (german) system, a dialogue box keeps appearing offering to translate foreign language pages into my language.

Image

With the CommandLineSwitch --disable-features=Translate you can suppress this dialogue box.

Greetings ... Peter
Hygge
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Chromium Edge WebGadget

Post by JHPJHP »

Hi Kiffi,

Thank you for your post; I've added the Command Line Switch you reported (--disable-features=Translate).
At some point I will update the package to optionally use an external file for Command Line Switches.

In addition, the example CE_WebGadget_3.pb was updated to exclusively use external HTML files, and a small bug was patched.

NB*: Free executables (x86/x64) can also be downloaded from My PureBasic Stuff; see FREE STUFF.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Chromium Edge WebGadget

Post by JHPJHP »

Updated:
- added CE_WebGadget.cls
- improved basic CE_WebGadget
- numerous minor improvements

CE_WebGadget.cls
Set Command Line Switches from an external file. Remove the leading underscore for file to be active.

NB*: Default file settings currently match the programs internal settings. Activating the file will override the internal settings.

Code: Select all

; List of Chromium Command Line Switches
; https://peter.sh/experiments/chromium-command-line-switches/


; Preserved For Internal Use

; --user-data-dir									; Directory where the browser stores the user profile.
; --window-position									; Specify the initial window position.
; --window-size										; Sets the initial window size.
; --cast-initial-screen-width						; Used to pass initial screen resolution to GPU process.
; --cast-initial-screen-height						; Used to pass initial screen resolution to GPU process.


--homepage="https://duckduckgo.com"					; Specifies which page will be displayed in newly-opened tabs.
--inprivate											; Browse in a secure private window where none of the cache, cookies or history is stored.
--disable-extensions								; Disable extensions.
--disable-notifications								; Disables the Web Notification and the Push APIs.
--disable-sync										; Disables syncing browser data to a Google Account.
--disable-features=Translate						; Comma-separated list of feature names to disable.
--enable-features=msEdgeDeleteBrowsingDataOnExit	; Comma-separated list of feature names to enable.
--no-default-browser-check							; Disables the default browser check.
--no-first-run										; Skip First Run tasks, whether or not it's actually the First Run.
--no-experiments									; Disables all experiments set on about:flags.
--no-pings											; Don't send hyperlink auditing pings.
--no-proxy-server									; Don't use a proxy server, always make direct connections.
--noerrdialogs										; Suppresses all error dialogs when present.
--new-window										; Launches URL in new browser window.
--site-per-process									; Enforces a one-site-per-process security policy.
Last edited by JHPJHP on Fri May 06, 2022 12:52 am, edited 8 times in total.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Chromium Edge WebGadget

Post by JHPJHP »

Updated:
- added command CE_WebGadget_Update()
- added example CE_WebGadget_ChartJS.pb

CE_WebGadget_Update()
This was the first step to a working Chart.js example, but it also opened up other possibilities...
Executing the command by itself will refresh the currently loaded webpage.

Code: Select all

CE_WebGadget_Update(cewg_data)
Executing the command with additional parameters will update the currently loaded webpage.

Code: Select all

*HTML = UTF8(LineChart$)
cewg_data\DataSource = *HTML
cewg_data\DataLength = MemorySize(*HTML)
CE_WebGadget_Update(cewg_data)

Code: Select all

cewg_data\DataSource = ?Marquee_Start
cewg_data\DataLength = ?Marquee_End - ?Marquee_Start
CE_WebGadget_Update(cewg_data)
NOTE: cewg_data\SourceURL cannot be used to update a CE_WebGadget, and should not be modified after CE_WebGadget_Init has been called.
EXCEPTION: Both the original and updated URL start with http:// or https://; see CE_WebGadget_5.pb.

Code: Select all

cewg_data\SourceURL = "https://www.mypurebasicstuff.com"
CE_WebGadget_Update(cewg_data)
CE_WebGadget_ChartJS.pb (Chart.js)
- animated, resizable, dynamic charts (tooltips, active legend / hide dataset, Randomize data button, etc.)

My first three examples (line, bar, pie) use a different method for randomizing data then the other examples.
This was before I had a working utils.js and understood how to include actions.

NB*: Free executables (x86/x64) can also be downloaded from My PureBasic Stuff; see FREE STUFF.
Last edited by JHPJHP on Sun Jul 10, 2022 2:53 pm, edited 1 time in total.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Chromium Edge WebGadget

Post by JHPJHP »

Updated:
- renamed CE_WebGadget_1.pb to CE_WebGadget_JSE_SSE.pb
- renamed CE_WebGadget_2.pb to CE_WebGadget_JSE.pb
- renamed CE_WebGadget_3.pb to CE_WebGadget_Display.pb
- renamed CE_WebGadget_4.pb to CE_WebGadget_SSE.pb
- renamed CE_WebGadget_5.pb to CE_WebGadget_URL.pb
- improved CE_WebGadget_JSE_SSE.pb
- improved CE_WebGadget_JSE.pb
- improved CE_WebGadget_SSE.pb

JavaScript Events (JSE): Events generated from the CE WebGadget and received by PureBasic.
Server Sent Events (SSE): Events generated from PureBasic to a hosted server and received by the CE WebGadget.
Last edited by JHPJHP on Thu Apr 21, 2022 2:47 am, edited 4 times in total.
ricardo
Addict
Addict
Posts: 2402
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Re: Chromium Edge WebGadget

Post by ricardo »

Hi,

Does this need to install anything to work?

Best Regards
ARGENTINA WORLD CHAMPION
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Chromium Edge WebGadget

Post by JHPJHP »

Hi ricardo,
ricardo wrote:Does this need to install anything to work?
No, but the minimum requirements are Windows OS with Chromium Edge.
Easy enough to test, just download the free executables...

NB*: Free executables (x86/x64) can be downloaded from My PureBasic Stuff; see FREE STUFF.
ricardo
Addict
Addict
Posts: 2402
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Re: Chromium Edge WebGadget

Post by ricardo »

JHPJHP wrote: Thu Apr 21, 2022 12:09 am Hi ricardo,
ricardo wrote:Does this need to install anything to work?
No, but the minimum requirements are Windows OS with Chromium Edge.
Easy enough to test, just download the free executables...

NB*: Free executables (x86/x64) can be downloaded from My PureBasic Stuff; see FREE STUFF.
Hi JHP JHP

I am running Windows 10 with Microsoft Edge Versión 100.0.1185.44. Its sayus that has beinmg developed thanks to Chromium... but if i tried to run your free ejecutables it says Edge Chromium wasnt found. My Edge says its updated.
ARGENTINA WORLD CHAMPION
Locked