Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Unreleased

### Features

* Added support for back and forward swipe navigation gestures in `WKWebView` via the `allowsBackForwardNavigationGestures` option. (for openInWebView option only) ([35ab447](https://github.com/ionic-team/capacitor-os-inappbrowser/commit/35ab44790eb98b2d0d748c130642b321e9dc1156))

# [2.1.0](https://github.com/ionic-team/capacitor-os-inappbrowser/compare/v2.0.1...v2.1.0) (2025-04-15)

### Features
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,15 @@ Defines the options for opening a URL in the web view.

#### iOSWebViewOptions

| Prop | Type | Description |
| ---------------------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`allowOverScroll`** | <code>boolean</code> | Turns on the Web View bounce property. |
| **`enableViewportScale`** | <code>boolean</code> | Prevents viewport scaling through a meta tag. |
| **`allowInLineMediaPlayback`** | <code>boolean</code> | Allows in-line HTML5 media playback, displaying within the browser window rather than a device-specific playback interface. Note: The HTML's video element must also include the webkit-playsinline attribute. |
| **`surpressIncrementalRendering`** | <code>boolean</code> | Waits until all new view content is received before being rendered. |
| **`viewStyle`** | <code><a href="#iosviewstyle">iOSViewStyle</a></code> | Sets the presentation style of the Web View. |
| **`animationEffect`** | <code><a href="#iosanimation">iOSAnimation</a></code> | Sets the transition style of the Web View. |
| Prop | Type | Description |
| ----------------------------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`allowOverScroll`** | <code>boolean</code> | Turns on the Web View bounce property. |
| **`enableViewportScale`** | <code>boolean</code> | Prevents viewport scaling through a meta tag. |
| **`allowInLineMediaPlayback`** | <code>boolean</code> | Allows in-line HTML5 media playback, displaying within the browser window rather than a device-specific playback interface. Note: The HTML's video element must also include the webkit-playsinline attribute. |
| **`surpressIncrementalRendering`** | <code>boolean</code> | Waits until all new view content is received before being rendered. |
| **`viewStyle`** | <code><a href="#iosviewstyle">iOSViewStyle</a></code> | Sets the presentation style of the Web View. |
| **`animationEffect`** | <code><a href="#iosanimation">iOSAnimation</a></code> | Sets the transition style of the Web View. |
| **`allowsBackForwardNavigationGestures`** | <code>boolean</code> | Enables back and forward swipe gestures in the Web View. |


#### OpenInSystemBrowserParameterModel
Expand Down
22 changes: 11 additions & 11 deletions example-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions example-app/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ const Home: React.FC = () => {
allowInLineMediaPlayback: true,
surpressIncrementalRendering: true,
viewStyle: iOSViewStyle.PAGE_SHEET,
animationEffect: iOSAnimation.CROSS_DISSOLVE
animationEffect: iOSAnimation.CROSS_DISSOLVE,
allowsBackForwardNavigationGestures: true
}
}
});
Expand Down Expand Up @@ -116,7 +117,8 @@ const Home: React.FC = () => {
allowInLineMediaPlayback: true,
surpressIncrementalRendering: true,
viewStyle: iOSViewStyle.PAGE_SHEET,
animationEffect: iOSAnimation.CROSS_DISSOLVE
animationEffect: iOSAnimation.CROSS_DISSOLVE,
allowsBackForwardNavigationGestures: true
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ struct OSInAppBrowserWebViewModel: Decodable {
let surpressIncrementalRendering: Bool
let viewStyle: OSIABViewStyle
let animationEffect: OSIABAnimationEffect
let allowsBackForwardNavigationGestures: Bool

enum CodingKeys: CodingKey {
case allowOverScroll
Expand All @@ -17,6 +18,7 @@ struct OSInAppBrowserWebViewModel: Decodable {
case surpressIncrementalRendering
case viewStyle
case animationEffect
case allowsBackForwardNavigationGestures
}

init(from decoder: Decoder) throws {
Expand All @@ -31,6 +33,7 @@ struct OSInAppBrowserWebViewModel: Decodable {
self.surpressIncrementalRendering = try container.decode(Bool.self, forKey: .surpressIncrementalRendering)
self.viewStyle = .init(viewStyleValue)
self.animationEffect = .init(animationValue)
self.allowsBackForwardNavigationGestures = try container.decode(Bool.self, forKey: .allowsBackForwardNavigationGestures)
}
}

Expand Down Expand Up @@ -98,7 +101,8 @@ extension OSInAppBrowserWebViewModel {
surpressIncrementalRendering: self.iOS.surpressIncrementalRendering,
viewStyle: self.iOS.viewStyle,
animationEffect: self.iOS.animationEffect,
customUserAgent: self.customWebViewUserAgent
customUserAgent: self.customWebViewUserAgent,
allowsBackForwardNavigationGestures: self.iOS.allowsBackForwardNavigationGestures
)
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
},
"devDependencies": {
"@capacitor/android": "next",
"@capacitor/cli": "^7.3.0",
"@capacitor/core": "next",
"@capacitor/docgen": "^0.2.2",
"@capacitor/ios": "next",
Expand Down
1 change: 1 addition & 0 deletions src/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const DefaultiOSWebViewOptions: iOSWebViewOptions = {

viewStyle: iOSViewStyle.FULL_SCREEN,
animationEffect: iOSAnimation.COVER_VERTICAL,
allowsBackForwardNavigationGestures: true,
};

export const DefaultWebViewOptions: WebViewOptions = {
Expand Down
3 changes: 3 additions & 0 deletions src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ export interface iOSWebViewOptions {
viewStyle: iOSViewStyle;
/** Sets the transition style of the Web View. */
animationEffect: iOSAnimation;

/** Enables back and forward swipe gestures in the Web View. */
allowsBackForwardNavigationGestures: boolean;
}

export interface AndroidWebViewOptions {
Expand Down