RESOLVED FIXED209845
Add SPI to make WKUserScripts wait for a notification
https://bugs.webkit.org/show_bug.cgi?id=209845
Summary Add SPI to make WKUserScripts wait for a notification
Alex Christensen
Reported 2020-03-31 20:13:07 PDT
Add SPI to make WKUserScripts wait for a notification
Attachments
Patch (58.82 KB, patch)
2020-03-31 20:15 PDT, Alex Christensen
no flags
Patch (64.40 KB, patch)
2020-03-31 21:36 PDT, Alex Christensen
no flags
Patch (64.83 KB, patch)
2020-03-31 21:50 PDT, Alex Christensen
no flags
Patch (67.40 KB, patch)
2020-04-01 09:11 PDT, Alex Christensen
no flags
Patch (68.41 KB, patch)
2020-04-01 10:24 PDT, Alex Christensen
no flags
Patch (68.58 KB, patch)
2020-04-03 16:42 PDT, Alex Christensen
no flags
Alex Christensen
Comment 1 2020-03-31 20:15:58 PDT
Alex Christensen
Comment 2 2020-03-31 20:16:01 PDT
Alex Christensen
Comment 3 2020-03-31 21:36:29 PDT
EWS Watchlist
Comment 4 2020-03-31 21:37:28 PDT
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
Alex Christensen
Comment 5 2020-03-31 21:50:23 PDT
Alex Christensen
Comment 6 2020-04-01 09:11:06 PDT
Alex Christensen
Comment 7 2020-04-01 10:24:59 PDT
Jeff Miller
Comment 8 2020-04-02 11:24:47 PDT
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?
Alex Christensen
Comment 9 2020-04-02 16:19:17 PDT
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.
Jeff Miller
Comment 10 2020-04-02 17:39:02 PDT
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));
Alex Christensen
Comment 11 2020-04-03 16:42:08 PDT
EWS
Comment 12 2020-04-03 17:44:37 PDT
Committed r259523: <https://trac.webkit.org/changeset/259523> All reviewed patches have been landed. Closing bug and clearing flags on attachment 395416 [details].
Note You need to log in before you can comment on or make changes to this bug.