wxPHP wrapping wxWidgets 3.0.0.2
WebView control instantiated OK,
LoadURL() sucessfully completed OK,
edited the rendered HTML with Cut()/Copy()/Paste()/DeleteSelection() OK,
then
GetPageSource() gives me the original HTML source, not the edited HTML source
GetPageText() gives me the original HTML's text, not the edited HTML's text
So how do you get the edited HTML's source or text?
What is the point in being able to edit the HTML if you can't get hold of the new result?
WebView::GetPageSource() returns original HTML
Re: WebView::GetPageSource() returns original HTML
Can anyone just confirm that GetPageSource() returns the HTML of the currently loaded URL and NOT the currently displayed page (as edited)?
Re: WebView::GetPageSource() returns original HTML
I haven't tried it myself, but it sounds normal to me if you only get the original HTML back. I'm more surprised that things like Cut/Paste/Deleteselection work at all.
Have you tried SetEditable()?
Have you tried SetEditable()?
Use the source, Luke!
Re: WebView::GetPageSource() returns original HTML
I have the control SetEditable() - it didn't work without it.
After each edit I use GetPageText() to see what effect that has had on the source HTML, and there is none, although the webView changes as expected.
Without a way to get at the edited source, editing seems pointless
After each edit I use GetPageText() to see what effect that has had on the source HTML, and there is none, although the webView changes as expected.
Without a way to get at the edited source, editing seems pointless
Re: WebView::GetPageSource() returns original HTML
FWIW, I did a simple test:
1. I launched the webview sample and loaded http://www.example.com page.
2. I checked that both source and text of the page match the page content (using sample menu commands View Source and View Text)
3. I checked Edit Mode in Menu/Edit, selected the "white box" with the title and paragraph, and <Del>eted it.
4. I pasted a random text I copied from MSVC build log.
5. I checked the source and text the same way as in #2 and both actually reflected the changes I had made.
If you do the same, do you get the same result?
You did not state which platform and therefore which wxWebView backend you use. I ran the test with wxWidgets 3.1.1 32-bit, IE11 on Win10 64-bit, nothing set for webview.exe in FEATURE_BROWSER_EMULATION.
1. I launched the webview sample and loaded http://www.example.com page.
2. I checked that both source and text of the page match the page content (using sample menu commands View Source and View Text)
3. I checked Edit Mode in Menu/Edit, selected the "white box" with the title and paragraph, and <Del>eted it.
4. I pasted a random text I copied from MSVC build log.
5. I checked the source and text the same way as in #2 and both actually reflected the changes I had made.
If you do the same, do you get the same result?
You did not state which platform and therefore which wxWebView backend you use. I ran the test with wxWidgets 3.1.1 32-bit, IE11 on Win10 64-bit, nothing set for webview.exe in FEATURE_BROWSER_EMULATION.
Re: WebView::GetPageSource() returns original HTML
@OP: Did you manually edit the page or just programmatically using Cut()/Copy()/Paste()/DeleteSelection() ?
Use the source, Luke!