Changeset 243324 in webkit
- Timestamp:
- Mar 21, 2019, 1:51:56 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 42 edited
- 2 copied
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/applepay/ApplePayRequestBase.cpp (modified) (4 diffs)
-
Source/WebCore/Modules/applepay/ApplePayRequestBase.h (modified) (2 diffs)
-
Source/WebCore/Modules/applepay/ApplePaySession.cpp (modified) (13 diffs)
-
Source/WebCore/Modules/applepay/ApplePaySession.h (modified) (2 diffs)
-
Source/WebCore/Modules/applepay/ApplePaySession.idl (modified) (2 diffs)
-
Source/WebCore/Modules/applepay/PaymentCoordinator.cpp (modified) (5 diffs)
-
Source/WebCore/Modules/applepay/PaymentCoordinator.h (modified) (4 diffs)
-
Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h (modified) (2 diffs)
-
Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp (modified) (4 diffs)
-
Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.h (modified) (2 diffs)
-
Source/WebCore/Modules/paymentrequest/PaymentHandler.h (modified) (2 diffs)
-
Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp (modified) (3 diffs)
-
Source/WebCore/bindings/js/ScriptController.cpp (modified) (3 diffs)
-
Source/WebCore/bindings/js/ScriptController.h (modified) (2 diffs)
-
Source/WebCore/dom/Document.cpp (modified) (2 diffs)
-
Source/WebCore/dom/Document.h (modified) (3 diffs)
-
Source/WebCore/loader/DocumentThreadableLoader.cpp (modified) (1 diff)
-
Source/WebCore/page/Frame.cpp (modified) (2 diffs)
-
Source/WebCore/page/Settings.yaml (modified) (1 diff)
-
Source/WebCore/page/SettingsDefaultValues.h (modified) (2 diffs)
-
Source/WebCore/testing/Internals.cpp (modified) (1 diff)
-
Source/WebCore/testing/Internals.h (modified) (1 diff)
-
Source/WebCore/testing/Internals.idl (modified) (1 diff)
-
Source/WebCore/testing/MockPaymentCoordinator.h (modified) (3 diffs)
-
Source/WebCore/testing/MockPaymentCoordinator.idl (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/Shared/AuxiliaryProcess.h (modified) (2 diffs)
-
Source/WebKit/Shared/Cocoa/AuxiliaryProcessCocoa.mm (modified) (3 diffs)
-
Source/WebKit/Shared/WebPreferences.yaml (modified) (1 diff)
-
Source/WebKit/Shared/WebPreferencesDefaultValues.h (modified) (2 diffs)
-
Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm (modified) (1 diff)
-
Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp (modified) (1 diff)
-
Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h (modified) (1 diff)
-
Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h (modified) (1 diff)
-
Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm (modified) (3 diffs)
-
Source/WebKit/WebProcess/WebPage/WebPage.cpp (modified) (1 diff)
-
Source/WebKitLegacy/mac/ChangeLog (modified) (1 diff)
-
Source/WebKitLegacy/mac/WebView/WebFrame.mm (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (modified) (11 diffs)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/ApplePay.mm (added)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/apple-pay-active-session.html (added)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/apple-pay-availability-in-iframe.html (added)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/apple-pay-availability.html (added)
-
Tools/TestWebKitAPI/cocoa/TestProtocol.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/WebProcessPlugInWithInternals.h (copied) (copied from trunk/Source/WebKit/Shared/Cocoa/AuxiliaryProcessCocoa.mm ) (2 diffs)
-
Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/WebProcessPlugInWithInternals.mm (copied) (copied from trunk/Source/WebKit/Shared/Cocoa/AuxiliaryProcessCocoa.mm ) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r243319 r243324 1 2019-03-21 Andy Estes <aestes@apple.com> 2 3 [iOS] Apple Pay should be available in documents with no user agent scripts 4 https://bugs.webkit.org/show_bug.cgi?id=196061 5 <rdar://problem/48649391> 6 7 Reviewed by Brady Eidson. 8 9 On platforms that support APPLE_PAY_REMOTE_UI, we can enable Apple Pay JS and Payment Request 10 by default in all WebKit clients. 11 12 In order to protect the privacy of Apple Pay transactions, this patch implements the 13 following restrictions on API usage: 14 15 1. If user agent scripts have been evaluated in a document, Apple Pay APIs will no longer be 16 available for the duration of the document's lifetime. 17 2. If an Apple Pay transaction has started in a document, user agent scripts will no longer 18 be evaluated for the duration of the document's lifetime. 19 20 These restrictions are disabled for clients with the 21 com.apple.private.WebKit.UnrestrictedApplePay entitlement and platforms that do support 22 Apple Pay but don't support APPLE_PAY_REMOTE_UI. 23 24 Added new API tests. 25 26 * Modules/applepay/ApplePayRequestBase.cpp: 27 (WebCore::convertAndValidate): 28 * Modules/applepay/ApplePayRequestBase.h: 29 * Modules/applepay/ApplePaySession.cpp: 30 (WebCore::convertAndValidate): 31 (WebCore::ApplePaySession::create): 32 (WebCore::ApplePaySession::supportsVersion): 33 (WebCore::ApplePaySession::canMakePayments): 34 (WebCore::ApplePaySession::canMakePaymentsWithActiveCard): 35 (WebCore::ApplePaySession::openPaymentSetup): 36 (WebCore::ApplePaySession::begin): 37 * Modules/applepay/ApplePaySession.h: 38 * Modules/applepay/ApplePaySession.idl: 39 * Modules/applepay/PaymentCoordinator.cpp: 40 (WebCore::PaymentCoordinator::supportsVersion const): 41 (WebCore::PaymentCoordinator::canMakePayments): 42 (WebCore::PaymentCoordinator::canMakePaymentsWithActiveCard): 43 (WebCore::PaymentCoordinator::openPaymentSetup): 44 (WebCore::PaymentCoordinator::beginPaymentSession): 45 (WebCore::PaymentCoordinator::validatedPaymentNetwork const): 46 (WebCore::PaymentCoordinator::shouldAllowApplePay const): 47 (WebCore::PaymentCoordinator::shouldAllowUserAgentScripts const): 48 * Modules/applepay/PaymentCoordinator.h: 49 * Modules/applepay/PaymentCoordinatorClient.h: 50 (WebCore::PaymentCoordinatorClient::supportsUnrestrictedApplePay const): 51 * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: 52 (WebCore::ApplePayPaymentHandler::show): 53 (WebCore::ApplePayPaymentHandler::canMakePayment): 54 (WebCore::ApplePayPaymentHandler::version const): 55 * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: 56 * Modules/paymentrequest/PaymentHandler.h: 57 * Modules/paymentrequest/PaymentRequest.cpp: 58 (WebCore::PaymentRequest::show): 59 (WebCore::PaymentRequest::canMakePayment): 60 61 Plumbed a Document& through to the various places that call into PaymentCoordinator for use 62 by shouldAllowApplePay and shouldAllowUserAgentScripts. 63 64 * bindings/js/ScriptController.cpp: 65 (WebCore::ScriptController::executeUserAgentScriptInWorld): 66 (WebCore::ScriptController::shouldAllowUserAgentScripts const): 67 * bindings/js/ScriptController.h: 68 69 Added executeUserAgentScriptInWorld, which calls executeScriptInWorld if allowed. 70 71 * dom/Document.cpp: 72 (WebCore::Document::ensurePlugInsInjectedScript): 73 74 Changed to only evaluate the chrome client's plug-in extra script if allowed, and to mark 75 the document as having evaluated user agent scripts. 76 77 (WebCore::Document::hasEvaluatedUserAgentScripts const): 78 (WebCore::Document::isRunningUserScripts const): 79 (WebCore::Document::setAsRunningUserScripts): 80 (WebCore::Document::setHasEvaluatedUserAgentScripts): 81 (WebCore::Document::hasStartedApplePaySession const): 82 (WebCore::Document::setHasStartedApplePaySession): 83 * dom/Document.h: 84 85 Added helper functions to set state on the top document. 86 87 * loader/DocumentThreadableLoader.cpp: 88 (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): 89 90 Removed call to topDocument() now that isRunningUserScripts() always checks the top document. 91 92 * page/Frame.cpp: 93 (WebCore::Frame::injectUserScriptImmediately): 94 95 Changed to only inject the user script if allowed. 96 97 * page/Settings.yaml: 98 * page/SettingsDefaultValues.h: 99 100 Enabled Apple Pay by default on platforms that enable APPLE_PAY_REMOTE_UI. 101 102 * testing/Internals.cpp: 103 (WebCore::Internals::setAsRunningUserScripts): 104 (WebCore::Internals::setHasStartedApplePaySession): 105 * testing/Internals.h: 106 * testing/Internals.idl: 107 * testing/MockPaymentCoordinator.h: 108 * testing/MockPaymentCoordinator.idl: 109 110 Added some internal interfaces for use by TestWebKitAPI. 111 1 112 2019-03-21 Alex Christensen <achristensen@webkit.org> 2 113 -
trunk/Source/WebCore/Modules/applepay/ApplePayRequestBase.cpp
r241105 r243324 34 34 namespace WebCore { 35 35 36 static ExceptionOr<Vector<String>> convertAndValidate( unsigned version, const Vector<String>& supportedNetworks, const PaymentCoordinator& paymentCoordinator)36 static ExceptionOr<Vector<String>> convertAndValidate(Document& document, unsigned version, const Vector<String>& supportedNetworks, const PaymentCoordinator& paymentCoordinator) 37 37 { 38 38 if (supportedNetworks.isEmpty()) … … 42 42 result.reserveInitialCapacity(supportedNetworks.size()); 43 43 for (auto& supportedNetwork : supportedNetworks) { 44 auto validatedNetwork = paymentCoordinator.validatedPaymentNetwork( version, supportedNetwork);44 auto validatedNetwork = paymentCoordinator.validatedPaymentNetwork(document, version, supportedNetwork); 45 45 if (!validatedNetwork) 46 46 return Exception { TypeError, makeString("\"", supportedNetwork, "\" is not a valid payment network.") }; … … 51 51 } 52 52 53 ExceptionOr<ApplePaySessionPaymentRequest> convertAndValidate( unsigned version, ApplePayRequestBase& request, const PaymentCoordinator& paymentCoordinator)53 ExceptionOr<ApplePaySessionPaymentRequest> convertAndValidate(Document& document, unsigned version, ApplePayRequestBase& request, const PaymentCoordinator& paymentCoordinator) 54 54 { 55 if (!version || !paymentCoordinator.supportsVersion( version))55 if (!version || !paymentCoordinator.supportsVersion(document, version)) 56 56 return Exception { InvalidAccessError, makeString('"', version, "\" is not a supported version.") }; 57 57 … … 65 65 result.setMerchantCapabilities(merchantCapabilities.releaseReturnValue()); 66 66 67 auto supportedNetworks = convertAndValidate( version, request.supportedNetworks, paymentCoordinator);67 auto supportedNetworks = convertAndValidate(document, version, request.supportedNetworks, paymentCoordinator); 68 68 if (supportedNetworks.hasException()) 69 69 return supportedNetworks.releaseException(); -
trunk/Source/WebCore/Modules/applepay/ApplePayRequestBase.h
r241105 r243324 34 34 namespace WebCore { 35 35 36 class Document; 36 37 class PaymentCoordinator; 37 38 … … 51 52 }; 52 53 53 ExceptionOr<ApplePaySessionPaymentRequest> convertAndValidate( unsigned version, ApplePayRequestBase&, const PaymentCoordinator&);54 ExceptionOr<ApplePaySessionPaymentRequest> convertAndValidate(Document&, unsigned version, ApplePayRequestBase&, const PaymentCoordinator&); 54 55 55 56 } // namespace WebCore -
trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp
r241130 r243324 208 208 } 209 209 210 static ExceptionOr<ApplePaySessionPaymentRequest> convertAndValidate( unsigned version, ApplePayPaymentRequest&& paymentRequest, const PaymentCoordinator& paymentCoordinator)211 { 212 auto convertedRequest = convertAndValidate( version, paymentRequest, paymentCoordinator);210 static ExceptionOr<ApplePaySessionPaymentRequest> convertAndValidate(Document& document, unsigned version, ApplePayPaymentRequest&& paymentRequest, const PaymentCoordinator& paymentCoordinator) 211 { 212 auto convertedRequest = convertAndValidate(document, version, paymentRequest, paymentCoordinator); 213 213 if (convertedRequest.hasException()) 214 214 return convertedRequest.releaseException(); … … 400 400 return Exception { InvalidAccessError, "Frame is detached" }; 401 401 402 auto convertedPaymentRequest = convertAndValidate( version, WTFMove(paymentRequest), document.page()->paymentCoordinator());402 auto convertedPaymentRequest = convertAndValidate(document, version, WTFMove(paymentRequest), document.page()->paymentCoordinator()); 403 403 if (convertedPaymentRequest.hasException()) 404 404 return convertedPaymentRequest.releaseException(); … … 412 412 , m_version { version } 413 413 { 414 ASSERT(document.page()->paymentCoordinator().supportsVersion( version));414 ASSERT(document.page()->paymentCoordinator().supportsVersion(document, version)); 415 415 suspendIfNeeded(); 416 416 } … … 418 418 ApplePaySession::~ApplePaySession() = default; 419 419 420 ExceptionOr<bool> ApplePaySession::supportsVersion( ScriptExecutionContext& scriptExecutionContext, unsigned version)420 ExceptionOr<bool> ApplePaySession::supportsVersion(Document& document, unsigned version) 421 421 { 422 422 if (!version) 423 423 return Exception { InvalidAccessError }; 424 425 auto& document = downcast<Document>(scriptExecutionContext);426 424 427 425 auto canCall = canCreateSession(document); … … 433 431 return Exception { InvalidAccessError }; 434 432 435 return page->paymentCoordinator().supportsVersion( version);433 return page->paymentCoordinator().supportsVersion(document, version); 436 434 } 437 435 … … 445 443 } 446 444 447 ExceptionOr<bool> ApplePaySession::canMakePayments(ScriptExecutionContext& scriptExecutionContext) 448 { 449 auto& document = downcast<Document>(scriptExecutionContext); 450 445 ExceptionOr<bool> ApplePaySession::canMakePayments(Document& document) 446 { 451 447 auto canCall = canCreateSession(document); 452 448 if (canCall.hasException()) … … 457 453 return Exception { InvalidAccessError }; 458 454 459 return page->paymentCoordinator().canMakePayments(); 460 } 461 462 ExceptionOr<void> ApplePaySession::canMakePaymentsWithActiveCard(ScriptExecutionContext& scriptExecutionContext, const String& merchantIdentifier, Ref<DeferredPromise>&& passedPromise) 463 { 464 auto& document = downcast<Document>(scriptExecutionContext); 465 455 return page->paymentCoordinator().canMakePayments(document); 456 } 457 458 ExceptionOr<void> ApplePaySession::canMakePaymentsWithActiveCard(Document& document, const String& merchantIdentifier, Ref<DeferredPromise>&& passedPromise) 459 { 466 460 auto canCall = canCreateSession(document); 467 461 if (canCall.hasException()) … … 475 469 476 470 auto& paymentCoordinator = page->paymentCoordinator(); 477 bool canMakePayments = paymentCoordinator.canMakePayments( );471 bool canMakePayments = paymentCoordinator.canMakePayments(document); 478 472 479 473 RunLoop::main().dispatch([promise, canMakePayments]() mutable { … … 489 483 auto& paymentCoordinator = page->paymentCoordinator(); 490 484 491 paymentCoordinator.canMakePaymentsWithActiveCard( merchantIdentifier, document.domain(), [promise](bool canMakePayments) mutable {485 paymentCoordinator.canMakePaymentsWithActiveCard(document, merchantIdentifier, [promise](bool canMakePayments) mutable { 492 486 promise->resolve<IDLBoolean>(canMakePayments); 493 487 }); … … 495 489 } 496 490 497 ExceptionOr<void> ApplePaySession::openPaymentSetup(ScriptExecutionContext& scriptExecutionContext, const String& merchantIdentifier, Ref<DeferredPromise>&& passedPromise) 498 { 499 auto& document = downcast<Document>(scriptExecutionContext); 500 491 ExceptionOr<void> ApplePaySession::openPaymentSetup(Document& document, const String& merchantIdentifier, Ref<DeferredPromise>&& passedPromise) 492 { 501 493 auto canCall = canCreateSession(document); 502 494 if (canCall.hasException()) … … 513 505 514 506 RefPtr<DeferredPromise> promise(WTFMove(passedPromise)); 515 paymentCoordinator.openPaymentSetup( merchantIdentifier, document.domain(), [promise](bool result) mutable {507 paymentCoordinator.openPaymentSetup(document, merchantIdentifier, [promise](bool result) mutable { 516 508 promise->resolve<IDLBoolean>(result); 517 509 }); … … 520 512 } 521 513 522 ExceptionOr<void> ApplePaySession::begin( )514 ExceptionOr<void> ApplePaySession::begin(Document& document) 523 515 { 524 516 if (!canBegin()) … … 528 520 return Exception { InvalidAccessError, "Page already has an active payment session." }; 529 521 530 auto& document = *downcast<Document>(scriptExecutionContext()); 531 532 Vector<URL> linkIconURLs; 533 for (auto& icon : LinkIconCollector { document }.iconsOfTypes({ LinkIconType::TouchIcon, LinkIconType::TouchPrecomposedIcon })) 534 linkIconURLs.append(icon.url); 535 536 if (!paymentCoordinator().beginPaymentSession(*this, document.url(), linkIconURLs, m_paymentRequest)) 522 if (!paymentCoordinator().beginPaymentSession(document, *this, m_paymentRequest)) 537 523 return Exception { InvalidAccessError, "There is already has an active payment session." }; 538 524 -
trunk/Source/WebCore/Modules/applepay/ApplePaySession.h
r238771 r243324 1 1 /* 2 * Copyright (C) 2015 , 2016Apple Inc. All rights reserved.2 * Copyright (C) 2015-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 72 72 static const unsigned short STATUS_PIN_LOCKOUT = 7; 73 73 74 static ExceptionOr<bool> supportsVersion( ScriptExecutionContext&, unsigned version);75 static ExceptionOr<bool> canMakePayments( ScriptExecutionContext&);76 static ExceptionOr<void> canMakePaymentsWithActiveCard( ScriptExecutionContext&, const String& merchantIdentifier, Ref<DeferredPromise>&&);77 static ExceptionOr<void> openPaymentSetup( ScriptExecutionContext&, const String& merchantIdentifier, Ref<DeferredPromise>&&);74 static ExceptionOr<bool> supportsVersion(Document&, unsigned version); 75 static ExceptionOr<bool> canMakePayments(Document&); 76 static ExceptionOr<void> canMakePaymentsWithActiveCard(Document&, const String& merchantIdentifier, Ref<DeferredPromise>&&); 77 static ExceptionOr<void> openPaymentSetup(Document&, const String& merchantIdentifier, Ref<DeferredPromise>&&); 78 78 79 ExceptionOr<void> begin( );79 ExceptionOr<void> begin(Document&); 80 80 ExceptionOr<void> abort(); 81 81 ExceptionOr<void> completeMerchantValidation(JSC::ExecState&, JSC::JSValue merchantSession); -
trunk/Source/WebCore/Modules/applepay/ApplePaySession.idl
r237717 r243324 1 1 /* 2 * Copyright (C) 2015-201 7Apple Inc. All rights reserved.2 * Copyright (C) 2015-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 41 41 const unsigned short STATUS_PIN_LOCKOUT = 7; 42 42 43 [CallWith= ScriptExecutionContext, MayThrowException] static boolean supportsVersion(unsigned long version);44 [CallWith= ScriptExecutionContext, MayThrowException] static boolean canMakePayments();45 [CallWith= ScriptExecutionContext, MayThrowException] static Promise<boolean> canMakePaymentsWithActiveCard(DOMString merchantIdentifier);46 [CallWith= ScriptExecutionContext, MayThrowException] static Promise<boolean> openPaymentSetup(DOMString merchantIdentifier);43 [CallWith=Document, MayThrowException] static boolean supportsVersion(unsigned long version); 44 [CallWith=Document, MayThrowException] static boolean canMakePayments(); 45 [CallWith=Document, MayThrowException] static Promise<boolean> canMakePaymentsWithActiveCard(DOMString merchantIdentifier); 46 [CallWith=Document, MayThrowException] static Promise<boolean> openPaymentSetup(DOMString merchantIdentifier); 47 47 48 [ MayThrowException] void begin();48 [CallWith=Document, MayThrowException] void begin(); 49 49 [MayThrowException] void abort(); 50 50 [MayThrowException, CallWith=ExecState] void completeMerchantValidation(any merchantSession); -
trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp
r242681 r243324 1 1 /* 2 * Copyright (C) 2015-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2015-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 29 29 #if ENABLE(APPLE_PAY) 30 30 31 #include "Document.h" 32 #include "LinkIconCollector.h" 31 33 #include "PaymentAuthorizationStatus.h" 32 34 #include "PaymentCoordinatorClient.h" … … 47 49 } 48 50 49 bool PaymentCoordinator::supportsVersion(unsigned version) const 50 { 51 bool PaymentCoordinator::supportsVersion(Document& document, unsigned version) const 52 { 53 if (!shouldAllowApplePay(document)) 54 return false; 51 55 return m_client.supportsVersion(version); 52 56 } 53 57 54 bool PaymentCoordinator::canMakePayments() 55 { 58 bool PaymentCoordinator::canMakePayments(Document& document) 59 { 60 if (!shouldAllowApplePay(document)) 61 return false; 56 62 return m_client.canMakePayments(); 57 63 } 58 64 59 void PaymentCoordinator::canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler) 60 { 61 m_client.canMakePaymentsWithActiveCard(merchantIdentifier, domainName, WTFMove(completionHandler)); 62 } 63 64 void PaymentCoordinator::openPaymentSetup(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler) 65 { 66 m_client.openPaymentSetup(merchantIdentifier, domainName, WTFMove(completionHandler)); 67 } 68 69 bool PaymentCoordinator::beginPaymentSession(PaymentSession& paymentSession, const URL& originatingURL, const Vector<URL>& linkIconURLs, const ApplePaySessionPaymentRequest& paymentRequest) 65 void PaymentCoordinator::canMakePaymentsWithActiveCard(Document& document, const String& merchantIdentifier, WTF::Function<void(bool)>&& completionHandler) 66 { 67 if (!shouldAllowApplePay(document)) 68 return completionHandler(false); 69 m_client.canMakePaymentsWithActiveCard(merchantIdentifier, document.domain(), WTFMove(completionHandler)); 70 } 71 72 void PaymentCoordinator::openPaymentSetup(Document& document, const String& merchantIdentifier, WTF::Function<void(bool)>&& completionHandler) 73 { 74 if (!shouldAllowApplePay(document)) 75 return completionHandler(false); 76 m_client.openPaymentSetup(merchantIdentifier, document.domain(), WTFMove(completionHandler)); 77 } 78 79 bool PaymentCoordinator::beginPaymentSession(Document& document, PaymentSession& paymentSession, const ApplePaySessionPaymentRequest& paymentRequest) 70 80 { 71 81 ASSERT(!m_activeSession); 72 82 73 if (!m_client.showPaymentUI(originatingURL, linkIconURLs, paymentRequest)) 83 if (!shouldAllowApplePay(document)) 84 return false; 85 86 Vector<URL> linkIconURLs; 87 for (auto& icon : LinkIconCollector { document }.iconsOfTypes({ LinkIconType::TouchIcon, LinkIconType::TouchPrecomposedIcon })) 88 linkIconURLs.append(icon.url); 89 90 if (!m_client.showPaymentUI(document.url(), linkIconURLs, paymentRequest)) 74 91 return false; 75 92 76 93 m_activeSession = &paymentSession; 94 document.setHasStartedApplePaySession(); 77 95 return true; 78 96 } … … 196 214 } 197 215 198 Optional<String> PaymentCoordinator::validatedPaymentNetwork(unsigned version, const String& paymentNetwork) const 199 { 216 Optional<String> PaymentCoordinator::validatedPaymentNetwork(Document& document, unsigned version, const String& paymentNetwork) const 217 { 218 if (!shouldAllowApplePay(document)) 219 return WTF::nullopt; 220 200 221 if (version < 2 && equalIgnoringASCIICase(paymentNetwork, "jcb")) 201 222 return WTF::nullopt; … … 207 228 } 208 229 230 bool PaymentCoordinator::shouldAllowApplePay(Document& document) const 231 { 232 if (m_client.supportsUnrestrictedApplePay()) 233 return true; 234 235 if (document.hasEvaluatedUserAgentScripts() || document.isRunningUserScripts()) { 236 ASSERT(shouldAllowUserAgentScripts(document)); 237 return false; 238 } 239 240 return true; 241 } 242 243 bool PaymentCoordinator::shouldAllowUserAgentScripts(Document& document) const 244 { 245 if (m_client.supportsUnrestrictedApplePay()) 246 return true; 247 248 if (document.hasStartedApplePaySession()) { 249 ASSERT(shouldAllowApplePay(document)); 250 return false; 251 } 252 253 return true; 254 } 255 209 256 } // namespace WebCore 210 257 -
trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.h
r241183 r243324 1 1 /* 2 * Copyright (C) 2015-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2015-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 33 33 namespace WebCore { 34 34 35 class Document; 35 36 class Payment; 36 37 class PaymentCoordinatorClient; … … 53 54 PaymentCoordinatorClient& client() { return m_client; } 54 55 55 bool supportsVersion( unsigned version) const;56 bool canMakePayments( );57 void canMakePaymentsWithActiveCard( const String& merchantIdentifier, const String& domainName, WTF::Function<void(bool)>&& completionHandler);58 void openPaymentSetup( const String& merchantIdentifier, const String& domainName, WTF::Function<void(bool)>&& completionHandler);56 bool supportsVersion(Document&, unsigned version) const; 57 bool canMakePayments(Document&); 58 void canMakePaymentsWithActiveCard(Document&, const String& merchantIdentifier, WTF::Function<void(bool)>&& completionHandler); 59 void openPaymentSetup(Document&, const String& merchantIdentifier, WTF::Function<void(bool)>&& completionHandler); 59 60 60 61 bool hasActiveSession() const { return m_activeSession; } 61 62 62 bool beginPaymentSession( PaymentSession&, const URL& originatingURL, const Vector<URL>& linkIconURLs, const ApplePaySessionPaymentRequest&);63 bool beginPaymentSession(Document&, PaymentSession&, const ApplePaySessionPaymentRequest&); 63 64 void completeMerchantValidation(const PaymentMerchantSession&); 64 65 void completeShippingMethodSelection(Optional<ShippingMethodUpdate>&&); … … 76 77 WEBCORE_EXPORT void didCancelPaymentSession(); 77 78 78 Optional<String> validatedPaymentNetwork(unsigned version, const String&) const; 79 Optional<String> validatedPaymentNetwork(Document&, unsigned version, const String&) const; 80 81 WEBCORE_EXPORT bool shouldAllowApplePay(Document&) const; 82 WEBCORE_EXPORT bool shouldAllowUserAgentScripts(Document&) const; 79 83 80 84 private: -
trunk/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h
r242748 r243324 38 38 namespace WebCore { 39 39 40 class Document; 40 41 class PaymentMerchantSession; 41 42 struct PaymentAuthorizationResult; … … 66 67 virtual bool isWebPaymentCoordinator() const { return false; } 67 68 69 virtual bool supportsUnrestrictedApplePay() const { return true; } 70 68 71 protected: 69 72 virtual ~PaymentCoordinatorClient() = default; -
trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp
r241105 r243324 186 186 } 187 187 188 ExceptionOr<void> ApplePayPaymentHandler::show( )189 { 190 auto validatedRequest = convertAndValidate( m_applePayRequest->version, *m_applePayRequest, paymentCoordinator());188 ExceptionOr<void> ApplePayPaymentHandler::show(Document& document) 189 { 190 auto validatedRequest = convertAndValidate(document, m_applePayRequest->version, *m_applePayRequest, paymentCoordinator()); 191 191 if (validatedRequest.hasException()) 192 192 return validatedRequest.releaseException(); … … 218 218 return exception.releaseException(); 219 219 220 Vector<URL> linkIconURLs; 221 for (auto& icon : LinkIconCollector { document() }.iconsOfTypes({ LinkIconType::TouchIcon, LinkIconType::TouchPrecomposedIcon })) 222 linkIconURLs.append(icon.url); 223 224 paymentCoordinator().beginPaymentSession(*this, document().url(), linkIconURLs, request); 220 if (!paymentCoordinator().beginPaymentSession(document, *this, request)) 221 return Exception { AbortError }; 222 225 223 return { }; 226 224 } … … 231 229 } 232 230 233 void ApplePayPaymentHandler::canMakePayment( Function<void(bool)>&& completionHandler)234 { 235 completionHandler(paymentCoordinator().canMakePayments( ));231 void ApplePayPaymentHandler::canMakePayment(Document& document, Function<void(bool)>&& completionHandler) 232 { 233 completionHandler(paymentCoordinator().canMakePayments(document)); 236 234 } 237 235 … … 533 531 unsigned ApplePayPaymentHandler::version() const 534 532 { 535 if (!m_applePayRequest) 536 return 0; 537 538 auto version = m_applePayRequest->version; 539 ASSERT(paymentCoordinator().supportsVersion(version)); 540 return version; 533 return m_applePayRequest ? m_applePayRequest->version : 0; 541 534 } 542 535 -
trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.h
r239427 r243324 1 1 /* 2 * Copyright (C) 2017-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2017-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 66 66 // PaymentHandler 67 67 ExceptionOr<void> convertData(JSC::JSValue&&) final; 68 ExceptionOr<void> show( ) final;68 ExceptionOr<void> show(Document&) final; 69 69 void hide() final; 70 void canMakePayment( WTF::Function<void(bool)>&& completionHandler) final;70 void canMakePayment(Document&, WTF::Function<void(bool)>&& completionHandler) final; 71 71 ExceptionOr<void> detailsUpdated(PaymentRequest::UpdateReason, String&& error, AddressErrors&&, PayerErrorFields&&, JSC::JSObject* paymentMethodErrors) final; 72 72 ExceptionOr<void> merchantValidationCompleted(JSC::JSValue&&) final; -
trunk/Source/WebCore/Modules/paymentrequest/PaymentHandler.h
r239427 r243324 1 1 /* 2 * Copyright (C) 2017-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2017-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 50 50 51 51 virtual ExceptionOr<void> convertData(JSC::JSValue&&) = 0; 52 virtual ExceptionOr<void> show( ) = 0;52 virtual ExceptionOr<void> show(Document&) = 0; 53 53 virtual void hide() = 0; 54 virtual void canMakePayment( WTF::Function<void(bool)>&& completionHandler) = 0;54 virtual void canMakePayment(Document&, WTF::Function<void(bool)>&& completionHandler) = 0; 55 55 virtual ExceptionOr<void> detailsUpdated(PaymentRequest::UpdateReason, String&& error, AddressErrors&&, PayerErrorFields&&, JSC::JSObject* paymentMethodErrors) = 0; 56 56 virtual ExceptionOr<void> merchantValidationCompleted(JSC::JSValue&&) = 0; -
trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp
r241130 r243324 1 1 /* 2 * Copyright (C) 2017-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2017-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 429 429 } 430 430 431 auto exception = selectedPaymentHandler->show( );431 auto exception = selectedPaymentHandler->show(document); 432 432 if (exception.hasException()) { 433 433 settleShowPromise(exception.releaseException()); … … 507 507 continue; 508 508 509 handler->canMakePayment( [promise = WTFMove(promise)](bool canMakePayment) mutable {509 handler->canMakePayment(document, [promise = WTFMove(promise)](bool canMakePayment) mutable { 510 510 promise.resolve(canMakePayment); 511 511 }); -
trunk/Source/WebCore/bindings/js/ScriptController.cpp
r242991 r243324 2 2 * Copyright (C) 1999-2001 Harri Porten (porten@kde.org) 3 3 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 4 * Copyright (C) 2006-201 7Apple Inc. All rights reserved.4 * Copyright (C) 2006-2019 Apple Inc. All rights reserved. 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 45 45 #include "PageConsoleClient.h" 46 46 #include "PageGroup.h" 47 #include "PaymentCoordinator.h" 47 48 #include "PluginViewBase.h" 48 49 #include "RuntimeApplicationChecks.h" … … 555 556 } 556 557 558 JSValue ScriptController::executeUserAgentScriptInWorld(DOMWrapperWorld& world, const String& script, bool forceUserGesture, ExceptionDetails* exceptionDetails) 559 { 560 auto& document = *m_frame.document(); 561 if (!shouldAllowUserAgentScripts(document)) 562 return { }; 563 564 document.setHasEvaluatedUserAgentScripts(); 565 return executeScriptInWorld(world, script, forceUserGesture, exceptionDetails); 566 } 567 568 bool ScriptController::shouldAllowUserAgentScripts(Document& document) const 569 { 570 #if ENABLE(APPLE_PAY) 571 if (auto page = m_frame.page()) 572 return page->paymentCoordinator().shouldAllowUserAgentScripts(document); 573 #endif 574 return true; 575 } 576 557 577 bool ScriptController::canExecuteScripts(ReasonForCallingCanExecuteScripts reason) 558 578 { -
trunk/Source/WebCore/bindings/js/ScriptController.h
r241906 r243324 2 2 * Copyright (C) 1999 Harri Porten (porten@kde.org) 3 3 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 4 * Copyright (C) 2008-201 7Apple Inc. All rights reserved.4 * Copyright (C) 2008-2019 Apple Inc. All rights reserved. 5 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 6 6 * … … 91 91 JSC::JSValue executeScript(const ScriptSourceCode&, ExceptionDetails* = nullptr); 92 92 WEBCORE_EXPORT JSC::JSValue executeScript(const String& script, bool forceUserGesture = false, ExceptionDetails* = nullptr); 93 WEBCORE_EXPORT JSC::JSValue executeScriptInWorld(DOMWrapperWorld&, const String& script, bool forceUserGesture = false, ExceptionDetails* = nullptr); 93 JSC::JSValue executeScriptInWorld(DOMWrapperWorld&, const String& script, bool forceUserGesture = false, ExceptionDetails* = nullptr); 94 WEBCORE_EXPORT JSC::JSValue executeUserAgentScriptInWorld(DOMWrapperWorld&, const String& script, bool forceUserGesture, ExceptionDetails* = nullptr); 95 96 bool shouldAllowUserAgentScripts(Document&) const; 94 97 95 98 // Returns true if argument is a JavaScript URL. -
trunk/Source/WebCore/dom/Document.cpp
r243195 r243324 7550 7550 return; 7551 7551 7552 auto& scriptController = frame()->script(); 7553 7552 7554 // Use the JS file provided by the Chrome client, or fallback to the default one. 7553 7555 String jsString = page()->chrome().client().plugInExtraScript(); 7554 if (!jsString )7556 if (!jsString || !scriptController.shouldAllowUserAgentScripts(*this)) 7555 7557 jsString = String(plugInsJavaScript, sizeof(plugInsJavaScript)); 7556 7558 7557 frame()->script().evaluateInWorld(ScriptSourceCode(jsString), world); 7559 setHasEvaluatedUserAgentScripts(); 7560 scriptController.evaluateInWorld(ScriptSourceCode(jsString), world); 7558 7561 7559 7562 m_hasInjectedPlugInsScript = true; … … 8727 8730 #endif 8728 8731 8732 bool Document::hasEvaluatedUserAgentScripts() const 8733 { 8734 auto& top = topDocument(); 8735 return this == &top ? m_hasEvaluatedUserAgentScripts : top.hasEvaluatedUserAgentScripts(); 8736 } 8737 8738 bool Document::isRunningUserScripts() const 8739 { 8740 auto& top = topDocument(); 8741 return this == &top ? m_isRunningUserScripts : top.isRunningUserScripts(); 8742 } 8743 8744 void Document::setAsRunningUserScripts() 8745 { 8746 auto& top = topDocument(); 8747 if (this == &top) 8748 m_isRunningUserScripts = true; 8749 else 8750 top.setAsRunningUserScripts(); 8751 } 8752 8753 void Document::setHasEvaluatedUserAgentScripts() 8754 { 8755 auto& top = topDocument(); 8756 if (this == &top) 8757 m_hasEvaluatedUserAgentScripts = true; 8758 else 8759 top.setHasEvaluatedUserAgentScripts(); 8760 } 8761 8762 #if ENABLE(APPLE_PAY) 8763 8764 bool Document::hasStartedApplePaySession() const 8765 { 8766 auto& top = topDocument(); 8767 return this == &top ? m_hasStartedApplePaySession : top.hasStartedApplePaySession(); 8768 } 8769 8770 void Document::setHasStartedApplePaySession() 8771 { 8772 auto& top = topDocument(); 8773 if (this == &top) 8774 m_hasStartedApplePaySession = true; 8775 else 8776 top.setHasStartedApplePaySession(); 8777 } 8778 8779 #endif 8780 8729 8781 } // namespace WebCore -
trunk/Source/WebCore/dom/Document.h
r243124 r243324 4 4 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 6 * Copyright (C) 2004-201 8Apple Inc. All rights reserved.6 * Copyright (C) 2004-2019 Apple Inc. All rights reserved. 7 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) 8 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) … … 1538 1538 #endif 1539 1539 1540 void setAsRunningUserScripts() { m_isRunningUserScripts = true; } 1541 bool isRunningUserScripts() const { return m_isRunningUserScripts; } 1540 WEBCORE_EXPORT bool hasEvaluatedUserAgentScripts() const; 1541 WEBCORE_EXPORT bool isRunningUserScripts() const; 1542 WEBCORE_EXPORT void setAsRunningUserScripts(); 1543 void setHasEvaluatedUserAgentScripts(); 1544 #if ENABLE(APPLE_PAY) 1545 WEBCORE_EXPORT bool hasStartedApplePaySession() const; 1546 WEBCORE_EXPORT void setHasStartedApplePaySession(); 1547 #endif 1542 1548 1543 1549 void frameWasDisconnectedFromOwner(); … … 2096 2102 #endif 2097 2103 2104 bool m_hasEvaluatedUserAgentScripts { false }; 2098 2105 bool m_isRunningUserScripts { false }; 2106 #if ENABLE(APPLE_PAY) 2107 bool m_hasStartedApplePaySession { false }; 2108 #endif 2099 2109 2100 2110 Ref<UndoManager> m_undoManager; -
trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp
r239427 r243324 148 148 m_options.httpHeadersToKeep = httpHeadersToKeepFromCleaning(request.httpHeaderFields()); 149 149 150 if (document. topDocument().isRunningUserScripts() && SchemeRegistry::isUserExtensionScheme(request.url().protocol().toStringWithoutCopying())) {150 if (document.isRunningUserScripts() && SchemeRegistry::isUserExtensionScheme(request.url().protocol().toStringWithoutCopying())) { 151 151 m_options.mode = FetchOptions::Mode::NoCors; 152 152 m_options.filteringPolicy = ResponseFilteringPolicy::Disable; -
trunk/Source/WebCore/page/Frame.cpp
r242340 r243324 6 6 * 2000 Stefan Schimanski <1Stein@gmx.de> 7 7 * 2001 George Staikos <staikos@kde.org> 8 * Copyright (C) 2004-201 6Apple Inc. All rights reserved.8 * Copyright (C) 2004-2019 Apple Inc. All rights reserved. 9 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 10 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) … … 770 770 if (!UserContentURLPattern::matchesPatterns(document->url(), script.whitelist(), script.blacklist())) 771 771 return; 772 773 document->topDocument().setAsRunningUserScripts(); 772 if (!m_script->shouldAllowUserAgentScripts(*document)) 773 return; 774 775 document->setAsRunningUserScripts(); 774 776 loader().client().willInjectUserScript(world); 775 777 m_script->evaluateInWorld(ScriptSourceCode(script.source(), URL(script.url())), world); -
trunk/Source/WebCore/page/Settings.yaml
r243318 r243324 663 663 applePayEnabled: 664 664 conditional: APPLE_PAY 665 initial: false665 initial: defaultApplePayEnabled 666 666 applePayRemoteUIEnabled: 667 667 conditional: APPLE_PAY_REMOTE_UI -
trunk/Source/WebCore/page/SettingsDefaultValues.h
r240644 r243324 1 1 /* 2 * Copyright (C) 2017 Apple Inc. All rights reserved.2 * Copyright (C) 2017-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 110 110 static const bool defaultConicGradient = false; 111 111 #endif 112 113 #if ENABLE(APPLE_PAY_REMOTE_UI) 114 static const bool defaultApplePayEnabled = true; 115 #else 116 static const bool defaultApplePayEnabled = false; 117 #endif 112 118 113 119 } -
trunk/Source/WebCore/testing/Internals.cpp
r243276 r243324 4542 4542 void Internals::setAsRunningUserScripts(Document& document) 4543 4543 { 4544 document.topDocument().setAsRunningUserScripts(); 4545 } 4544 document.setAsRunningUserScripts(); 4545 } 4546 4547 #if ENABLE(APPLE_PAY) 4548 void Internals::setHasStartedApplePaySession(Document& document) 4549 { 4550 document.setHasStartedApplePaySession(); 4551 } 4552 #endif 4546 4553 4547 4554 #if ENABLE(WEBGL) -
trunk/Source/WebCore/testing/Internals.h
r243276 r243324 668 668 669 669 void setAsRunningUserScripts(Document&); 670 #if ENABLE(APPLE_PAY) 671 void setHasStartedApplePaySession(Document&); 672 #endif 670 673 671 674 #if ENABLE(WEBGL) -
trunk/Source/WebCore/testing/Internals.idl
r243276 r243324 652 652 653 653 [CallWith=Document] void setAsRunningUserScripts(); 654 [CallWith=Document, Conditional=APPLE_PAY] void setHasStartedApplePaySession(); 654 655 655 656 void disableTileSizeUpdateDelay(); -
trunk/Source/WebCore/testing/MockPaymentCoordinator.h
r242681 r243324 61 61 const MockPaymentContactFields& requiredShippingContactFields() const { return m_requiredShippingContactFields; } 62 62 63 bool supportsUnrestrictedApplePay() const final { return m_supportsUnrestrictedApplePay; } 64 void setSupportsUnrestrictedApplePay(bool supports) { m_supportsUnrestrictedApplePay = supports; } 65 63 66 void ref() const { } 64 67 void deref() const { } … … 67 70 Optional<String> validatedPaymentNetwork(const String&) final; 68 71 bool canMakePayments() final; 69 void canMakePaymentsWithActiveCard(const String&, const String&, CompletionHandler<void(bool)>&&) ;70 void openPaymentSetup(const String&, const String&, CompletionHandler<void(bool)>&&) ;72 void canMakePaymentsWithActiveCard(const String&, const String&, CompletionHandler<void(bool)>&&) final; 73 void openPaymentSetup(const String&, const String&, CompletionHandler<void(bool)>&&) final; 71 74 bool showPaymentUI(const URL&, const Vector<URL>&, const ApplePaySessionPaymentRequest&) final; 72 75 void completeMerchantValidation(const PaymentMerchantSession&) final; … … 94 97 MockPaymentContactFields m_requiredBillingContactFields; 95 98 MockPaymentContactFields m_requiredShippingContactFields; 99 bool m_supportsUnrestrictedApplePay { true }; 96 100 }; 97 101 -
trunk/Source/WebCore/testing/MockPaymentCoordinator.idl
r241105 r243324 42 42 readonly attribute MockPaymentContactFields requiredBillingContactFields; 43 43 readonly attribute MockPaymentContactFields requiredShippingContactFields; 44 45 attribute boolean supportsUnrestrictedApplePay; 44 46 }; -
trunk/Source/WebKit/ChangeLog
r243320 r243324 1 2019-03-21 Andy Estes <aestes@apple.com> 2 3 [iOS] Apple Pay should be available in documents with no user agent scripts 4 https://bugs.webkit.org/show_bug.cgi?id=196061 5 <rdar://problem/48649391> 6 7 Reviewed by Brady Eidson. 8 9 * Shared/AuxiliaryProcess.h: 10 * Shared/Cocoa/AuxiliaryProcessCocoa.mm: 11 (WebKit::AuxiliaryProcess::parentProcessHasEntitlement): 12 13 Added a convenience function for checking parent process entitlements. 14 15 * Shared/WebPreferences.yaml: 16 * Shared/WebPreferencesDefaultValues.h: 17 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: 18 (-[WKWebViewConfiguration init]): 19 20 Enabled Apple Pay by default on platforms that enable APPLE_PAY_REMOTE_UI. 21 22 * WebProcess/ApplePay/WebPaymentCoordinator.cpp: 23 (WebKit::WebPaymentCoordinator::supportsUnrestrictedApplePay const): 24 * WebProcess/ApplePay/WebPaymentCoordinator.h: 25 26 Implemented supportsUnrestrictedApplePay by checking for the 27 com.apple.private.WebKit.UnrestrictedApplePay entitlement on platforms that enable 28 APPLE_PAY_REMOTE_UI. 29 30 * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h: 31 * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: 32 (didClearWindowObjectForFrame): 33 (setUpPageLoaderClient): 34 35 Added injected bundle SPI that TestWebKitAPI uses to inject the WebCore Internals interface. 36 37 * WebProcess/WebPage/WebPage.cpp: 38 (WebKit::WebPage::runJavaScript): 39 40 Changed to call ScriptController::executeUserAgentScriptInWorld. 41 1 42 2019-03-21 Chris Dumez <cdumez@apple.com> 2 43 -
trunk/Source/WebKit/Shared/AuxiliaryProcess.h
r240955 r243324 1 1 /* 2 * Copyright (C) 2010-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2010-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 78 78 #if PLATFORM(MAC) 79 79 static bool isSystemWebKit(); 80 #endif 81 82 #if PLATFORM(COCOA) 83 bool parentProcessHasEntitlement(const char* entitlement); 80 84 #endif 81 85 -
trunk/Source/WebKit/Shared/Cocoa/AuxiliaryProcessCocoa.mm
r240683 r243324 1 1 /* 2 * Copyright (C) 2017 Apple Inc. All rights reserved.2 * Copyright (C) 2017-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 28 28 29 29 #import "WKCrashReporter.h" 30 #import <wtf/cocoa/Entitlements.h> 30 31 31 32 namespace WebKit { … … 37 38 } 38 39 40 bool AuxiliaryProcess::parentProcessHasEntitlement(const char* entitlement) 41 { 42 return WTF::hasEntitlement(m_connection->xpcConnection(), entitlement); 39 43 } 44 45 } -
trunk/Source/WebKit/Shared/WebPreferences.yaml
r243318 r243324 679 679 ApplePayEnabled: 680 680 type: bool 681 defaultValue: false681 defaultValue: DEFAULT_APPLE_PAY_ENABLED 682 682 condition: ENABLE(APPLE_PAY) 683 683 -
trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h
r243292 r243324 1 1 /* 2 * Copyright (C) 2010-201 6Apple Inc. All rights reserved.2 * Copyright (C) 2010-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 260 260 #endif 261 261 #endif 262 263 #if ENABLE(APPLE_PAY_REMOTE_UI) 264 #define DEFAULT_APPLE_PAY_ENABLED true 265 #else 266 #define DEFAULT_APPLE_PAY_ENABLED false 267 #endif -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm
r242339 r243324 250 250 _undoManagerAPIEnabled = NO; 251 251 252 #if ENABLE(APPLE_PAY) 253 _applePayEnabled = DEFAULT_APPLE_PAY_ENABLED; 254 #endif 255 252 256 return self; 253 257 } -
trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp
r242748 r243324 158 158 } 159 159 160 bool WebPaymentCoordinator::supportsUnrestrictedApplePay() const 161 { 162 #if ENABLE(APPLE_PAY_REMOTE_UI) 163 static bool hasEntitlement = WebProcess::singleton().parentProcessHasEntitlement("com.apple.private.WebKit.UnrestrictedApplePay"); 164 return hasEntitlement; 165 #else 166 return true; 167 #endif 168 } 169 160 170 IPC::Connection* WebPaymentCoordinator::messageSenderConnection() const 161 171 { -
trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h
r242748 r243324 79 79 bool isWebPaymentCoordinator() const override { return true; } 80 80 81 bool supportsUnrestrictedApplePay() const override; 82 81 83 // IPC::MessageReceiver. 82 84 void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; 83 85 84 86 // IPC::MessageSender. 85 87 IPC::Connection* messageSenderConnection() const final; -
trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h
r242375 r243324 45 45 - (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller didFinishLoadForFrame:(WKWebProcessPlugInFrame *)frame; 46 46 - (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller didSameDocumentNavigation:(_WKSameDocumentNavigationType)navigationType forFrame:(WKWebProcessPlugInFrame *)frame; 47 - (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller didClearWindowObjectForFrame:(WKWebProcessPlugInFrame *)frame inScriptWorld:(WKWebProcessPlugInScriptWorld *)scriptWorld; 47 48 - (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller globalObjectIsAvailableForFrame:(WKWebProcessPlugInFrame *)frame inScriptWorld:(WKWebProcessPlugInScriptWorld *)scriptWorld; 48 49 - (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller didRemoveFrameFromHierarchy:(WKWebProcessPlugInFrame *)frame; -
trunk/Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm
r242375 r243324 1 1 /* 2 * Copyright (C) 2012 Apple Inc. All rights reserved.2 * Copyright (C) 2012-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 105 105 } 106 106 107 static void didClearWindowObjectForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleScriptWorldRef scriptWorld, const void* clientInfo) 108 { 109 auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo; 110 auto loadDelegate = pluginContextController->_loadDelegate.get(); 111 112 if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:didClearWindowObjectForFrame:inScriptWorld:)]) 113 [loadDelegate webProcessPlugInBrowserContextController:pluginContextController didClearWindowObjectForFrame:wrapper(*WebKit::toImpl(frame)) inScriptWorld:wrapper(*WebKit::toImpl(scriptWorld))]; 114 } 115 107 116 static void globalObjectIsAvailableForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleScriptWorldRef scriptWorld, const void* clientInfo) 108 117 { … … 236 245 client.didSameDocumentNavigationForFrame = didSameDocumentNavigationForFrame; 237 246 client.didFinishLoadForFrame = didFinishLoadForFrame; 247 client.didClearWindowObjectForFrame = didClearWindowObjectForFrame; 238 248 client.globalObjectIsAvailableForFrame = globalObjectIsAvailableForFrame; 239 249 client.didRemoveFrameFromHierarchy = didRemoveFrameFromHierarchy; -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r243195 r243324 3290 3290 auto* world = worldName ? InjectedBundleScriptWorld::find(worldName.value()) : &InjectedBundleScriptWorld::normalWorld(); 3291 3291 if (world) { 3292 if (JSValue resultValue = m_mainFrame->coreFrame()->script().execute ScriptInWorld(world->coreWorld(), script, forceUserGesture, &details)) {3292 if (JSValue resultValue = m_mainFrame->coreFrame()->script().executeUserAgentScriptInWorld(world->coreWorld(), script, forceUserGesture, &details)) { 3293 3293 hadException = false; 3294 3294 serializedResultValue = SerializedScriptValue::create(m_mainFrame->jsContextForWorld(world), -
trunk/Source/WebKitLegacy/mac/ChangeLog
r243275 r243324 1 2019-03-21 Andy Estes <aestes@apple.com> 2 3 [iOS] Apple Pay should be available in documents with no user agent scripts 4 https://bugs.webkit.org/show_bug.cgi?id=196061 5 <rdar://problem/48649391> 6 7 Reviewed by Brady Eidson. 8 9 * WebView/WebFrame.mm: 10 (-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]): 11 1 12 2019-03-20 Simon Fraser <simon.fraser@apple.com> 2 13 -
trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm
r240912 r243324 2103 2103 RetainPtr<WebFrame> webFrame(kit(frame)); // Running arbitrary JavaScript can destroy the frame. 2104 2104 2105 JSC::JSValue result = frame->script().execute ScriptInWorld(*core(world), string, true);2105 JSC::JSValue result = frame->script().executeUserAgentScriptInWorld(*core(world), string, true); 2106 2106 2107 2107 if (!webFrame->_private->coreFrame) // In case the script removed our frame from the page. -
trunk/Tools/ChangeLog
r243321 r243324 1 2019-03-21 Andy Estes <aestes@apple.com> 2 3 [iOS] Apple Pay should be available in documents with no user agent scripts 4 https://bugs.webkit.org/show_bug.cgi?id=196061 5 <rdar://problem/48649391> 6 7 Reviewed by Brady Eidson. 8 9 Added API tests and related infrastructure. 10 11 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 12 * TestWebKitAPI/Tests/WebKitCocoa/ApplePay.mm: Added. 13 (-[TestApplePayScriptMessageHandler initWithExpectation:]): 14 (-[TestApplePayScriptMessageHandler userContentController:didReceiveScriptMessage:]): 15 (TestWebKitAPI::TEST): 16 * TestWebKitAPI/Tests/WebKitCocoa/apple-pay-active-session.html: Added. 17 * TestWebKitAPI/Tests/WebKitCocoa/apple-pay-availability-in-iframe.html: Added. 18 * TestWebKitAPI/Tests/WebKitCocoa/apple-pay-availability.html: Added. 19 * TestWebKitAPI/cocoa/TestProtocol.mm: 20 (-[TestProtocol startLoading]): 21 * TestWebKitAPI/cocoa/WebProcessPlugIn/WebProcessPlugInWithInternals.h: Added. 22 * TestWebKitAPI/cocoa/WebProcessPlugIn/WebProcessPlugInWithInternals.mm: Added. 23 (-[WebProcessPlugInWithInternals webProcessPlugIn:didCreateBrowserContextController:]): 24 (-[WebProcessPlugInWithInternals webProcessPlugInBrowserContextController:didClearWindowObjectForFrame:inScriptWorld:]): 25 1 26 2019-03-21 Jonathan Bedard <jbedard@apple.com> 2 27 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r243110 r243324 703 703 A155022C1E050D0300A24C57 /* duplicate-completion-handler-calls.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = A155022B1E050BC500A24C57 /* duplicate-completion-handler-calls.html */; }; 704 704 A16F66BA1C40EB4F00BD4D24 /* ContentFiltering.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = A16F66B91C40EA2000BD4D24 /* ContentFiltering.html */; }; 705 A1798B7F22431D2B000764BD /* libWebCoreTestSupport.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A1798B7E22431D2B000764BD /* libWebCoreTestSupport.dylib */; }; 706 A1798B8222431D65000764BD /* ApplePay.mm in Sources */ = {isa = PBXBuildFile; fileRef = A1798B8122431D65000764BD /* ApplePay.mm */; }; 707 A1798B8522433647000764BD /* WebProcessPlugInWithInternals.mm in Sources */ = {isa = PBXBuildFile; fileRef = A1798B8422433647000764BD /* WebProcessPlugInWithInternals.mm */; }; 708 A1798B872243449B000764BD /* apple-pay-availability.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = A1798B862243446B000764BD /* apple-pay-availability.html */; }; 709 A1798B8922435E29000764BD /* apple-pay-availability-in-iframe.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = A1798B8822435D2E000764BD /* apple-pay-availability-in-iframe.html */; }; 710 A1798B8B224361A4000764BD /* apple-pay-active-session.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = A1798B8A2243611A000764BD /* apple-pay-active-session.html */; }; 705 711 A17991881E1C994E00A505ED /* SharedBuffer.mm in Sources */ = {isa = PBXBuildFile; fileRef = A17991861E1C994E00A505ED /* SharedBuffer.mm */; }; 706 712 A179918B1E1CA24100A505ED /* SharedBufferTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A17991891E1CA24100A505ED /* SharedBufferTest.cpp */; }; … … 1019 1025 C25CCA0D1E5141840026CB8A /* AllAhem.svg in Copy Resources */, 1020 1026 F4A9202F1FEE34E900F59590 /* apple-data-url.html in Copy Resources */, 1027 A1798B8B224361A4000764BD /* apple-pay-active-session.html in Copy Resources */, 1028 A1798B8922435E29000764BD /* apple-pay-availability-in-iframe.html in Copy Resources */, 1029 A1798B872243449B000764BD /* apple-pay-availability.html in Copy Resources */, 1021 1030 F46A095A1ED8A6E600D4AA55 /* apple.gif in Copy Resources */, 1022 1031 5C9E59411D3EB5AC00E3C62E /* ApplicationCache.db in Copy Resources */, … … 1957 1966 A155022B1E050BC500A24C57 /* duplicate-completion-handler-calls.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "duplicate-completion-handler-calls.html"; sourceTree = "<group>"; }; 1958 1967 A16F66B91C40EA2000BD4D24 /* ContentFiltering.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = ContentFiltering.html; sourceTree = "<group>"; }; 1968 A1798B7E22431D2B000764BD /* libWebCoreTestSupport.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; path = libWebCoreTestSupport.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; 1969 A1798B8122431D65000764BD /* ApplePay.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ApplePay.mm; sourceTree = "<group>"; }; 1970 A1798B8322433647000764BD /* WebProcessPlugInWithInternals.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebProcessPlugInWithInternals.h; sourceTree = "<group>"; }; 1971 A1798B8422433647000764BD /* WebProcessPlugInWithInternals.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WebProcessPlugInWithInternals.mm; sourceTree = "<group>"; }; 1972 A1798B862243446B000764BD /* apple-pay-availability.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "apple-pay-availability.html"; sourceTree = "<group>"; }; 1973 A1798B8822435D2E000764BD /* apple-pay-availability-in-iframe.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "apple-pay-availability-in-iframe.html"; sourceTree = "<group>"; }; 1974 A1798B8A2243611A000764BD /* apple-pay-active-session.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "apple-pay-active-session.html"; sourceTree = "<group>"; }; 1959 1975 A17991861E1C994E00A505ED /* SharedBuffer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SharedBuffer.mm; sourceTree = "<group>"; }; 1960 1976 A17991891E1CA24100A505ED /* SharedBufferTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedBufferTest.cpp; sourceTree = "<group>"; }; … … 2365 2381 runOnlyForDeploymentPostprocessing = 0; 2366 2382 }; 2383 A1798B7D22431D18000764BD /* Frameworks */ = { 2384 isa = PBXFrameworksBuildPhase; 2385 buildActionMask = 2147483647; 2386 files = ( 2387 A1798B7F22431D2B000764BD /* libWebCoreTestSupport.dylib in Frameworks */, 2388 ); 2389 runOnlyForDeploymentPostprocessing = 0; 2390 }; 2367 2391 BC57597E126E74AF006F0F12 /* Frameworks */ = { 2368 2392 isa = PBXFrameworksBuildPhase; … … 2486 2510 A1DF74301C41B65800A2F4D0 /* AlwaysRevalidatedURLSchemes.mm */, 2487 2511 2DE71AFD1D49C0BD00904094 /* AnimatedResize.mm */, 2512 A1798B8122431D65000764BD /* ApplePay.mm */, 2488 2513 63F668201F97C3AA0032EE51 /* ApplicationManifest.mm */, 2489 2514 834138C6203261B900F26960 /* AsyncPolicyForNavigationResponse.mm */, … … 2812 2837 CDA3159C1ED5643F009F60D3 /* IOKit.framework */, 2813 2838 7C83E0331D0A5F2700FEBCF3 /* libicucore.dylib */, 2839 A1798B7E22431D2B000764BD /* libWebCoreTestSupport.dylib */, 2814 2840 4135FB862011FABF00332139 /* libWebCoreTestSupport.dylib */, 2815 2841 7C83E0291D0A5CDF00FEBCF3 /* libWTF.a */, … … 2848 2874 A13EBB541B8734E000097110 /* Info.plist */, 2849 2875 A13EBBA91B87428D00097110 /* WebProcessPlugIn.mm */, 2876 A1798B8322433647000764BD /* WebProcessPlugInWithInternals.h */, 2877 A1798B8422433647000764BD /* WebProcessPlugInWithInternals.mm */, 2850 2878 ); 2851 2879 name = WebProcessPlugIn; … … 2860 2888 C25CCA0C1E5140E50026CB8A /* AllAhem.svg */, 2861 2889 F4A9202E1FEE34C800F59590 /* apple-data-url.html */, 2890 A1798B8A2243611A000764BD /* apple-pay-active-session.html */, 2891 A1798B8822435D2E000764BD /* apple-pay-availability-in-iframe.html */, 2892 A1798B862243446B000764BD /* apple-pay-availability.html */, 2862 2893 F47D30EB1ED28619000482E1 /* apple.gif */, 2863 2894 5C9E593E1D3EB1DE00E3C62E /* ApplicationCache.db */, … … 3767 3798 buildPhases = ( 3768 3799 A13EBB451B87339E00097110 /* Sources */, 3800 A1798B7D22431D18000764BD /* Frameworks */, 3769 3801 ); 3770 3802 buildRules = ( … … 3967 3999 2DE71AFE1D49C0BD00904094 /* AnimatedResize.mm in Sources */, 3968 4000 57152B5E21CC2045000C37CA /* ApduTest.cpp in Sources */, 4001 A1798B8222431D65000764BD /* ApplePay.mm in Sources */, 3969 4002 63F668221F97F7F90032EE51 /* ApplicationManifest.mm in Sources */, 3970 4003 6354F4D11F7C3AB500D89DF3 /* ApplicationManifestParser.cpp in Sources */, … … 4456 4489 7C83E03D1D0A60D600FEBCF3 /* UtilitiesCocoa.mm in Sources */, 4457 4490 A13EBBAA1B87428D00097110 /* WebProcessPlugIn.mm in Sources */, 4491 A1798B8522433647000764BD /* WebProcessPlugInWithInternals.mm in Sources */, 4458 4492 ); 4459 4493 runOnlyForDeploymentPostprocessing = 0; -
trunk/Tools/TestWebKitAPI/cocoa/TestProtocol.mm
r242339 r243324 87 87 } 88 88 89 NSData *data = [@"PASS" dataUsingEncoding:NSASCIIStringEncoding]; 89 NSData *data; 90 if ([requestURL.host isEqualToString:@"bundle-html-file"]) 91 data = [NSData dataWithContentsOfURL:[NSBundle.mainBundle URLForResource:requestURL.lastPathComponent.stringByDeletingPathExtension withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]; 92 else 93 data = [@"PASS" dataUsingEncoding:NSASCIIStringEncoding]; 94 90 95 RetainPtr<NSURLResponse> response = adoptNS([[NSURLResponse alloc] initWithURL:requestURL MIMEType:@"text/html" expectedContentLength:data.length textEncodingName:nil]); 91 96 -
trunk/Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/WebProcessPlugInWithInternals.h
r243323 r243324 1 1 /* 2 * Copyright (C) 201 7Apple Inc. All rights reserved.2 * Copyright (C) 2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #import "config.h" 27 #import "AuxiliaryProcess.h" 26 #import <WebKit/WKWebProcessPlugIn.h> 28 27 29 #import "WKCrashReporter.h" 30 31 namespace WebKit { 32 33 void AuxiliaryProcess::didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageReceiverName, IPC::StringReference messageName) 34 { 35 setCrashReportApplicationSpecificInformation((__bridge CFStringRef)[NSString stringWithFormat:@"Received invalid message: '%s::%s'", messageReceiverName.toString().data(), messageName.toString().data()]); 36 CRASH(); 37 } 38 39 } 28 @interface WebProcessPlugInWithInternals : NSObject <WKWebProcessPlugIn> 29 @end -
trunk/Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/WebProcessPlugInWithInternals.mm
r243323 r243324 1 1 /* 2 * Copyright (C) 201 7Apple Inc. All rights reserved.2 * Copyright (C) 2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 25 25 26 26 #import "config.h" 27 #import " AuxiliaryProcess.h"27 #import "WebProcessPlugInWithInternals.h" 28 28 29 #import "WKCrashReporter.h" 29 #import "WebCoreTestSupport.h" 30 #import <WebKit/WKWebProcessPlugInBrowserContextController.h> 31 #import <WebKit/WKWebProcessPlugInFrame.h> 32 #import <WebKit/WKWebProcessPlugInLoadDelegate.h> 30 33 31 namespace WebKit { 34 @interface WebProcessPlugInWithInternals () <WKWebProcessPlugInLoadDelegate> 32 35 33 void AuxiliaryProcess::didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageReceiverName, IPC::StringReference messageName) 36 @end 37 38 @implementation WebProcessPlugInWithInternals 39 40 - (void)webProcessPlugIn:(WKWebProcessPlugInController *)plugInController didCreateBrowserContextController:(WKWebProcessPlugInBrowserContextController *)browserContextController 34 41 { 35 setCrashReportApplicationSpecificInformation((__bridge CFStringRef)[NSString stringWithFormat:@"Received invalid message: '%s::%s'", messageReceiverName.toString().data(), messageName.toString().data()]); 36 CRASH(); 42 browserContextController.loadDelegate = self; 37 43 } 38 44 45 - (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller didClearWindowObjectForFrame:(WKWebProcessPlugInFrame *)frame inScriptWorld:(WKWebProcessPlugInScriptWorld *)scriptWorld 46 { 47 WebCoreTestSupport::injectInternalsObject([frame jsContextForWorld:scriptWorld].JSGlobalContextRef); 39 48 } 49 50 @end
Note:
See TracChangeset
for help on using the changeset viewer.