This project is read-only.

Upgraded to 1.5.1, files no longer load

May 26, 2010 at 4:19 AM

I was using a version of AwesomiumDotNet from lord knows when (I found it a while back, possibly before there was a CodePlex project) and it was working fine. I decided I wanted to upgrade to Awesomium 1.5.1 to get some new features, so I grabbed the 41492 version of AwesomiumDotNet, built it just fine, and started using it. Everything works except I can no longer use LoadFile; it just gives me a blank page. However I can use LoadHtml and LoadUrl without issues.

Any idea what changes came through in Awesomium that would break LoadFile but nothing else? I haven't changed my app's code at all (other than where necessary due to breaking API changes), so I don't know what might be causing this. I tried using verbose logging, but I didn't see any errors in there. I'm at a bit of a loss as to what's going on. Any help is appreciated.

May 26, 2010 at 3:15 PM
I ran into the same problem recently. It helped if I explicitly set the transparency of the webview to false. See if that works. Thanks for the feedback!
May 26, 2010 at 4:11 PM

I was already setting transparency to false for the view. Any other ideas?

May 27, 2010 at 10:12 PM This thread suggests that when using alpha blending and not transparency, then the alpha channel should be set to 0xff manually. Can you try this?
May 28, 2010 at 3:04 AM

Nope, that's not the issue. Like I mentioned above, I can load and render without issue and I can also use LoadHtml with "<p>Testing</p>" and it renders fine as well. My only issue is when trying to use LoadFile to load a local file. I'm not sure if it's not finding the file or if there's an error with it or anything since there's nothing in the log to indicate an error.

May 28, 2010 at 5:28 AM

Looks like a bug in WebCore.BaseDirectory or in some code that uses it. Basically I was setting this to be the root of my UI folders so I could use relative paths. This all worked pre-1.5.1. In the new version, I removed my call to set that directory and instead simply used absolute paths for my HTML files. It still seems to allow my HTML files to use local paths to JavaScripts and images, so I don't think there's much harm done. At least things are rendering now, though I'd suggest perhaps investigating that LoadFile and BaseDirectory are working properly together.

May 28, 2010 at 7:18 AM

I did check the BaseDirectory and LoadFile functions, but couldn't find anything suspicious.

However, when using LoadFile, I found that I had to set opacity to a high level so that text wouldn't be rendered transparently. See what happens when you load a file like this:

    <p style="color: red; opacity: 0.9;">Testing</p>

May 28, 2010 at 7:30 AM

I'm able to use LoadFile just fine now without having to set the opacity once I started passing in full, absolute paths to LoadFile and leaving BaseDirectory alone. Once I set BaseDirectory, I am unable to use LoadFile at all as it just doesn't seem to find the files. Even a simple blank page with a colored background (using a non-transparent rendering) failed to show up correctly.