rdmenezes / cefpython

Automatically exported from code.google.com/p/cefpython
1 stars 0 forks source link

Opening popups causes hang up of the application loop or a crash #45

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of the product are you using? On what operating system?
cefpython1_v0.51 with wxPython
Windows 7 Professional 32bit

The steps to reproduce the problem are:
  1- Open program and load a web page
  2- Open the link in the web page with onclick="window.open()" attribute

I've tried the same page with the old version ( cefpython1_v0.41 ) and the 
window appear without problem.

Anyone can help me?

Thanks

Original issue reported on code.google.com by supporto...@clsystem.it on 4 Jan 2013 at 4:20

GoogleCodeExporter commented 9 years ago
This is not a real bug report, you did not specify what script / example / 
program you run, you did not define what web page you load and you did not 
paste the error message you got when program crashed. Do not post to the issue 
tracker unless you are 100% sure this is a bug, when having doubts use 
cefpyghon group to ask any questions. 

Use cefpython group to ask for help:
https://groups.google.com/group/cefpython?hl=en

Original comment by czarek.t...@gmail.com on 4 Jan 2013 at 4:53

GoogleCodeExporter commented 9 years ago
In cefadvanced.py example there is a global exception handler defined that will 
exit application when javascript error is encountered, the error is logged to 
"error.log" file and displayed in the console (you must run the example using a 
console to see it), to get rid of this behavior you would have to remove "def 
OnUncaughtException()" from ClientHandler class. I will modify cefadvanced 
example in next release so that this exception handler catches errors only for 
the cefadvanced.html page and not for other web pages as this might be 
confusing.

Original comment by czarek.t...@gmail.com on 4 Jan 2013 at 5:06

GoogleCodeExporter commented 9 years ago
Thanks for your reply

I tried to change cefwxpanel.py to show any error message, 
but I can't see anything.

I attach the files that I used to reproduce the problem:
- cefwxpanel_sample1.py
- cefwxpanel.py
- prova.html

I changed cefsimple and cefadvanced to open the prova.html and the problem 
doesn't occur

The version of wxpython is 
"wx.version=2.9.4.0 msw (classic)"

Original comment by supporto...@clsystem.it on 7 Jan 2013 at 10:41

Attachments:

GoogleCodeExporter commented 9 years ago
I can't reproduce the problem using your examples.

You have to run scripts using the console mode (not windowed mode) so that you 
see their output (you should also see any errors in debug.log & error.log 
files).

Original comment by czarek.t...@gmail.com on 7 Jan 2013 at 4:45

GoogleCodeExporter commented 9 years ago
However I see a minor problem with cefwxpanel, when I open popup, close it and 
then close main window, the application seems to be still running.

Original comment by czarek.t...@gmail.com on 7 Jan 2013 at 4:50

GoogleCodeExporter commented 9 years ago
There are problems with popups in wxPython, see Issue 46, it is very likely 
related to your problem.

Original comment by czarek.t...@gmail.com on 8 Jan 2013 at 4:44

GoogleCodeExporter commented 9 years ago
Hi, 
I changed the cefwxpanel.py adding the instructions in CEFWindow class:
javascriptBindings = cefpython.JavascriptBindings(bindToFrames=False, 
bindToPopups=True)
        self.browser.SetJavascriptBindings(javascriptBindings)
With two rows above, the problem doesn't occurs

I hope that the solution can help someone with the same problem

Original comment by supporto...@clsystem.it on 9 Jan 2013 at 8:42

GoogleCodeExporter commented 9 years ago
I noticed another problem with window.open
If in the webpage there is a link that open a new window with window.open 
javascript function and if I add the property "left=100" in the argument of the 
function, the new page is created but it is in background.
I can see it in the window (operating system) application bar and if I move 
over it with mouse I can see the preview with the Aero functionality of window 
7.

Original comment by supporto...@clsystem.it on 9 Jan 2013 at 10:31

GoogleCodeExporter commented 9 years ago
You are right about the javascript bindings, they fix the problem with popup, 
I've reproduced it in cefsimple.py example. I started debugging and seems that 
there is some nasty bug in cefpython as I got this message:

  Fatal Python error: deallocating None

  This application has requested the Runtime to terminate it in an unusual way.
  Please contact the application's support team for more information.

Original comment by czarek.t...@gmail.com on 9 Jan 2013 at 5:17

GoogleCodeExporter commented 9 years ago
It was so hard to debug this error as its behavior is random, 
sometimes it hangs up application, the other time it crashes
app, I've found the root of the problem, but it's also a fault
of Cython that it was hard to debug it, I've reported it on
Cython google group:

https://groups.google.com/d/topic/cython-users/PtVEaKIjyuc/discussion

Original comment by czarek.t...@gmail.com on 9 Jan 2013 at 7:57

GoogleCodeExporter commented 9 years ago
This bug will fixed in next release, a temporary solution is to
set javascript bindings for the browser object as mentioned in
comment 7:

    javascriptBindings = cefpython.JavascriptBindings(
            bindToFrames=False, bindToPopups=False)
    browser.SetJavascriptBindings(javascriptBindings)

Regarding comment 8 and "left=100" property for the popup, you 
should create a separate issue for that bug.

Original comment by czarek.t...@gmail.com on 9 Jan 2013 at 8:07

GoogleCodeExporter commented 9 years ago
Issue 46 has been merged into this issue.

Original comment by czarek.t...@gmail.com on 9 Jan 2013 at 8:10

GoogleCodeExporter commented 9 years ago
Fixed in version v52 that was just released.

Original comment by czarek.t...@gmail.com on 14 Mar 2013 at 2:02