46 Comments

    1. I have used your Project everytime Iam running my app, its giving an error as
      Could not load file or assembly ‘Cjc.AwesomiumWrapper.dll’ or one of its dependencies. The specified module could not be found.

      When the code is compiled no errors are reported. Could Please let me know where Am I going wrong?

      Reply

      1. exactly what I did!
        He said that he will try to solve this ASAP (hopefully sooner than awesomium 1.6!)

  1. Is there an option to let Chromium use a different proxy? I just added custom proxy support to my Google Reader app but I can’t see a way to set another proxy for Chromium.

    Once again thanks for this wrapper 🙂

    Reply

    1. Sven – I’ve not noticed any proxy support in Awesomium (but that doesn’t mean it’s not there)… If you install Google Chrome and configure it to use a proxy, does that have any effect on things? (maybe Chromium always picks up default settings from the same place?)

      Reply

  2. Hi Chris,
    There is a new version (1.5.1) available that is supposed to fix the ExternalInterface poblem with Flash and enable to programmatically decide what to do with an external call (in order to create our own target=_blank)

    Any chance you could update your wrapper with these new cool stuff? 🙂

    Thanks a bunch

    Reply

    1. benjoTLV – I’ve updated the source for Awesomium 1.5.1 and checked it into CodePlex. I’ve not updated the ClickOnce demos (yet).

      Note although the WebViewListener events now get passed the originating WebView, that’s not echoed through the AwesomiumWrapper events… Let me know if there’s a compelling reason to add them 🙂

      Reply

  3. Hi Chris, me again :-)!
    I can see in your code what you implemented for “openExternalLinkInternal” which should give me the targetURL an external call try to pass to the browser.
    Unfortunately, I don’t see the equivalent of setOpensExternalLinksInCallingFrame(bool isEnabled) that Adam included in order to be able to prevent navigation in the same window.

    Did you expose it and I couldn’t find it? or did you dismiss it on purpose?

    Thanks

    Reply

    1. benjoTLV – I’ve added SetOpensExternalLinksInCallingFrame to the WebBrowser and Cjc.AwesomiumWrapper. I’ve also added the other missing 1.5 methods, but only to Cjc.AwesomiumWrapper (I’ll be lazy and wait until someone asks for them 🙂 )

      Reply

  4. Hi Chris

    Any chance to get version that creates independent process for each browser window? I think it’s not so difficult using Name Pipes, sockets or something like it to send data betwenn processes (IPC).

    Reply

    1. Roman – It might be an interesting project… Probably wouldn’t touch WebBrowser itself, but could instead create a wrapper control to marshal everything (keyboard+mouse, bitmap updates). I’d expect it to be a little slower due to marshalling bitmap data back (Chrome & IE8 probably don’t have this issue as each process [probably] gets its own HWND; whereas we need to get the image back into WPF for further manipulation).

      Reply

      1. Interesting indeed!
        I have one question about this independent process. Currently, awesomium is caching to memory everything I navigate to and using your Dispose() function does not release the memory… would this idea of independent process solve this? Or all the memory is binded to Webcore and there is nothing to do about it for now?

      2. benjoTLV – Sadly it’s probably just my code that’s the problem 🙂 Are there particular sites that eat a lot more memory, or is it just the action of browsing around that’s the issue? AwesomiumWrapper needs to mess around with C++ strings – it’s quite possible I’m not allocating & releasing them adequately.

        Did you try to drop in a few GC.Collect()’s in your code? It’s possible everything’s getting released, but maybe the garbage collector needs some encouragement? (maybe on each new page navigation).

        Putting the browser in a separate process wouldn’t necessarily help, unless we forced it to grab a new process on each page navigation (probably a bad idea for performance).

      3. Hi Chris,
        About performance, I think browsing do increase memory in general but when browsing to heavier pages (flash ads for example), it becomes really significant and does not seem to get released and collected. I did try put GC each time I am closing a webView/browser instance but it does not seem to help much.

        I also asked Adam from Awesomium about the caching policy and if it was possible to force no caching at all but he said that currently it would be difficult to implement.

        About CPU, I have another problem… it seems that the Browser is rendering (and using CPU) even if the window is hidden (minimized or just behind other windows)… when playing Youtube, I get to 33% CPU even when I am not seeing the video! when using Chrome, it gets to 30-33% as well but reduces dramatically when hidden

        I have to be honest, the CPU problem could be in my code as well 🙂 but since awesomium renders to memory I thought maybe it does not take into account “dirty rect” and renders everything even when hidden…

        Any ideas?
        Thanks

      4. benjoTLV – Very interesting post 🙂 It’s very likely that’s part (maybe all) of the issue. Currently WebBrowser uses WriteableBitmap.WritePixels, which I’m assuming calls AddDirtyRect internally. Have you tried rebuilding against .NET 4?

      5. Hi Chris,
        I am trying to replace the writeableBitmap with this: http://silverlightviewport.codeplex.com/SourceControl/changeset/view/39341#8

        But I have a lot of issues! The writeableBitmap draw the images “per pixel” while InteropBitmapRenderer is doing it “per bitmap” (which is why it does not support dirtyRect I guess). I think Awesomium does it per pixel too right? so WriteableBitmap might be more appropriate nevertheless, the .NET3.5SP1 with this method is really a show stopper….

        In short. I am lost and I need some help!
        What do you advise? Did you try this InteropBitmapRenderer?

        Thanks

      6. Currently Awesomium tells us the bounds of the updated rectangle, and we just update the same area of the WriteableBitmap. To use an alternative like InteropBitmap, you should just need to copy the entire buffer over. This would probably help as a short-term workaround for 3.5’s “big WriteableBitmap” bug, but would probably hinder performance elsewhere (small updates like link hovering on non-maximized windows). I’d prefer to avoid bringing more 3rd party components into the mix, particularly with .NET 4 being so close…

        If you mail me a list of all the issues you’re having with InteropBitmap I’ll help as much as I can. Let’s set up a TeamViewer session sometime (http://www.teamviewer.com) and I’ll help you debug it 🙂

  5. ALso, I got a crash if chromium browser builded as x86-only, all ok with it? my bug? i just got error that chromium wrapper dll can’t be loaded then I call WebBrowser browser = new WebBrowser() in runtime. <1.5 do not cause this problem.

    Reply

      1. It’s was a latest version, builded from source code. Output changed to x86. Really, forget about this problem for a some time, I think it can be a my bug, don’t want to spend your time.

        WebBwowser in independent process more interesting.

        I’m planning to upload my updates for a Bitmap capture and mouse events soon.

  6. I’m currently using the standard webbrowser component in WPF and i’m trying to change the code so it uses awesomium + your wrapper but i’m having problems with the javascript callback…

    With the standard webbrowser component you have to pass an object (in my case i have a class “ScriptCallback” with some methods in it that are called from JS) “ObjectForScripting”.

    I figured you have to use SetCallback with your wrapper but I haven’t found out yet how that is actually working.

    I’m not an expert so i could use some help…

    Reply

    1. Breez – Try calling CreateObject first with the name of an object, then call SetObjectCallback with the same object name and a property name. I think the javascript can then call this as ‘MyObject.MyCallback’ and pass arbitrary parameters. There are also the ExecuteJavascript methods that allow you to call javascript from the WebBrowser control. Let me know if this is any help 🙂

      Reply

  7. I’m wondering if you already got the AwesomiumWrapper running under .Net 4.

    I’m trying to get the new touch features running in the WebBrowser control, therefore I need .Net 4. Currently, I get an “Attempted to read or write protected memory” exception at Awesomium.WebCore, see stack trace:

    at Awesomium.WebCore.{ctor}(WebCore* , basic_string<wchar_t\,std::char_traits\,std::allocator >* , basic_string<wchar_t\,std::char_traits\,std::allocator >* , basic_string<wchar_t\,std::char_traits\,std::allocator >* , basic_string<wchar_t\,std::char_traits\,std::allocator >* , LogLevel , Boolean , PixelFormat , basic_string<char\,std::char_traits\,std::allocator >* )
    at CjcAwesomiumWrapper.WebCore.Initialize(String cachePath, String cookiePath, String pluginPath, String logPath, LogLevel level, Boolean enablePlugins, PixelFormat pixelFormat, String userAgentOverride)
    at CjcAwesomiumWrapper.WebCore..ctor(String cookiePath, String userAgentOverride)
    at Cjc.ChromiumBrowser.WebBrowser..cctor()

    Reply

Leave a comment