void DOMWindowExtensionBasic::initialize(WKBundleRef bundle, WKTypeRef userData) { assert(WKGetTypeID(userData) == WKBundlePageGroupGetTypeID()); WKBundlePageGroupRef pageGroup = static_cast<WKBundlePageGroupRef>(userData); WKRetainPtr<WKStringRef> source(AdoptWK, WKStringCreateWithUTF8CString("alert('Unimportant alert');")); WKBundleAddUserScript(bundle, pageGroup, WKBundleScriptWorldCreateWorld(), source.get(), 0, 0, 0, kWKInjectAtDocumentStart, kWKInjectInAllFrames); }
virtual void initialize(WKBundleRef bundle, WKTypeRef userData) { assert(WKGetTypeID(userData) == WKBundlePageGroupGetTypeID()); WKBundlePageGroupRef pageGroup = static_cast<WKBundlePageGroupRef>(userData); WKRetainPtr<WKStringRef> source(AdoptWK, WKStringCreateWithUTF8CString("alert('an alert');")); WKBundleAddUserScript(bundle, pageGroup, WKBundleScriptWorldNormalWorld(), source.get(), 0, 0, 0, kWKInjectAtDocumentStart, kWKInjectInAllFrames); }