Skip to content

Commit 23816ee

Browse files
committed
feat(webview): Add debugMode property to iOS, closes #8
1 parent 96fc522 commit 23816ee

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ The custom `NSURLProtocol` used with UIWebView is shared with all instances of t
8787
| builtInZoomControls | true / false | Android: Is the built-in zoom mechanisms being used |
8888
| cacheMode | default / no_cache / cache_first / cache_only | Android: Set caching mode. |
8989
| databaseStorage | true / false | Android: Enable/Disabled database storage API. Note: It affects all webviews in the process. |
90-
| debugMode | true / false | Android: Enable chrome debugger for webview on Android. Note: Applies to all webviews in App |
90+
| debugMode | true / false | Enable chrome debugger for webview on Android and Safari debugger for webview on iOS. Note: Applies to all webviews in App |
9191
| displayZoomControls | true / false | Android: displays on-screen zoom controls when using the built-in zoom mechanisms |
9292
| domStorage | true / false | Android: Enable/Disabled DOM Storage API. E.g localStorage |
9393
| scalesPageToFit | UIWebView: Should webpage scale to fit the view? Defaults to false |

src/webview/index.ios.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
WebViewTraceCategory,
88
allowsInlineMediaPlaybackProperty,
99
autoInjectJSBridgeProperty,
10+
debugModeProperty,
1011
limitsNavigationsToAppBoundDomainsProperty,
1112
mediaPlaybackRequiresUserActionProperty,
1213
scrollBarIndicatorVisibleProperty,
@@ -406,6 +407,16 @@ export class AWebView extends WebViewExtBase {
406407
this.loadWKUserScripts(enabled);
407408
}
408409

410+
[debugModeProperty.getDefault]() {
411+
return false;
412+
}
413+
414+
[debugModeProperty.setNative](enabled) {
415+
const nativeView = this.nativeViewProtected;
416+
417+
nativeView.inspectable = !!enabled;
418+
}
419+
409420
[scrollBounceProperty.getDefault]() {
410421
const nativeView = this.nativeViewProtected;
411422

0 commit comments

Comments
 (0)