I am trying the new html2 control with my app in place of htmlWindow and it works pretty good except SetPage() appends to a page instead of replacing the content on a page. I found where this is a bug in wxWidgets, http://trac.wxwidgets.org/ticket/13770, but when will this fix be available in wxPython, or is there a simple workaround?
I am trying the new html2 control with my app in place of htmlWindow and
it works pretty good except SetPage() appends to a page instead of
replacing the content on a page. I found where this is a bug in
wxWidgets, wxTrac has been migrated to GitHub Issues - wxWidgets, but when will this
fix be available in wxPython, or is there a simple workaround?
When I do a SetPage to some very simple html, no problem. When I LoadURL from a file, no problem. But when I try to SetPage to the very same html that’s in the file, I get nothing. I’ve tried various values for the second parameter, but it doesn’t seem to matter. Any ideas?
···
On Sunday, July 8, 2012 10:46:48 PM UTC-7, Robin Dunn wrote:
On 7/8/12 11:15 AM, tsmorton wrote:
I am trying the new html2 control with my app in place of htmlWindow and
it works pretty good except SetPage() appends to a page instead of
replacing the content on a page. I found where this is a bug in
Interestingly (Well, to me, anyway!), SetPage() now seems to only work
for simple pages. Is there some magic I'm missing? Here's the code:
[...]
When I do a SetPage to some very simple html, no problem. When I LoadURL
from a file, no problem. But when I try to SetPage to the very same html
that's in the file, I get nothing. I've tried various values for the
second parameter, but it doesn't seem to matter. Any ideas?
It works fine here (OSX, wx 2.95 preview build). Since it appears you are on windows then I'm going to blame the IE control that is being used to render the WebView content. Perhaps the Google JS code is expecting to find some feature or resource on IE that it is not providing in this context, or something like that.
The baseUrl parameter is use for constructing full URLs from a relative URI for additional resources loaded from the page, like images. Your document doesn't have any relative resources, so it probably doesn't matter at all in this case.
Have you noticed this problem with any other "complex" pages? Any that don't involve loading JS code or other resources from a 3rd party website?
As you can probably tell I am guessing a little here. You will be able to reach the people who know this code better via the wx-users mail list.
I think you missed a bit there, Robin… I’d expect to be able to blame the IE backend too, except
that it works flawlessly when used with LoadURL. (Well, flawlessly except that it doesn’t support
HTML5 canvasses, but that’s ANOTHER problem! grin) No, I expect that this is a problem in how
SetPage hands the data over to the HTML2 widget, but it beats me why it wouldn’t happen nearly
the same way that it works with LoadURL. It’s almost as though SetPage is doing some kind of
filtering on the data, above what LoadURL does.
Brian
···
On Wednesday, June 19, 2013 10:41:16 AM UTC-7, Robin Dunn wrote:
Brian Salter wrote:
Interestingly (Well, to me, anyway!), SetPage() now seems to only work
for simple pages. Is there some magic I’m missing? Here’s the code:
[…]
When I do a SetPage to some very simple html, no problem. When I LoadURL
from a file, no problem. But when I try to SetPage to the very same html
that’s in the file, I get nothing. I’ve tried various values for the
second parameter, but it doesn’t seem to matter. Any ideas?
It works fine here (OSX, wx 2.95 preview build). Since it appears you
are on windows then I’m going to blame the IE control that is being used
to render the WebView content. Perhaps the Google JS code is expecting
to find some feature or resource on IE that it is not providing in this
context, or something like that.
The baseUrl parameter is use for constructing full URLs from a relative
URI for additional resources loaded from the page, like images. Your
document doesn’t have any relative resources, so it probably doesn’t
matter at all in this case.
Have you noticed this problem with any other “complex” pages? Any that
don’t involve loading JS code or other resources from a 3rd party website?
As you can probably tell I am guessing a little here. You will be able
to reach the people who know this code better via the wx-users mail list.
I think you missed a bit there, Robin... I'd expect to be able to blame
the IE backend too, except
that it works flawlessly when used with LoadURL. (Well, flawlessly
except that it doesn't support
HTML5 canvasses, but that's ANOTHER problem! *grin*) No, I expect that
this is a problem in how
SetPage hands the data over to the HTML2 widget, but it beats me why it
wouldn't happen nearly
the same way that it works with LoadURL. It's almost as though SetPage
is doing some kind of
filtering on the data, above what LoadURL does.
I didn't miss it, but it didn't fully sink in.
Glancing at the code it looks like the difference between LoadURL and SetPage is that LoadURL simply calls the IE control's Navigate method and SetPage gets a pointer to the view's IHTMLDocument and calls document->write. So they are quite different code paths.
You should ask about this on wx-users or create a ticket at trac.wxwidgets.org, the folks who have a better understanding of the webview classes will see it there.
On Wednesday, June 19, 2013 6:25:09 PM UTC-7, Robin Dunn wrote:
Brian Salter wrote:
I think you missed a bit there, Robin… I’d expect to be able to blame
the IE backend too, except
that it works flawlessly when used with LoadURL. (Well, flawlessly
except that it doesn’t support
HTML5 canvasses, but that’s ANOTHER problem! grin) No, I expect that
this is a problem in how
SetPage hands the data over to the HTML2 widget, but it beats me why it
wouldn’t happen nearly
the same way that it works with LoadURL. It’s almost as though SetPage
is doing some kind of
filtering on the data, above what LoadURL does.
I didn’t miss it, but it didn’t fully sink in.
Glancing at the code it looks like the difference between LoadURL and
SetPage is that LoadURL simply calls the IE control’s Navigate method
and SetPage gets a pointer to the view’s IHTMLDocument and calls
document->write. So they are quite different code paths.
You should ask about this on wx-users or create a ticket at trac.wxwidgets.org, the folks who have a better understanding of the
webview classes will see it there.