Page 1 of 6 1234 ... LastLast
Results 1 to 10 of 55

Thread: MS Edge WebView2 ActiveX wrapper

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default MS Edge WebView2 ActiveX wrapper

    Hi,

    Over the past weeks I've built an ActiveX wrapper for the Microsoft Edge WebView2 control, which is the follow up for the old cComWebBrowser control from Microsoft.

    Quite a bit of its functionality is already available in my control, although I am still working on some of the nitty gritty. It is a huge interface and it will take some time to complete. Not all of it is exactly straight forward either.

    The C++ Documentation is here:
    https://docs.microsoft.com/en-us/mic...ew2-1.0.864.35

    However much of what I did has been modeled after the .net interface.. (it is easier to navigate if you ask me)
    https://docs.microsoft.com/en-us/dot...ew2-1.0.864.35

    I have been building against the very latest version of the control and have indeed already benefited from access to the latest features.

    What I'm not sure about is what the interest for this is in the DataFlex community.

    Just to be clear upfront, it won't be free as then I cannot provide any support on it.
    In fact for price, it will be very similar to how Chilkat does its licensing and support.
    Price will be similar too (EUR 300), although there will be an early bird deal with 50% off.

    I expect to have an early beta demo ready in the next few days (need to write more DataFlex code etc.. test test test)
    Click image for larger version. 

Name:	WebView2ActiveX.png 
Views:	278 
Size:	118.6 KB 
ID:	14697

    Let me know if there's any interest.
    --
    Wil

  2. #2
    Join Date
    Feb 2009
    Location
    Adelaide, South Australia
    Posts
    2,613

    Default Re: MS Edge WebView2 ActiveX wrapper

    Hi Wil

    Assuming there is screen scraping and automation (setting form values, pressing buttons).

    Than yes, seems a fair value!
    Marco Kuipers
    DataFlex Consultant
    28 IT Pty Ltd - DataFlex Specialist Consultancy
    DataFlex Channel Partner for Australia and Pacific region
    Adelaide, South Australia
    www.28it.com.au

  3. #3

    Default Re: MS Edge WebView2 ActiveX wrapper

    Marco,

    Quote Originally Posted by Marco View Post
    Hi Wil

    Assuming there is screen scraping and automation (setting form values, pressing buttons).

    Than yes, seems a fair value!
    Ah.. an easy question from Marco.. with a long answer...

    Define screen scraping. I think I know what you are asking, but it can be a picture, or the html that comes from the server, or it can be what is rendered in the browser (eg. the source might have been - is even likely to have been - changed via javascript). For my answer here I'm going to assume it is the latter.

    Let's step back a bit.

    With the old webBrowser activex control from Microsoft you would get direct access to the DOM from within the browser control and thus DataFlex.
    Eg. there's the ComDocument function that returns variant variable that you can then connect to a cComHtmlDocument object via the mshtml ActiveX interface.
    This was very powerful and it allowed you to do all kinds of magical things.

    That's not how the WebView2 control works. While you could technically still use mshtml for generating html, it doesn't make as much sense and there isn't a way to connect it to the control. You could load the result as a string though.
    Besides that mshtml is AFAIK a part of the old browser control, so it is marked obsolete as well.

    With WebView2 you are able to get the data that is send over the line.
    But it creates a new task for each file that your page is made up of and returns each task as an IStream object.
    From what I've seen so far, these IStream objects don't have an indication if they are returning a string or a bunch of bytes (for example a picture), the name structure is not filled in my tests either.
    I'm now offering this resource result event as a string, but that might not make a lot of sense in most cases.
    Besides that... even if you would know what goes over the line, things get cached and a reload of your page doesn't get as much data as the first request might have done. Messing with the content mid stream.. also not that recommended.
    So that is also a dead end for this type of thing.

    Is there nothing that can give us a "scrape" of what is in the browser?

    Yes, actually there is.
    As you know, we live in a javascript world nowadays

    There's an "executeScript" method which allows you to run javascript in the document that is currently displayed in the browser.
    This also triggers an event with the result of that javascript call.
    You can use that to retrieve the document content, fill particular parts in the html and even do things like trigger button clicks.
    From what I see now and my preliminary tests with that, it should work OK.
    I will see if I can add this as a demo to the DataFlex application.

    However for the moment I'm focusing on the base ActiveX wrapper, not on manipulating what is rendered in the browser.
    It is possible to add that type of thing later on, but it is not actually a native msedge WebView2 feature.
    At least I haven't seen it.

    Hope this helps,
    --
    Wil

  4. #4

    Default Re: MS Edge WebView2 ActiveX wrapper

    Marco,

    Last night I played a bit with this.
    As some of it can be challenging, like the json object encoding of the results and additional error checking, I do see value in adding this right away.
    So I will add an additional automation interface for easy manipulation (this will push my time lines a bit, but oh well...)

    Thanks for the suggestion.
    --
    Wil

  5. #5
    Join Date
    Feb 2009
    Location
    Castlegar, BC Canada
    Posts
    4,377

    Default Re: MS Edge WebView2 ActiveX wrapper

    Hi Wil

    Currently I don't use any browser objects (any more) so 300 EUR is a bit rich for me with no need. HOWEVER, I would likely be interested in the early bird special to keep my option open on this. Are you suggesting that there is an annual fee afterwards for licensing and support?

    Mike

  6. #6

    Default Re: MS Edge WebView2 ActiveX wrapper

    Mike,

    Quote Originally Posted by Mike Cooper View Post
    Are you suggesting that there is an annual fee afterwards for licensing and support?
    No additional licensing fees or constraints beyond the expected "reselling" limit. Also no built in end dates on the control once purchased.
    For support and updates there will indeed be a 1 year limit where you have to buy a new update&support after 1 year.
    Not the "forever" updates option that I tend to do for other things.

    The reasoning here is that for Microsoft the MS Edge WebView2 control is a work in progress.
    They will keep on improving the control and this way I can keep up with their improvements.

    Old versions should keep on working. That's a basic premise in ActiveX, they can add & extend, but normally not break old interfaces.
    At least that is what Microsoft tells us about ActiveX technology.
    As the underpinnings are based on ActiveX, I hope that Microsoft lives by their own rules.

    edit: To be more clear. With the early bird special you will get updates for 1 year. So you can take advantage of any new features & fixes implemented in that one year subscription. If you then let lapse the update&subscription you still have a fully functional WebView2 browser control.

    Marco: I will answer your question later today.
    --
    Wil
    Last edited by wila; 21-Jun-2021 at 04:13 AM.

  7. #7
    Join Date
    Feb 2009
    Location
    Castlegar, BC Canada
    Posts
    4,377

    Default Re: MS Edge WebView2 ActiveX wrapper

    Thanks Wil.

    Sounds fair.

  8. #8
    Join Date
    Feb 2009
    Location
    Perth, Western Australia
    Posts
    854

    Default Re: MS Edge WebView2 ActiveX wrapper

    Hi Wil

    That's looking pretty good Wil, nice work! Talking mshtml and the DOM, have you attempted to use your tinyMCE interface in Web View 2 yet?
    Cheers,

    Thomas Murphy
    Triumph Business Systems Pty Ltd
    www.triumph.com.au

  9. #9

    Default Re: MS Edge WebView2 ActiveX wrapper

    Hi Tom,

    Nope, just trying to focus on the main parts first before I even entertain ideas like that.
    It should be possible though.
    --
    Wil

  10. #10
    Join Date
    Feb 2009
    Location
    Perth, Western Australia
    Posts
    854

    Default Re: MS Edge WebView2 ActiveX wrapper

    Hi Wil

    I thought that may be the case.. but it's nice to know there looks like there's a pathway forwards.
    Cheers,

    Thomas Murphy
    Triumph Business Systems Pty Ltd
    www.triumph.com.au

Page 1 of 6 1234 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •