react-native-webview.git

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /**
  2. * Copyright (c) 2015-present, Facebook, Inc.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #import <React/RCTView.h>
  8. #import <React/RCTDefines.h>
  9. #import <WebKit/WebKit.h>
  10. @class RNCWebView;
  11. @protocol RNCWebViewDelegate <NSObject>
  12. - (BOOL)webView:(RNCWebView *_Nonnull)webView
  13. shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *_Nonnull)request
  14. withCallback:(RCTDirectEventBlock _Nonnull)callback;
  15. @end
  16. @interface RNCWebView : RCTView
  17. @property (nonatomic, weak) id<RNCWebViewDelegate> _Nullable delegate;
  18. @property (nonatomic, copy) NSDictionary * _Nullable source;
  19. @property (nonatomic, assign) BOOL messagingEnabled;
  20. @property (nonatomic, copy) NSString * _Nullable injectedJavaScript;
  21. @property (nonatomic, copy) NSString * _Nullable injectedJavaScriptBeforeContentLoaded;
  22. @property (nonatomic, assign) BOOL scrollEnabled;
  23. @property (nonatomic, assign) BOOL sharedCookiesEnabled;
  24. @property (nonatomic, assign) BOOL pagingEnabled;
  25. @property (nonatomic, assign) CGFloat decelerationRate;
  26. @property (nonatomic, assign) BOOL allowsInlineMediaPlayback;
  27. @property (nonatomic, assign) BOOL bounces;
  28. @property (nonatomic, assign) BOOL mediaPlaybackRequiresUserAction;
  29. #if WEBKIT_IOS_10_APIS_AVAILABLE
  30. @property (nonatomic, assign) WKDataDetectorTypes dataDetectorTypes;
  31. #endif
  32. @property (nonatomic, assign) UIEdgeInsets contentInset;
  33. @property (nonatomic, assign) BOOL automaticallyAdjustContentInsets;
  34. @property (nonatomic, assign) BOOL keyboardDisplayRequiresUserAction;
  35. @property (nonatomic, assign) BOOL hideKeyboardAccessoryView;
  36. @property (nonatomic, assign) BOOL allowsBackForwardNavigationGestures;
  37. @property (nonatomic, assign) BOOL incognito;
  38. @property (nonatomic, assign) BOOL useSharedProcessPool;
  39. @property (nonatomic, copy) NSString * _Nullable userAgent;
  40. @property (nonatomic, copy) NSString * _Nullable applicationNameForUserAgent;
  41. @property (nonatomic, assign) BOOL cacheEnabled;
  42. @property (nonatomic, assign) BOOL javaScriptEnabled;
  43. @property (nonatomic, assign) BOOL allowFileAccessFromFileURLs;
  44. @property (nonatomic, assign) BOOL allowsLinkPreview;
  45. @property (nonatomic, assign) BOOL showsHorizontalScrollIndicator;
  46. @property (nonatomic, assign) BOOL showsVerticalScrollIndicator;
  47. @property (nonatomic, assign) BOOL directionalLockEnabled;
  48. @property (nonatomic, copy) NSString * _Nullable allowingReadAccessToURL;
  49. + (void)setClientAuthenticationCredential:(nullable NSURLCredential*)credential;
  50. + (void)setCustomCertificatesForHost:(nullable NSDictionary *)certificates;
  51. - (void)postMessage:(NSString *_Nullable)message;
  52. - (void)injectJavaScript:(NSString *_Nullable)script;
  53. - (void)goForward;
  54. - (void)goBack;
  55. - (void)reload;
  56. - (void)stopLoading;
  57. @end