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

Class LoadHandler

examples/snippets/onpagecomplete.py:19–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17
18
19class LoadHandler(object):
20 def OnLoadingStateChange(self, browser, is_loading, **_):
21 """For detecting if page loading has ended it is recommended
22 to use OnLoadingStateChange which is most reliable. The OnLoadEnd
23 callback also available in LoadHandler can sometimes fail in
24 some cases e.g. when image loading hangs."""
25 if not is_loading:
26 self._OnPageComplete(browser)
27
28 def _OnPageComplete(self, browser):
29 print("Page loading is complete!")
30 browser.ExecuteFunction("alert", "Message from Python: Page loading"
31 " is complete!")
32
33
34if __name__ == '__main__':

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected