[Apple Pay] Provide a better error message when Apple Pay blocks user agent script evaluation
Created attachment 386692 [details] Patch
Comment on attachment 386692 [details] Patch Andy and I discussed some refinements to the error message text IRL.
Comment on attachment 386692 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=386692&action=review > Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp:162 > + return "Unable to run user agent scripts because this document uses Apple Pay. Apple Pay can be disabled in this web view by injecting a WKUserScript."_s; This is confusing. It seems like it's unable to run scripts because of Apple Pay, but running scripts can disable Apple Pay. "user agent scripts" is unclear. I think what you're trying to say is that to run scripts using evaluteJavaScript on pages that try to use Apple Pay, use WKUserScripts to disable Apple Pay. Is that correct?
Created attachment 386698 [details] Patch
(In reply to Alex Christensen from comment #3) > Comment on attachment 386692 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=386692&action=review > > > Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp:162 > > + return "Unable to run user agent scripts because this document uses Apple Pay. Apple Pay can be disabled in this web view by injecting a WKUserScript."_s; > > This is confusing. It seems like it's unable to run scripts because of > Apple Pay, but running scripts can disable Apple Pay. "user agent scripts" > is unclear. It was confusing :( > I think what you're trying to say is that to run scripts using > evaluteJavaScript on pages that try to use Apple Pay, use WKUserScripts to > disable Apple Pay. Is that correct? That's correct.
Posted a new patch with the refinements Brady suggested.
Committed r254015: <https://trac.webkit.org/changeset/254015>
<rdar://problem/58307301>