I'm encountering strange behaviour in the WebCrypto API when setting the navigationDelegate of a WKWebView on iOS. After setting the delegate I can no longer store asymmetric keys from JavaScript as I'm getting a DataCloneError (25). After looking through the source code I believe this is caused by this code in NavigationState.mm m_navigationDelegateMethods.webCryptoMasterKeyForWebView = [delegate respondsToSelector:@selector(_webCryptoMasterKeyForWebView:)]; I can work around the issue by implementing this method in by navigationDelegate class: - (NSData *)_webCryptoMasterKeyForWebView:(WKWebView *)sender { return [NSData dataWithBytes:"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" length:16]; } I've provided a sample key above. Obviously I would not like to rely on this private API.
<rdar://problem/25766400>
*** This bug has been marked as a duplicate of bug 162554 ***