Open blkslimer opened 10 years ago
I just tried in Linux 64 bits with start_url equal to a URL with parameter and It is working. On which platform did you encounter the problem ? Is it working without param ?
I have the problem with Windows 7 x64. Without parameters everything works fine. Below is the start browser log:
cefpython: ------------------------------------------------------------ cefpython: Initialize() called cefpython: CefExecuteProcess(): exitCode = -1 cefpython: CefInitialize() ... ... ... ... ... ... cefpython: CreateBrowserSync() called cefpython: CefBrowser::CreateBrowserSync() cefpython: GetPyBrowser(): creating new PyBrowser, browserId=1 cefpython: BrowserProcessHandler_OnBeforeChildProcessLaunch() [0129/182610:ERROR_REPORT:render_widget_host_view_osr.cc(268)] Check failed: false. cefpython: CefBrowser::CreateBrowserSync() succeeded cefpython: SendProcessMessage(): message=DoJavascriptBindings, arguments size=1 request_keyboard() [INFO ] [GL ] BGRA texture support is available cefpython: Browser: OnProcessMessageReceived(): OnContextCreated cefpython: V8ContextHandler_OnContextCreated() _fix_select_boxes() OnLoadingStateChange(): isLoading = False
Let me know if you need some other test.
Thank you
I've tested loading url with hash in cefclient on Win7 64 and it works fine.
The logs you've pasted miss the crucial part about the url being loaded.
How did you end up with the conclusion that the hash in the url is not working? What exactly is not working? You did not specify. Most probably it is just your javascript not working.
I need a HTML parser that given a HTML string to render it. For example i need to display a string like "
For now i want to use an empty page and pass the string as parameter. This is the html test page:
TESTso there is no javascript inside. I've done the following tests:
Why don't you just call an external HTML file ? You can host it on a local web server or just call the file:/// protocol. I tried under Ubuntu 13.10 64 bits, it is working. If you need to render things dynamically, it is a different story.
Now from the logs I see what the problem is. Local file:// urls are encoded with pathname2url() to support unicode (chinese) characters, and it encodes the hash by accident. Created issue 114 in cefpython: https://code.google.com/p/cefpython/issues/detail?id=114
The solution is to load a "http" url, hashes in that case will work fine.
Or you can load a html string instead of the url. Load "about:blank" url in the browser and later call browser.GetMainFrame().LoadString(myhtml).
Sorry for the dumb question, but how do you call browser.GetMainFrame().LoadString(myhtml)
?
from kivy.garden.cefpython import CefBrowser, cefpython
from kivy.app import App
class CefBrowserApp(App):
def build(self):
cefbrowser =CefBrowser(start_url='about:blank')
myhtml = "<html><head></head><body>Hello world</body></html>"
cefbrowser.browser.GetMainFrame().LoadString(myhtml)
return cefbrowser
CefBrowserApp().run()
cefpython.Shutdown()
and the result:
AttributeError: 'CefBrowser' object has no attribute 'browser''
Thanks!
Hi,
Using query string inside browser start_url not working. There is some other way to pass parameter inside url?
class CefBrowserApp(App): def build(self): return CefBrowser(start_url='http://kivy.org?par1=val1&par2=val2')
Thanks