@capacitor/browser 6.0.4 → 7.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CapacitorBrowser.podspec +1 -1
- package/Package.swift +2 -2
- package/README.md +1 -1
- package/android/build.gradle +10 -10
- package/android/src/main/java/com/capacitorjs/plugins/browser/BrowserPlugin.java +14 -14
- package/dist/plugin.cjs.js +2 -4
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +2 -4
- package/dist/plugin.js.map +1 -1
- package/package.json +10 -10
package/CapacitorBrowser.podspec
CHANGED
|
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] }
|
|
13
13
|
s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'browser/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
-
s.ios.deployment_target
|
|
14
|
+
s.ios.deployment_target = '14.0'
|
|
15
15
|
s.dependency 'Capacitor'
|
|
16
16
|
s.swift_version = '5.1'
|
|
17
17
|
end
|
package/Package.swift
CHANGED
|
@@ -3,14 +3,14 @@ import PackageDescription
|
|
|
3
3
|
|
|
4
4
|
let package = Package(
|
|
5
5
|
name: "CapacitorBrowser",
|
|
6
|
-
platforms: [.iOS(.
|
|
6
|
+
platforms: [.iOS(.v14)],
|
|
7
7
|
products: [
|
|
8
8
|
.library(
|
|
9
9
|
name: "CapacitorBrowser",
|
|
10
10
|
targets: ["BrowserPlugin"])
|
|
11
11
|
],
|
|
12
12
|
dependencies: [
|
|
13
|
-
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git",
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", branch: "main")
|
|
14
14
|
],
|
|
15
15
|
targets: [
|
|
16
16
|
.target(
|
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ npx cap sync
|
|
|
17
17
|
|
|
18
18
|
This plugin will use the following project variables (defined in your app's `variables.gradle` file):
|
|
19
19
|
|
|
20
|
-
- `androidxBrowserVersion`: version of `androidx.browser:browser` (default: `1.
|
|
20
|
+
- `androidxBrowserVersion`: version of `androidx.browser:browser` (default: `1.8.0`)
|
|
21
21
|
|
|
22
22
|
## Example
|
|
23
23
|
|
package/android/build.gradle
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
ext {
|
|
2
2
|
capacitorVersion = System.getenv('CAPACITOR_VERSION')
|
|
3
3
|
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
4
|
-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.
|
|
5
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1
|
|
6
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.
|
|
7
|
-
androidxBrowserVersion = project.hasProperty('androidxBrowserVersion') ? rootProject.ext.androidxBrowserVersion : '1.
|
|
4
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
|
|
5
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
|
|
6
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
|
|
7
|
+
androidxBrowserVersion = project.hasProperty('androidxBrowserVersion') ? rootProject.ext.androidxBrowserVersion : '1.8.0'
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
buildscript {
|
|
@@ -16,7 +16,7 @@ buildscript {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
dependencies {
|
|
19
|
-
classpath 'com.android.tools.build:gradle:8.2
|
|
19
|
+
classpath 'com.android.tools.build:gradle:8.7.2'
|
|
20
20
|
if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
|
|
21
21
|
classpath 'io.github.gradle-nexus:publish-plugin:1.3.0'
|
|
22
22
|
}
|
|
@@ -32,10 +32,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
|
|
|
32
32
|
|
|
33
33
|
android {
|
|
34
34
|
namespace "com.capacitorjs.plugins.browser"
|
|
35
|
-
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion :
|
|
35
|
+
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
|
|
36
36
|
defaultConfig {
|
|
37
|
-
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion :
|
|
38
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
37
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23
|
|
38
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
|
|
39
39
|
versionCode 1
|
|
40
40
|
versionName "1.0"
|
|
41
41
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -50,8 +50,8 @@ android {
|
|
|
50
50
|
abortOnError false
|
|
51
51
|
}
|
|
52
52
|
compileOptions {
|
|
53
|
-
sourceCompatibility JavaVersion.
|
|
54
|
-
targetCompatibility JavaVersion.
|
|
53
|
+
sourceCompatibility JavaVersion.VERSION_21
|
|
54
|
+
targetCompatibility JavaVersion.VERSION_21
|
|
55
55
|
}
|
|
56
56
|
publishing {
|
|
57
57
|
singleVariant("release")
|
|
@@ -60,25 +60,25 @@ public class BrowserPlugin extends Plugin {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
// open the browser and finish
|
|
63
|
-
try {
|
|
64
|
-
Intent intent = new Intent(getContext(), BrowserControllerActivity.class);
|
|
65
|
-
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
66
|
-
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
67
|
-
getContext().startActivity(intent);
|
|
68
63
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
64
|
+
Intent intent = new Intent(getContext(), BrowserControllerActivity.class);
|
|
65
|
+
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
66
|
+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
67
|
+
getContext().startActivity(intent);
|
|
68
|
+
|
|
69
|
+
Integer finalToolbarColor = toolbarColor;
|
|
70
|
+
setBrowserControllerListener(
|
|
71
|
+
activity -> {
|
|
72
|
+
try {
|
|
72
73
|
activity.open(implementation, url, finalToolbarColor);
|
|
73
74
|
browserControllerActivityInstance = activity;
|
|
74
75
|
call.resolve();
|
|
76
|
+
} catch (ActivityNotFoundException ex) {
|
|
77
|
+
Logger.error(getLogTag(), ex.getLocalizedMessage(), null);
|
|
78
|
+
call.reject("Unable to display URL");
|
|
75
79
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
Logger.error(getLogTag(), ex.getLocalizedMessage(), null);
|
|
79
|
-
call.reject("Unable to display URL");
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
@PluginMethod
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var core = require('@capacitor/core');
|
|
6
4
|
|
|
7
5
|
const Browser$1 = core.registerPlugin('Browser', {
|
|
@@ -33,8 +31,8 @@ const Browser = new BrowserWeb();
|
|
|
33
31
|
|
|
34
32
|
var web = /*#__PURE__*/Object.freeze({
|
|
35
33
|
__proto__: null,
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
Browser: Browser,
|
|
35
|
+
BrowserWeb: BrowserWeb
|
|
38
36
|
});
|
|
39
37
|
|
|
40
38
|
exports.Browser = Browser$1;
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Browser = registerPlugin('Browser', {\n web: () => import('./web').then(m => new m.BrowserWeb()),\n});\nexport * from './definitions';\nexport { Browser };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class BrowserWeb extends WebPlugin {\n constructor() {\n super();\n this._lastWindow = null;\n }\n async open(options) {\n this._lastWindow = window.open(options.url, options.windowName || '_blank');\n }\n async close() {\n return new Promise((resolve, reject) => {\n if (this._lastWindow != null) {\n this._lastWindow.close();\n this._lastWindow = null;\n resolve();\n }\n else {\n reject('No active window to close!');\n }\n });\n }\n}\nconst Browser = new BrowserWeb();\nexport { Browser };\n//# sourceMappingURL=web.js.map"],"names":["Browser","registerPlugin","WebPlugin"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Browser = registerPlugin('Browser', {\n web: () => import('./web').then(m => new m.BrowserWeb()),\n});\nexport * from './definitions';\nexport { Browser };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class BrowserWeb extends WebPlugin {\n constructor() {\n super();\n this._lastWindow = null;\n }\n async open(options) {\n this._lastWindow = window.open(options.url, options.windowName || '_blank');\n }\n async close() {\n return new Promise((resolve, reject) => {\n if (this._lastWindow != null) {\n this._lastWindow.close();\n this._lastWindow = null;\n resolve();\n }\n else {\n reject('No active window to close!');\n }\n });\n }\n}\nconst Browser = new BrowserWeb();\nexport { Browser };\n//# sourceMappingURL=web.js.map"],"names":["Browser","registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAACA,SAAO,GAAGC,mBAAc,CAAC,SAAS,EAAE;AAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;AAC5D,CAAC;;ACFM,MAAM,UAAU,SAASC,cAAS,CAAC;AAC1C,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,EAAE;AACf,QAAQ,IAAI,CAAC,WAAW,GAAG,IAAI;AAC/B;AACA,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,UAAU,IAAI,QAAQ,CAAC;AACnF;AACA,IAAI,MAAM,KAAK,GAAG;AAClB,QAAQ,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK;AAChD,YAAY,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE;AAC1C,gBAAgB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE;AACxC,gBAAgB,IAAI,CAAC,WAAW,GAAG,IAAI;AACvC,gBAAgB,OAAO,EAAE;AACzB;AACA,iBAAiB;AACjB,gBAAgB,MAAM,CAAC,4BAA4B,CAAC;AACpD;AACA,SAAS,CAAC;AACV;AACA;AACA,MAAM,OAAO,GAAG,IAAI,UAAU,EAAE;;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -30,14 +30,12 @@ var capacitorBrowser = (function (exports, core) {
|
|
|
30
30
|
|
|
31
31
|
var web = /*#__PURE__*/Object.freeze({
|
|
32
32
|
__proto__: null,
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
Browser: Browser,
|
|
34
|
+
BrowserWeb: BrowserWeb
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
exports.Browser = Browser$1;
|
|
38
38
|
|
|
39
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
40
|
-
|
|
41
39
|
return exports;
|
|
42
40
|
|
|
43
41
|
})({}, capacitorExports);
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Browser = registerPlugin('Browser', {\n web: () => import('./web').then(m => new m.BrowserWeb()),\n});\nexport * from './definitions';\nexport { Browser };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class BrowserWeb extends WebPlugin {\n constructor() {\n super();\n this._lastWindow = null;\n }\n async open(options) {\n this._lastWindow = window.open(options.url, options.windowName || '_blank');\n }\n async close() {\n return new Promise((resolve, reject) => {\n if (this._lastWindow != null) {\n this._lastWindow.close();\n this._lastWindow = null;\n resolve();\n }\n else {\n reject('No active window to close!');\n }\n });\n }\n}\nconst Browser = new BrowserWeb();\nexport { Browser };\n//# sourceMappingURL=web.js.map"],"names":["Browser","registerPlugin","WebPlugin"],"mappings":";;;AACK,UAACA,SAAO,GAAGC,mBAAc,CAAC,SAAS,EAAE;IAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IAC5D,CAAC;;ICFM,MAAM,UAAU,SAASC,cAAS,CAAC;IAC1C,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,EAAE
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Browser = registerPlugin('Browser', {\n web: () => import('./web').then(m => new m.BrowserWeb()),\n});\nexport * from './definitions';\nexport { Browser };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class BrowserWeb extends WebPlugin {\n constructor() {\n super();\n this._lastWindow = null;\n }\n async open(options) {\n this._lastWindow = window.open(options.url, options.windowName || '_blank');\n }\n async close() {\n return new Promise((resolve, reject) => {\n if (this._lastWindow != null) {\n this._lastWindow.close();\n this._lastWindow = null;\n resolve();\n }\n else {\n reject('No active window to close!');\n }\n });\n }\n}\nconst Browser = new BrowserWeb();\nexport { Browser };\n//# sourceMappingURL=web.js.map"],"names":["Browser","registerPlugin","WebPlugin"],"mappings":";;;AACK,UAACA,SAAO,GAAGC,mBAAc,CAAC,SAAS,EAAE;IAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IAC5D,CAAC;;ICFM,MAAM,UAAU,SAASC,cAAS,CAAC;IAC1C,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,EAAE;IACf,QAAQ,IAAI,CAAC,WAAW,GAAG,IAAI;IAC/B;IACA,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,UAAU,IAAI,QAAQ,CAAC;IACnF;IACA,IAAI,MAAM,KAAK,GAAG;IAClB,QAAQ,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK;IAChD,YAAY,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE;IAC1C,gBAAgB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE;IACxC,gBAAgB,IAAI,CAAC,WAAW,GAAG,IAAI;IACvC,gBAAgB,OAAO,EAAE;IACzB;IACA,iBAAiB;IACjB,gBAAgB,MAAM,CAAC,4BAA4B,CAAC;IACpD;IACA,SAAS,CAAC;IACV;IACA;IACA,MAAM,OAAO,GAAG,IAAI,UAAU,EAAE;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/browser",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-alpha.2",
|
|
4
4
|
"description": "The Browser API provides the ability to open an in-app browser and subscribe to browser events.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
],
|
|
32
32
|
"scripts": {
|
|
33
33
|
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
34
|
-
"verify:ios": "xcodebuild build -scheme CapacitorBrowser -
|
|
34
|
+
"verify:ios": "xcodebuild build -scheme CapacitorBrowser -destination generic/platform=iOS",
|
|
35
35
|
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
36
36
|
"verify:web": "npm run build",
|
|
37
37
|
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
@@ -40,30 +40,30 @@
|
|
|
40
40
|
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
|
|
41
41
|
"swiftlint": "node-swiftlint",
|
|
42
42
|
"docgen": "docgen --api BrowserPlugin --output-readme README.md --output-json dist/docs.json",
|
|
43
|
-
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.
|
|
43
|
+
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
44
44
|
"clean": "rimraf ./dist",
|
|
45
45
|
"watch": "tsc --watch",
|
|
46
46
|
"prepublishOnly": "npm run build",
|
|
47
47
|
"publish:cocoapod": "pod trunk push ./CapacitorBrowser.podspec --allow-warnings"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@capacitor/android": "
|
|
51
|
-
"@capacitor/core": "
|
|
50
|
+
"@capacitor/android": "next",
|
|
51
|
+
"@capacitor/core": "next",
|
|
52
52
|
"@capacitor/docgen": "0.2.2",
|
|
53
|
-
"@capacitor/ios": "
|
|
53
|
+
"@capacitor/ios": "next",
|
|
54
54
|
"@ionic/eslint-config": "^0.4.0",
|
|
55
55
|
"@ionic/prettier-config": "~1.0.1",
|
|
56
56
|
"@ionic/swiftlint-config": "^1.1.2",
|
|
57
57
|
"eslint": "^8.57.0",
|
|
58
58
|
"prettier": "~2.3.0",
|
|
59
59
|
"prettier-plugin-java": "~1.0.2",
|
|
60
|
-
"rimraf": "^
|
|
61
|
-
"rollup": "^
|
|
60
|
+
"rimraf": "^6.0.1",
|
|
61
|
+
"rollup": "^4.26.0",
|
|
62
62
|
"swiftlint": "^1.0.1",
|
|
63
63
|
"typescript": "~4.1.5"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@capacitor/core": "
|
|
66
|
+
"@capacitor/core": "next"
|
|
67
67
|
},
|
|
68
68
|
"prettier": "@ionic/prettier-config",
|
|
69
69
|
"swiftlint": "@ionic/swiftlint-config",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "023f53b42a81049b7cdef6c7b0102b85b4df1c01"
|
|
85
85
|
}
|