Skip to content

Commit 0c1edf0

Browse files
committed
Addded comments in the wxpython.py example on Windows, about the
implication of creating the popup window of our own. The popup window and parent window will not be able to script each other. There will be no "window.opener" property available in the popup window.
1 parent ee26452 commit 0c1edf0

File tree

4 files changed

+36
-10
lines changed

4 files changed

+36
-10
lines changed

cefpython/cef3/windows/binaries_32bit/wxpython.html

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,15 @@ <h2>Popups</h2>
9999
</li>
100100
</ol>
101101

102-
There are problems with keyboard when allow CEF to create popup
103-
windows internally. To create popup window explicitilly, the
104-
LifespanHandler::OnBeforePopup callback was implemented. See its
105-
source:
102+
There are problems with keyboard in wxPython when popup windows are created
103+
by CEF (<a href="https://code.google.com/p/cefpython/issues/detail?id=80">
104+
Issue 80</a>). To create the popup window of our own, the
105+
LifespanHandler::OnBeforePopup callback was implemented. Note that this has
106+
its implications, the popup window and parent window will not be able to
107+
script each other. There will be no "window.opener" property available
108+
in the popup window.
109+
110+
See its source:
106111

107112
<script>ShowSource("OnBeforePopup");</script>
108113
<script>ShowSource("_CreatePopup");</script>

cefpython/cef3/windows/binaries_32bit/wxpython.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,14 +651,22 @@ def OnBeforePopup(self, browser, frame, targetUrl, targetFrameName,
651651
# is created using "window.open" or "target=blank". This issue
652652
# occurs only in wxPython. PyGTK or PyQt do not require this fix.
653653
# The solution is to create window explicitilly, and not depend
654-
# on CEF to create window internally.
654+
# on CEF to create window internally. See Issue 80 for details:
655+
# https://code.google.com/p/cefpython/issues/detail?id=80
656+
655657
# If you set allowPopups=True then CEF will create popup window.
656658
# The wx.Frame cannot be created here, as this callback is
657659
# executed on the IO thread. Window should be created on the UI
658660
# thread. One solution is to call cefpython.CreateBrowser()
659661
# which runs asynchronously and can be called on any thread.
660662
# The other solution is to post a task on the UI thread, so
661663
# that cefpython.CreateBrowserSync() can be used.
664+
665+
# Note that if you return True and create the popup window yourself,
666+
# then the popup window and parent window will not be able to script
667+
# each other. There will be no "window.opener" property available
668+
# in the popup window.
669+
662670
cefpython.PostTask(cefpython.TID_UI, self._CreatePopup, targetUrl)
663671

664672
allowPopups = False

cefpython/cef3/windows/binaries_64bit/wxpython.html

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,15 @@ <h2>Popups</h2>
9999
</li>
100100
</ol>
101101

102-
There are problems with keyboard when allow CEF to create popup
103-
windows internally. To create popup window explicitilly, the
104-
LifespanHandler::OnBeforePopup callback was implemented. See its
105-
source:
102+
There are problems with keyboard in wxPython when popup windows are created
103+
by CEF (<a href="https://code.google.com/p/cefpython/issues/detail?id=80">
104+
Issue 80</a>). To create the popup window of our own, the
105+
LifespanHandler::OnBeforePopup callback was implemented. Note that this has
106+
its implications, the popup window and parent window will not be able to
107+
script each other. There will be no "window.opener" property available
108+
in the popup window.
109+
110+
See its source:
106111

107112
<script>ShowSource("OnBeforePopup");</script>
108113
<script>ShowSource("_CreatePopup");</script>

cefpython/cef3/windows/binaries_64bit/wxpython.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,14 +651,22 @@ def OnBeforePopup(self, browser, frame, targetUrl, targetFrameName,
651651
# is created using "window.open" or "target=blank". This issue
652652
# occurs only in wxPython. PyGTK or PyQt do not require this fix.
653653
# The solution is to create window explicitilly, and not depend
654-
# on CEF to create window internally.
654+
# on CEF to create window internally. See Issue 80 for details:
655+
# https://code.google.com/p/cefpython/issues/detail?id=80
656+
655657
# If you set allowPopups=True then CEF will create popup window.
656658
# The wx.Frame cannot be created here, as this callback is
657659
# executed on the IO thread. Window should be created on the UI
658660
# thread. One solution is to call cefpython.CreateBrowser()
659661
# which runs asynchronously and can be called on any thread.
660662
# The other solution is to post a task on the UI thread, so
661663
# that cefpython.CreateBrowserSync() can be used.
664+
665+
# Note that if you return True and create the popup window yourself,
666+
# then the popup window and parent window will not be able to script
667+
# each other. There will be no "window.opener" property available
668+
# in the popup window.
669+
662670
cefpython.PostTask(cefpython.TID_UI, self._CreatePopup, targetUrl)
663671

664672
allowPopups = False

0 commit comments

Comments
 (0)