@onekeyfe/extension-bridge-hosted 2.1.16 → 2.1.17
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/dist/JsBridgeExtBackground.d.ts +0 -1
- package/dist/JsBridgeExtBackground.js +1 -1
- package/dist/JsBridgeExtOffscreen.d.ts +0 -1
- package/dist/JsBridgeExtUi.d.ts +0 -1
- package/dist/bridgeSetup/index.d.ts +6 -6
- package/dist/cjs/JsBridgeExtBackground.js +18 -8
- package/dist/extensionMessagePort.d.ts +0 -1
- package/dist/utils.d.ts +0 -1
- package/package.json +4 -4
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="chrome" />
|
|
2
1
|
import { IInjectedProviderNamesStrings, IJsBridgeConfig, IJsBridgeMessagePayload } from '@onekeyfe/cross-inpage-provider-types';
|
|
3
2
|
import { JsBridgeBase } from '@onekeyfe/cross-inpage-provider-core';
|
|
4
3
|
declare class JsBridgeExtBackground extends JsBridgeBase {
|
|
@@ -120,7 +120,7 @@ class JsBridgeExtBackground extends JsBridgeBase {
|
|
|
120
120
|
requestToAllCS(scope, data, targetOrigin) {
|
|
121
121
|
// TODO optimize rename: broadcastRequest
|
|
122
122
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
123
|
-
entries(this.ports).forEach((
|
|
123
|
+
entries(this.ports).forEach((_a) => __awaiter(this, [_a], void 0, function* ([portId, port]) {
|
|
124
124
|
if (port.name === EXT_PORT_CS_TO_BG) {
|
|
125
125
|
const origin = utils.getOriginFromPort(port);
|
|
126
126
|
if (isFunction(data)) {
|
package/dist/JsBridgeExtUi.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
export declare const bridgeSetup: {
|
|
2
2
|
contentScript: {
|
|
3
3
|
inject: ({ file, code, remove, }: {
|
|
4
|
-
file?: string
|
|
5
|
-
code?: string
|
|
6
|
-
remove?: boolean
|
|
4
|
+
file?: string;
|
|
5
|
+
code?: string;
|
|
6
|
+
remove?: boolean;
|
|
7
7
|
}) => void;
|
|
8
8
|
setupMessagePort: (options?: import("@onekeyfe/cross-inpage-provider-types").IOptionsWithDebugLogger) => void;
|
|
9
9
|
};
|
|
10
10
|
ui: {
|
|
11
|
-
createUiJsBridge: (config: import("..").IJsBridgeExtUiConfig) => import("
|
|
11
|
+
createUiJsBridge: (config: import("..").IJsBridgeExtUiConfig) => import("..").JsBridgeExtUi;
|
|
12
12
|
};
|
|
13
13
|
background: {
|
|
14
14
|
createHostBridge: ({ receiveHandler }: {
|
|
15
15
|
receiveHandler: import("@onekeyfe/cross-inpage-provider-types").IJsBridgeReceiveHandler;
|
|
16
|
-
}) => import("
|
|
16
|
+
}) => import("..").JsBridgeExtBackground;
|
|
17
17
|
};
|
|
18
18
|
offscreen: {
|
|
19
|
-
createOffscreenJsBridge: (config: import("..").IJsBridgeExtOffscreenConfig) => import("
|
|
19
|
+
createOffscreenJsBridge: (config: import("..").IJsBridgeExtOffscreenConfig) => import("..").JsBridgeExtOffscreen;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -149,7 +159,7 @@ class JsBridgeExtBackground extends cross_inpage_provider_core_1.JsBridgeBase {
|
|
|
149
159
|
requestToAllCS(scope, data, targetOrigin) {
|
|
150
160
|
// TODO optimize rename: broadcastRequest
|
|
151
161
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
152
|
-
(0, entries_1.default)(this.ports).forEach((
|
|
162
|
+
(0, entries_1.default)(this.ports).forEach((_a) => __awaiter(this, [_a], void 0, function* ([portId, port]) {
|
|
153
163
|
if (port.name === EXT_PORT_CS_TO_BG) {
|
|
154
164
|
const origin = utils_1.default.getOriginFromPort(port);
|
|
155
165
|
if ((0, isFunction_1.default)(data)) {
|
package/dist/utils.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/extension-bridge-hosted",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.17",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"cross-inpage-provider"
|
|
6
6
|
],
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"start": "tsc --watch"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@onekeyfe/cross-inpage-provider-core": "2.1.
|
|
32
|
-
"@onekeyfe/cross-inpage-provider-types": "2.1.
|
|
31
|
+
"@onekeyfe/cross-inpage-provider-core": "2.1.17",
|
|
32
|
+
"@onekeyfe/cross-inpage-provider-types": "2.1.17",
|
|
33
33
|
"uuid": "^8.3.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/uuid": "^8.3.4"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "6b9e350734a850a60dbf9fa4406190900f8f13f2"
|
|
39
39
|
}
|