react-native-webview.git

RNCWebView.h 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 *)webView
  13. shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request
  14. withCallback:(RCTDirectEventBlock)callback;
  15. @end
  16. @interface RNCWebView : RCTView
  17. @property (nonatomic, weak) id<RNCWebViewDelegate> delegate;
  18. @property (nonatomic, copy) NSDictionary *source;
  19. @property (nonatomic, assign) BOOL messagingEnabled;
  20. @property (nonatomic, copy) NSString *injectedJavaScript;
  21. @property (nonatomic, assign) BOOL scrollEnabled;
  22. @property (nonatomic, assign) BOOL sharedCookiesEnabled;
  23. @property (nonatomic, assign) BOOL pagingEnabled;
  24. @property (nonatomic, assign) CGFloat decelerationRate;
  25. @property (nonatomic, assign) BOOL allowsInlineMediaPlayback;
  26. @property (nonatomic, assign) BOOL bounces;
  27. @property (nonatomic, assign) BOOL mediaPlaybackRequiresUserAction;
  28. #if WEBKIT_IOS_10_APIS_AVAILABLE
  29. @property (nonatomic, assign) WKDataDetectorTypes dataDetectorTypes;
  30. #endif
  31. @property (nonatomic, assign) UIEdgeInsets contentInset;
  32. @property (nonatomic, assign) BOOL automaticallyAdjustContentInsets;
  33. @property (nonatomic, assign) BOOL keyboardDisplayRequiresUserAction;
  34. @property (nonatomic, assign) BOOL hideKeyboardAccessoryView;
  35. @property (nonatomic, assign) BOOL allowsBackForwardNavigationGestures;
  36. @property (nonatomic, assign) BOOL incognito;
  37. @property (nonatomic, assign) BOOL useSharedProcessPool;
  38. @property (nonatomic, copy) NSString *userAgent;
  39. @property (nonatomic, copy) NSString *applicationNameForUserAgent;
  40. @property (nonatomic, assign) BOOL cacheEnabled;
  41. @property (nonatomic, assign) BOOL javaScriptEnabled;
  42. @property (nonatomic, assign) BOOL allowsLinkPreview;
  43. @property (nonatomic, assign) BOOL showsHorizontalScrollIndicator;
  44. @property (nonatomic, assign) BOOL showsVerticalScrollIndicator;
  45. @property (nonatomic, assign) BOOL directionalLockEnabled;
  46. @property (nonatomic, copy) NSString *allowingReadAccessToURL;
  47. + (void)setClientAuthenticationCredential:(nullable NSURLCredential*)credential;
  48. + (void)setCustomCertificatesForHost:(nullable NSDictionary *)certificates;
  49. - (void)postMessage:(NSString *)message;
  50. - (void)injectJavaScript:(NSString *)script;
  51. - (void)goForward;
  52. - (void)goBack;
  53. - (void)reload;
  54. - (void)stopLoading;
  55. @end