Add SPI to make WKUserScripts wait for a notification
Created attachment 395124 [details] Patch
<rdar://problem/60342299>
Created attachment 395126 [details] Patch
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Created attachment 395127 [details] Patch
Created attachment 395173 [details] Patch
Created attachment 395183 [details] Patch
Comment on attachment 395183 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=395183&action=review > Source/WebKit/UIProcess/API/APIPageConfiguration.h:193 > + bool m_userScriptsShouldWaitUntilNotification { true }; Shouldn't this default to false?
Comment on attachment 395183 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=395183&action=review >> Source/WebKit/UIProcess/API/APIPageConfiguration.h:193 >> + bool m_userScriptsShouldWaitUntilNotification { true }; > > Shouldn't this default to false? This means that the user script that say to wait until notification should wait for notification. By default user scripts do not say to wait until notification.
Comment on attachment 395183 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=395183&action=review >>> Source/WebKit/UIProcess/API/APIPageConfiguration.h:193 >>> + bool m_userScriptsShouldWaitUntilNotification { true }; >> >> Shouldn't this default to false? > > This means that the user script that say to wait until notification should wait for notification. By default user scripts do not say to wait until notification. I see, I was confused by the name. Maybe this should be something like "m_deferredUserScriptsShouldWaitUntilNotification" to emphasize that it only applies to user scripts that have requested to be deferred, with a similar name for the WKWebViewConfiguration property you're adding. You could also rename the parameter to the new WKUserScript initializer you added, e.g.: - (instancetype)_initWithSource:(NSString *)source injectionTime:(WKUserScriptInjectionTime)injectionTime forMainFrameOnly:(BOOL)forMainFrameOnly legacyWhitelist:(NSArray<NSString *> *)legacyWhitelist legacyBlacklist:(NSArray<NSString *> *)legacyBlacklist associatedURL:(NSURL *)associatedURL contentWorld:(WKContentWorld *)contentWorld deferRunningUntilNotification:(BOOL)deferRunningUntilNotification WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
Created attachment 395416 [details] Patch
Committed r259523: <https://trac.webkit.org/changeset/259523> All reviewed patches have been landed. Closing bug and clearing flags on attachment 395416 [details].