@capacitor/browser 8.0.0-alpha.1 → 8.0.0-beta.0
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/Package.swift +1 -1
- package/README.md +1 -1
- package/android/build.gradle +9 -9
- package/android/src/main/java/com/capacitorjs/plugins/browser/Browser.java +7 -8
- package/android/src/main/java/com/capacitorjs/plugins/browser/BrowserPlugin.java +9 -11
- package/dist/esm/definitions.d.ts +1 -1
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +1 -1
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +1 -1
- package/dist/plugin.js.map +1 -1
- package/package.json +13 -13
package/Package.swift
CHANGED
|
@@ -10,7 +10,7 @@ let package = Package(
|
|
|
10
10
|
targets: ["BrowserPlugin"])
|
|
11
11
|
],
|
|
12
12
|
dependencies: [
|
|
13
|
-
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0-beta")
|
|
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.9.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.7.
|
|
5
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '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.1'
|
|
5
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
|
|
6
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
|
|
7
|
+
androidxBrowserVersion = project.hasProperty('androidxBrowserVersion') ? rootProject.ext.androidxBrowserVersion : '1.9.0'
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
buildscript {
|
|
@@ -12,11 +12,11 @@ buildscript {
|
|
|
12
12
|
google()
|
|
13
13
|
mavenCentral()
|
|
14
14
|
maven {
|
|
15
|
-
url "https://plugins.gradle.org/m2/"
|
|
15
|
+
url = "https://plugins.gradle.org/m2/"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
dependencies {
|
|
19
|
-
classpath 'com.android.tools.build:gradle:8.
|
|
19
|
+
classpath 'com.android.tools.build:gradle:8.13.0'
|
|
20
20
|
if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
|
|
21
21
|
classpath 'io.github.gradle-nexus:publish-plugin:1.3.0'
|
|
22
22
|
}
|
|
@@ -31,8 +31,8 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
android {
|
|
34
|
-
namespace "com.capacitorjs.plugins.browser"
|
|
35
|
-
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
|
|
34
|
+
namespace = "com.capacitorjs.plugins.browser"
|
|
35
|
+
compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
|
|
36
36
|
defaultConfig {
|
|
37
37
|
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
|
|
38
38
|
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
|
|
@@ -47,7 +47,7 @@ android {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
lintOptions {
|
|
50
|
-
abortOnError false
|
|
50
|
+
abortOnError = false
|
|
51
51
|
}
|
|
52
52
|
compileOptions {
|
|
53
53
|
sourceCompatibility JavaVersion.VERSION_21
|
|
@@ -168,15 +168,14 @@ public class Browser {
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
if (browserSession == null) {
|
|
171
|
-
browserSession =
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
handledNavigationEvent(navigationEvent);
|
|
177
|
-
}
|
|
171
|
+
browserSession = customTabsClient.newSession(
|
|
172
|
+
new CustomTabsCallback() {
|
|
173
|
+
@Override
|
|
174
|
+
public void onNavigationEvent(int navigationEvent, Bundle extras) {
|
|
175
|
+
handledNavigationEvent(navigationEvent);
|
|
178
176
|
}
|
|
179
|
-
|
|
177
|
+
}
|
|
178
|
+
);
|
|
180
179
|
}
|
|
181
180
|
|
|
182
181
|
return browserSession;
|
|
@@ -67,18 +67,16 @@ public class BrowserPlugin extends Plugin {
|
|
|
67
67
|
getContext().startActivity(intent);
|
|
68
68
|
|
|
69
69
|
Integer finalToolbarColor = toolbarColor;
|
|
70
|
-
setBrowserControllerListener(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
call.reject("Unable to display URL");
|
|
79
|
-
}
|
|
70
|
+
setBrowserControllerListener((activity) -> {
|
|
71
|
+
try {
|
|
72
|
+
activity.open(implementation, url, finalToolbarColor);
|
|
73
|
+
browserControllerActivityInstance = activity;
|
|
74
|
+
call.resolve();
|
|
75
|
+
} catch (ActivityNotFoundException ex) {
|
|
76
|
+
Logger.error(getLogTag(), ex.getLocalizedMessage(), null);
|
|
77
|
+
call.reject("Unable to display URL");
|
|
80
78
|
}
|
|
81
|
-
);
|
|
79
|
+
});
|
|
82
80
|
}
|
|
83
81
|
|
|
84
82
|
@PluginMethod
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport interface BrowserPlugin {\n /**\n * Open a page with the specified options.\n *\n * @since 1.0.0\n */\n open(options: OpenOptions): Promise<void>;\n\n /**\n * Web & iOS only: Close an open browser window.\n *\n * No-op on other platforms.\n *\n * @since 1.0.0\n */\n close(): Promise<void>;\n\n /**\n * Android & iOS only: Listen for the browser finished event.\n * It fires when the Browser is closed by the user.\n *\n * @since 1.0.0\n */\n addListener(
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport interface BrowserPlugin {\n /**\n * Open a page with the specified options.\n *\n * @since 1.0.0\n */\n open(options: OpenOptions): Promise<void>;\n\n /**\n * Web & iOS only: Close an open browser window.\n *\n * No-op on other platforms.\n *\n * @since 1.0.0\n */\n close(): Promise<void>;\n\n /**\n * Android & iOS only: Listen for the browser finished event.\n * It fires when the Browser is closed by the user.\n *\n * @since 1.0.0\n */\n addListener(eventName: 'browserFinished', listenerFunc: () => void): Promise<PluginListenerHandle>;\n\n /**\n * Android & iOS only: Listen for the page loaded event.\n * It's only fired when the URL passed to open method finish loading.\n * It is not invoked for any subsequent page loads.\n *\n * @since 1.0.0\n */\n addListener(eventName: 'browserPageLoaded', listenerFunc: () => void): Promise<PluginListenerHandle>;\n\n /**\n * Remove all native listeners for this plugin.\n *\n * @since 1.0.0\n */\n removeAllListeners(): Promise<void>;\n}\n\n/**\n * Represents the options passed to `open`.\n *\n * @since 1.0.0\n */\nexport interface OpenOptions {\n /**\n * The URL to which the browser is opened.\n *\n * @since 1.0.0\n */\n url: string;\n\n /**\n * Web only: Optional target for browser open. Follows\n * the `target` property for window.open. Defaults\n * to _blank.\n *\n * Ignored on other platforms.\n *\n * @since 1.0.0\n */\n windowName?: string;\n\n /**\n * A hex color to which the toolbar color is set.\n *\n * @since 1.0.0\n */\n toolbarColor?: string;\n\n /**\n * iOS only: The presentation style of the browser. Defaults to fullscreen.\n *\n * Ignored on other platforms.\n *\n * @since 1.0.0\n */\n presentationStyle?: 'fullscreen' | 'popover';\n\n /**\n * iOS only: The width the browser when using presentationStyle 'popover' on iPads.\n *\n * Ignored on other platforms.\n *\n * @since 4.0.0\n */\n width?: number;\n\n /**\n * iOS only: The height the browser when using presentationStyle 'popover' on iPads.\n *\n * Ignored on other platforms.\n *\n * @since 4.0.0\n */\n height?: number;\n}\n\n/**\n * @deprecated Use `OpenOptions`.\n * @since 1.0.0\n */\nexport type BrowserOpenOptions = OpenOptions;\n"]}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { registerPlugin } from '@capacitor/core';
|
|
2
2
|
const Browser = registerPlugin('Browser', {
|
|
3
|
-
web: () => import('./web').then(m => new m.BrowserWeb()),
|
|
3
|
+
web: () => import('./web').then((m) => new m.BrowserWeb()),
|
|
4
4
|
});
|
|
5
5
|
export * from './definitions';
|
|
6
6
|
export { Browser };
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,OAAO,GAAG,cAAc,CAAgB,SAAS,EAAE;IACvD,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,OAAO,GAAG,cAAc,CAAgB,SAAS,EAAE;IACvD,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;CAC3D,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { BrowserPlugin } from './definitions';\n\nconst Browser = registerPlugin<BrowserPlugin>('Browser', {\n web: () => import('./web').then((m) => new m.BrowserWeb()),\n});\n\nexport * from './definitions';\nexport { Browser };\n"]}
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,UAAW,SAAQ,SAAS;IAGvC;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAoB;QAC7B,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,UAAU,IAAI,QAAQ,CAAC,CAAC;IAC9E,CAAC;IAED,KAAK,CAAC,KAAK;QACT,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,UAAW,SAAQ,SAAS;IAGvC;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAoB;QAC7B,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,UAAU,IAAI,QAAQ,CAAC,CAAC;IAC9E,CAAC;IAED,KAAK,CAAC,KAAK;QACT,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE,CAAC;gBAC7B,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;gBACzB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;gBACxB,OAAO,EAAE,CAAC;YACZ,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,4BAA4B,CAAC,CAAC;YACvC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,OAAO,GAAG,IAAI,UAAU,EAAE,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { BrowserPlugin, OpenOptions } from './definitions';\n\nexport class BrowserWeb extends WebPlugin implements BrowserPlugin {\n _lastWindow: Window | null;\n\n constructor() {\n super();\n this._lastWindow = null;\n }\n\n async open(options: OpenOptions): Promise<void> {\n this._lastWindow = window.open(options.url, options.windowName || '_blank');\n }\n\n async close(): Promise<void> {\n return new Promise((resolve, reject) => {\n if (this._lastWindow != null) {\n this._lastWindow.close();\n this._lastWindow = null;\n resolve();\n } else {\n reject('No active window to close!');\n }\n });\n }\n}\n\nconst Browser = new BrowserWeb();\n\nexport { Browser };\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var core = require('@capacitor/core');
|
|
4
4
|
|
|
5
5
|
const Browser = core.registerPlugin('Browser', {
|
|
6
|
-
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.BrowserWeb()),
|
|
6
|
+
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.BrowserWeb()),
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
class BrowserWeb extends core.WebPlugin {
|
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":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;AAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,
|
|
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":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;AAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;AAC9D,CAAC;;ACFM,MAAM,UAAU,SAASC,cAAS,CAAC;AAC1C,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,EAAE;AACf,QAAQ,IAAI,CAAC,WAAW,GAAG,IAAI;AAC/B,IAAI;AACJ,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,IAAI;AACJ,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,YAAY;AACZ,iBAAiB;AACjB,gBAAgB,MAAM,CAAC,4BAA4B,CAAC;AACpD,YAAY;AACZ,QAAQ,CAAC,CAAC;AACV,IAAI;AACJ;AACgB,IAAI,UAAU;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -2,7 +2,7 @@ var capacitorBrowser = (function (exports, core) {
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
const Browser = core.registerPlugin('Browser', {
|
|
5
|
-
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.BrowserWeb()),
|
|
5
|
+
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.BrowserWeb()),
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
class BrowserWeb extends core.WebPlugin {
|
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":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;IAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,
|
|
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":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;IAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IAC9D,CAAC;;ICFM,MAAM,UAAU,SAASC,cAAS,CAAC;IAC1C,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,EAAE;IACf,QAAQ,IAAI,CAAC,WAAW,GAAG,IAAI;IAC/B,IAAI;IACJ,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,IAAI;IACJ,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,YAAY;IACZ,iBAAiB;IACjB,gBAAgB,MAAM,CAAC,4BAA4B,CAAC;IACpD,YAAY;IACZ,QAAQ,CAAC,CAAC;IACV,IAAI;IACJ;IACgB,IAAI,UAAU;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/browser",
|
|
3
|
-
"version": "8.0.0-
|
|
3
|
+
"version": "8.0.0-beta.0",
|
|
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",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
38
38
|
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
|
|
39
39
|
"eslint": "eslint . --ext ts",
|
|
40
|
-
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
|
|
40
|
+
"prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
|
|
41
41
|
"swiftlint": "node-swiftlint",
|
|
42
42
|
"docgen": "docgen --api BrowserPlugin --output-readme README.md --output-json dist/docs.json",
|
|
43
43
|
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
@@ -49,18 +49,18 @@
|
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@capacitor/android": "next",
|
|
51
51
|
"@capacitor/core": "next",
|
|
52
|
-
"@capacitor/docgen": "0.
|
|
52
|
+
"@capacitor/docgen": "0.3.0",
|
|
53
53
|
"@capacitor/ios": "next",
|
|
54
54
|
"@ionic/eslint-config": "^0.4.0",
|
|
55
|
-
"@ionic/prettier-config": "
|
|
56
|
-
"@ionic/swiftlint-config": "^
|
|
57
|
-
"eslint": "^8.57.
|
|
58
|
-
"prettier": "
|
|
59
|
-
"prettier-plugin-java": "
|
|
60
|
-
"rimraf": "^6.0
|
|
61
|
-
"rollup": "^4.
|
|
62
|
-
"swiftlint": "^
|
|
63
|
-
"typescript": "
|
|
55
|
+
"@ionic/prettier-config": "^4.0.0",
|
|
56
|
+
"@ionic/swiftlint-config": "^2.0.0",
|
|
57
|
+
"eslint": "^8.57.1",
|
|
58
|
+
"prettier": "^3.6.2",
|
|
59
|
+
"prettier-plugin-java": "^2.7.7",
|
|
60
|
+
"rimraf": "^6.1.0",
|
|
61
|
+
"rollup": "^4.53.2",
|
|
62
|
+
"swiftlint": "^2.0.0",
|
|
63
|
+
"typescript": "^5.9.3"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@capacitor/core": "next"
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "06921fb53dc712720523c13836a92ba371054dcb"
|
|
85
85
|
}
|