Page 1 of 1

WebGadget; SPA; communication App -> WebGadget; PB5.6x

Posted: Fri Aug 18, 2017 6:04 am
by HanPBF
Hello!

What ways do we have to start communicating between PureBasic program and embedded WebGadget.
This must be done using a SPA (singe page application).
So, simply writing a whole new web page is not a good idea;-)

At the moment, I use windows title and #PB_EventType_TitleChange which works from embedded browser to PureBasic.
The step back is handled via file system and JS observing folder.
The file observing is what makes me want another technic.

Maybe WScript/CScript and network?

Btw., ActiveX in internet explorer is possible/I may use!

I need this for offline app which later communicates to web server when connection available again.


Really apreciate any idea!
Thanks a lot!
Regards!

Re: WebGadget; SPA; communication App -> WebGadget; PB5.6x

Posted: Mon Aug 21, 2017 4:10 am
by JHPJHP
Hi HanPBF,

I know we discussed it here and here, but it seems that you are only using the document.title one way; see either of the following posts for a working solution.
- MP4 Player, YouTube Player (search for _Put_ and _Get_)

This is the second time I am posting a response; the last time was in one of your other threads, since removed.
- sorry if you missed it, but I have a policy to delete posts that go unanswered

Re: WebGadget; SPA; communication App -> WebGadget; PB5.6x

Posted: Mon Aug 21, 2017 7:25 pm
by HanPBF
Yes, did indeed overread it but can remember the hint to the interface IHTMLDocument2.

Thanks for making it clear again!
That helps a lot!

So, two-way communication with WebGadget via document.title possible!
Great!

Re: WebGadget; SPA; communication App -> WebGadget; PB5.6x

Posted: Tue Aug 22, 2017 2:43 am
by IdeasVacuum

Code: Select all

WebBrowser2\put_Silent(#True)
I use this code myself because so many websites have Java Script errors but it is worth noting that it is not specifically for this purpose - it actually suppresses all dialogue boxes, so that includes those that deliver info such as extended hints.

Re: WebGadget; SPA; communication App -> WebGadget; PB5.6x

Posted: Fri Aug 25, 2017 4:44 pm
by JHPJHP
Hi HanPBF,

See MP4 Player for additional code that might be of interest...

Dynamically create multiple <article> elements using JavaScript (tested with 100MB of data per element).
- the <pagetitle> tag is used to notify PureBasic that data is ready

PureBasic is then used to retrieve data from each of the <article> elements into a single file.

Re: WebGadget; SPA; communication App -> WebGadget; PB5.6x

Posted: Sat Aug 26, 2017 11:32 am
by HanPBF
Really apreciate that example!

I have now IIS with classic ASP (only serving JSON from AJAX/J requests) and are later able to re-embed JS/HTML/CSS into PureBasic.

Then, we have SpiderBasic; so, developing for intranet, embedded or not, can easily be done with one code base for the GUI.

Can not imagine if JS/HTML/DOM could be too slow to manage those things; mandelbrot set graphics would be an example where speed shall be distinct.


Thanks a lot for the source!
Best regards!