MCPcopy Create free account
hub / github.com/cztomczak/cefpython / OnAfterCreated

Method OnAfterCreated

examples/tutorial.py:141–152  ·  view source on GitHub ↗

Called after a new browser is created.

(self, browser, **_)

Source from the content-addressed store, hash-verified

139
140class GlobalHandler(object):
141 def OnAfterCreated(self, browser, **_):
142 """Called after a new browser is created."""
143 # DOM is not yet loaded. Using js_print at this moment will
144 # throw an error: "Uncaught ReferenceError: js_print is not defined".
145 # We make this error on purpose. This error will be intercepted
146 # in DisplayHandler.OnConsoleMessage.
147 js_print(browser, "Python", "OnAfterCreated",
148 "This will probably never display as DOM is not yet loaded")
149 # Delay print by 0.5 sec, because js_print is not available yet
150 args = [browser, "Python", "OnAfterCreated",
151 "(Delayed) Browser id="+str(browser.GetIdentifier())]
152 threading.Timer(0.5, js_print, args).start()
153
154
155class LoadHandler(object):

Callers

nothing calls this directly

Calls 1

js_printFunction · 0.85

Tested by

no test coverage detected