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

Function set_javascript_bindings

examples/tutorial.py:124–132  ·  view source on GitHub ↗
(browser)

Source from the content-addressed store, hash-verified

122
123
124def set_javascript_bindings(browser):
125 external = External(browser)
126 bindings = cef.JavascriptBindings(
127 bindToFrames=False, bindToPopups=False)
128 bindings.SetProperty("python_property", "This property was set in Python")
129 bindings.SetProperty("cefpython_version", cef.GetVersion())
130 bindings.SetFunction("html_to_data_uri", html_to_data_uri)
131 bindings.SetObject("external", external)
132 browser.SetJavascriptBindings(bindings)
133
134
135def js_print(browser, lang, event, msg):

Callers 1

mainFunction · 0.85

Calls 2

SetJavascriptBindingsMethod · 0.80
ExternalClass · 0.70

Tested by

no test coverage detected