#14768 closed defect (fixed)

wxWebView::SetPage() doesn't work on Win

Reported by: Temtaime Owned by:
Priority: normal Milestone:
Component: WebView Version: stable-latest
Keywords: Cc:
Blocked By: Blocking:
Patch: no

Description

Subj. I'm used latest svn snapshot. When i do browser->SetPage("<html><body>Hello, world!</body></html>", ""); it displays to me "Navigation is cancelled".

Change History (11)

comment:1 follow-up: Changed 22 months ago by vadz

  • Resolution set to duplicate
  • Status changed from new to closed

There was already a ticket about this, please search before opening new ones.

comment:2 in reply to: ↑ 1 Changed 22 months ago by Temtaime

Replying to vadz:

There was already a ticket about this, please search before opening new ones.

Sorry, but i can't find original ticket.

comment:3 Changed 22 months ago by vadz

  • Milestone 2.9.5 deleted
  • Resolution duplicate deleted
  • Status changed from closed to reopened

Hmm, sorry, I can't find it neither. Yet I distinctly remember reading about this "Navigation cancelled" problem already. I thought it might have been discussed on the mailing list only but I don't find it there neither. Really strange.

Anyhow, does the problem happen in the webview sample? If no, then what does your code do differently? If yes, is there anything special about your system configuration (And what is it, exactly, i.e. OS version/architecture)? This obviously does work for the others so it would be nice if you could debug it at least a little to see what exactly goes wrong.

comment:4 follow-up: Changed 22 months ago by steve_lamerton

  • Resolution set to worksforme
  • Status changed from reopened to closed

I tested this in the sample and it works fine for me. If you can create a patch to reproduce this please feel free to reopen the ticket.

comment:5 in reply to: ↑ 4 Changed 22 months ago by Temtaime

Replying to steve_lamerton:

I tested this in the sample and it works fine for me. If you can create a patch to reproduce this please feel free to reopen the ticket.

Sorry, was a little busy.
I tested sample too and it works, yes. But sample uses virtual file system. When i need to simply load page from string by SetPage method.

comment:6 Changed 22 months ago by Temtaime

I'm tested SetPage on win xp x32 and win 8 x64.
Used GCC.

comment:7 Changed 22 months ago by steve_lamerton

  • Component changed from wxMSW to WebView

I modified the sample to perform a simple call just as above and it still works fine for me. You'll have to create a minimal patch to the sample to create the conditions in which it fails as I can't reproduce it otherwise.

comment:8 Changed 22 months ago by Temtaime

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Okay! I can reproduce the problem.

Problem happens only when doing SetPage when main window creating.
Just put

const char *page = "<html><head><title>File System Example</title>"

"<link rel='stylesheet' type='text/css' href='memory:test.css'>"
"</head><body><h1>Page 3</h1>"
"<p></p>"
"<p>Some text about <a href='memory:page2.htm'>Page 2</a>.</p></body>";

m_browser->SetPage(page, "");

In WebFrame::WebFrame and problem happens.
When it called outside constructor(for example, in on event function). Everything is ok.

comment:9 Changed 22 months ago by Temtaime

Also i found another one bug.

When loading page by SetPage method the page encoding has no effect. So we have abracadabra.

http://pastebin.com/jZqsq3Mg
It works in desktop ie normally. But when i use SetPage it displays "Главная" to me.

comment:10 Changed 22 months ago by steve_lamerton

Ah, I understand now. So the problem is that SetPage will only work when when there is a valid document, i.e. when the page that is being loaded from the constructor has finished. There is nothing we can reasonably do about that so I'll add a note to the SetPage documentation.

For the character encoding I suspect the issue could be that your source code isn't in UTF-8, but it could also be an issue with how SetPage works with strings, could you open a new bug for it? Thanks!

comment:11 Changed 22 months ago by SJL

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [72812]) Document which wxWebView methods must wait for a page load before being called.

Closes #14768

Note: See TracTickets for help on using tickets.