Skip to content

Commit 1d50f38

Browse files
Merge branch 'main' into docs/bottom-sheet
2 parents f4a6b6f + f029058 commit 1d50f38

File tree

15 files changed

+464
-257
lines changed

15 files changed

+464
-257
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ name: "Release"
33
on:
44
push:
55
branches:
6-
- dev
6+
- development
77
- next
8-
- main
98
workflow_dispatch:
109

1110
permissions:
1211
contents: write
1312
issues: write
1413
deployments: write
14+
id-token: write # to enable use of OIDC for npm provenance
1515

1616
jobs:
1717
setup:

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# [2.2.1](https://github.com/ionic-team/capacitor-os-inappbrowser/compare/v2.2.0...v2.2.1) (2025-07-30)
2+
3+
### Features
4+
5+
* Add support for for predictive back navigation for Android 13+ ([5bd722b](https://github.com/ionic-team/capacitor-os-inappbrowser/pull/68/commits/5bd722b1ba57bac635b239acedc645d0a31a5416))
6+
7+
# [2.2.0](https://github.com/ionic-team/capacitor-os-inappbrowser/compare/v2.1.1...v2.2.0) (2025-07-21)
8+
9+
### Features
10+
11+
* Add support for passing custom headers to web view (only for the OpenInWebView option). ([6be21ea](https://github.com/ionic-team/capacitor-os-inappbrowser/commit/6be21eacc376a7d80908a89ca13ee08c75a60933))
12+
113
# [2.1.1](https://github.com/ionic-team/capacitor-os-inappbrowser/compare/v2.1.0...v2.1.1) (2025-06-18)
214

315
### Features

CapacitorInappbrowser.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Pod::Spec.new do |s|
1212
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
1313
s.source_files = 'ios/Sources/InAppBrowserPlugin/*.{swift,h,m,c,cc,mm,cpp}'
1414
s.ios.deployment_target = '14.0'
15-
s.dependency 'OSInAppBrowserLib', spec='~> 2.0.1'
15+
s.dependency 'OSInAppBrowserLib', spec='~> 2.1.0'
1616
s.dependency 'Capacitor'
1717
s.swift_version = '5.1'
1818
end

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Closes the currently active browser. It can be used to close browsers launched t
160160
addListener(eventName: 'browserClosed' | 'browserPageLoaded', listenerFunc: () => void) => Promise<PluginListenerHandle>
161161
```
162162

163-
Adds a listener for the specified browser event.
163+
Adds a listener for the specified browser events, with no data being returned.
164164

165165
| Param | Type | Description |
166166
| ------------------ | --------------------------------------------------- | ------------------------------------------------------------------------------------ |
@@ -178,12 +178,12 @@ Adds a listener for the specified browser event.
178178
addListener(eventName: 'browserPageNavigationCompleted', listenerFunc: (data: BrowserPageNavigationCompletedEventData) => void) => Promise<PluginListenerHandle>
179179
```
180180

181-
Adds a listener for the specified browser event.
181+
Adds a listener for the specified browser event, which receives data.
182182

183-
| Param | Type | Description |
184-
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
185-
| **`eventName`** | <code>'browserPageNavigationCompleted'</code> | The name of the browser event to listen for: 'browserPageNavigationCompleted'. |
186-
| **`listenerFunc`** | <code>(data: <a href="#browserpagenavigationcompletedeventdata">BrowserPageNavigationCompletedEventData</a>) =&gt; void</code> | The function to be called when the event occurs. |
183+
| Param | Type | Description |
184+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- |
185+
| **`eventName`** | <code>'browserPageNavigationCompleted'</code> | The name of the browser event to listen for: 'browserPageNavigationCompleted'. Applies only to openInWebView. |
186+
| **`listenerFunc`** | <code>(data: <a href="#browserpagenavigationcompletedeventdata">BrowserPageNavigationCompletedEventData</a>) =&gt; void</code> | The function to be called when the event occurs. |
187187

188188
**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
189189

@@ -208,9 +208,10 @@ Removes all listeners for the browser events.
208208

209209
Defines the options for opening a URL in the web view.
210210

211-
| Prop | Type | Description |
212-
| ------------- | --------------------------------------------------------- | -------------------------------------------------------------------- |
213-
| **`options`** | <code><a href="#webviewoptions">WebViewOptions</a></code> | A structure containing some configurations to apply to the Web View. |
211+
| Prop | Type | Description |
212+
| ------------------- | --------------------------------------------------------- | -------------------------------------------------------------------- |
213+
| **`options`** | <code><a href="#webviewoptions">WebViewOptions</a></code> | A structure containing some configurations to apply to the Web View. |
214+
| **`customHeaders`** | <code>{ [key: string]: string; }</code> | A map of custom headers to be sent with the request. |
214215

215216

216217
#### WebViewOptions

android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ buildscript {
1111
google()
1212
mavenCentral()
1313
}
14+
1415
dependencies {
1516
classpath 'com.android.tools.build:gradle:8.7.1'
1617
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
@@ -54,11 +55,10 @@ repositories {
5455
mavenCentral()
5556
}
5657

57-
5858
dependencies {
5959
// implementation fileTree(dir: 'libs', include: ['*.jar'])
6060
implementation project(':capacitor-android')
61-
implementation "io.ionic.libs:ioninappbrowser-android:1.3.0"
61+
implementation("io.ionic.libs:ioninappbrowser-android:1.4.1")
6262
implementation 'androidx.browser:browser:1.8.0'
6363
implementation "androidx.constraintlayout:constraintlayout:2.2.0"
6464
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"

android/src/main/java/com/capacitorjs/osinappbrowser/InAppBrowserPlugin.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,25 @@ class InAppBrowserPlugin : Plugin() {
7373
handleBrowserCall(call, OSInAppBrowserTarget.WEB_VIEW) { url ->
7474
val options = call.getObject("options")
7575
?: return@handleBrowserCall sendErrorResult(call, OSInAppBrowserError.InputArgumentsIssue(OSInAppBrowserTarget.WEB_VIEW))
76+
77+
val customHeaders: Map<String, String>? = call.getObject("customHeaders")?.let { jsObject ->
78+
val result = mutableMapOf<String, String>()
79+
jsObject.keys().forEach { key ->
80+
when (val value = jsObject.opt(key)) {
81+
is String -> result[key] = value
82+
is Number -> result[key] = value.toString()
83+
}
84+
}
85+
result
86+
}
87+
7688
close {
7789
val webViewOptions = buildWebViewOptions(options)
7890
val webViewRouter = OSIABWebViewRouterAdapter(
7991
context = context,
8092
lifecycleScope = activity.lifecycleScope,
8193
options = webViewOptions,
94+
customHeaders = customHeaders,
8295
flowHelper = OSIABFlowHelper(),
8396
onBrowserPageLoaded = {
8497
notifyListeners(OSIABEventType.BROWSER_PAGE_LOADED.value, null)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
22
include ':capacitor-android'
3-
project(':capacitor-android').projectDir = new File('../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/android/capacitor')
3+
project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
44

55
include ':capacitor-app'
6-
project(':capacitor-app').projectDir = new File('../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/app/android')
6+
project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android')
77

88
include ':capacitor-haptics'
9-
project(':capacitor-haptics').projectDir = new File('../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/haptics/android')
9+
project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/haptics/android')
1010

1111
include ':capacitor-inappbrowser'
1212
project(':capacitor-inappbrowser').projectDir = new File('../node_modules/@capacitor/inappbrowser/android')
1313

1414
include ':capacitor-keyboard'
15-
project(':capacitor-keyboard').projectDir = new File('../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/keyboard/android')
15+
project(':capacitor-keyboard').projectDir = new File('../node_modules/@capacitor/keyboard/android')
1616

1717
include ':capacitor-status-bar'
18-
project(':capacitor-status-bar').projectDir = new File('../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/status-bar/android')
18+
project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android')

example-app/ios/App/Podfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require_relative '../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/ios/scripts/pods_helpers'
1+
require_relative '../../node_modules/@capacitor/ios/scripts/pods_helpers'
22

33
platform :ios, '14.0'
44
use_frameworks!
@@ -9,13 +9,13 @@ use_frameworks!
99
install! 'cocoapods', :disable_input_output_paths => true
1010

1111
def capacitor_pods
12-
pod 'Capacitor', :path => '../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/ios'
13-
pod 'CapacitorCordova', :path => '../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/ios'
14-
pod 'CapacitorApp', :path => '../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/app'
15-
pod 'CapacitorHaptics', :path => '../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/haptics'
16-
pod 'CapacitorInappbrowser', :path => '../../node_modules/.pnpm/@capacitor+inappbrowser@file+.._@[email protected]/node_modules/@capacitor/inappbrowser'
17-
pod 'CapacitorKeyboard', :path => '../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/keyboard'
18-
pod 'CapacitorStatusBar', :path => '../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/status-bar'
12+
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
13+
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
14+
pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app'
15+
pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
16+
pod 'CapacitorInappbrowser', :path => '../../..'
17+
pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
18+
pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
1919
end
2020

2121
target 'App' do

0 commit comments

Comments
 (0)