void Bundle::didClearWindowForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleScriptWorldRef world, const void *clientInfo) { JSGlobalContextRef context = WKBundleFrameGetJavaScriptContextForWorld(frame, world); Bundle* bundle = ((Bundle*)clientInfo); bundle->m_jsContext = context; bundle->m_windowObj = JSContextGetGlobalObject(context); bundle->registerAPI(); }