@onekeyfe/inpage-providers-hub 2.1.8 → 2.1.9
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.
|
@@ -10,9 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.listenPageFocus = exports.detectWebsiteRiskLevel = void 0;
|
|
13
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
14
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
15
|
-
const cross_inpage_provider_core_1 = require("@onekeyfe/cross-inpage-provider-core");
|
|
16
13
|
const style_1 = require("./style");
|
|
17
14
|
var EHostSecurityLevel;
|
|
18
15
|
(function (EHostSecurityLevel) {
|
|
@@ -143,10 +140,16 @@ function detectWebsiteRiskLevel() {
|
|
|
143
140
|
exports.detectWebsiteRiskLevel = detectWebsiteRiskLevel;
|
|
144
141
|
function listenPageFocus() {
|
|
145
142
|
// Notify the frontend of the last focused URL when the function is called
|
|
146
|
-
|
|
143
|
+
const notifyToBackground = () => {
|
|
144
|
+
if (window.top !== window.self) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
147
|
void window.$onekey.$private.request({
|
|
148
148
|
method: "wallet_lastFocusUrl",
|
|
149
149
|
});
|
|
150
|
+
};
|
|
151
|
+
try {
|
|
152
|
+
notifyToBackground();
|
|
150
153
|
}
|
|
151
154
|
catch (_a) {
|
|
152
155
|
// ignore
|
|
@@ -154,12 +157,7 @@ function listenPageFocus() {
|
|
|
154
157
|
// Add a focus event listener to the window
|
|
155
158
|
window.addEventListener('focus', () => {
|
|
156
159
|
try {
|
|
157
|
-
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
void window.$onekey.$private.request({
|
|
161
|
-
method: "wallet_lastFocusUrl",
|
|
162
|
-
});
|
|
160
|
+
notifyToBackground();
|
|
163
161
|
}
|
|
164
162
|
catch (error) {
|
|
165
163
|
console.error('Error notifying frontend of page focus:', error);
|
|
@@ -7,9 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
11
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
12
|
-
import { isInSameOriginIframe } from '@onekeyfe/cross-inpage-provider-core';
|
|
13
10
|
import { styleContent } from "./style";
|
|
14
11
|
var EHostSecurityLevel;
|
|
15
12
|
(function (EHostSecurityLevel) {
|
|
@@ -139,10 +136,16 @@ export function detectWebsiteRiskLevel() {
|
|
|
139
136
|
}
|
|
140
137
|
export function listenPageFocus() {
|
|
141
138
|
// Notify the frontend of the last focused URL when the function is called
|
|
142
|
-
|
|
139
|
+
const notifyToBackground = () => {
|
|
140
|
+
if (window.top !== window.self) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
143
|
void window.$onekey.$private.request({
|
|
144
144
|
method: "wallet_lastFocusUrl",
|
|
145
145
|
});
|
|
146
|
+
};
|
|
147
|
+
try {
|
|
148
|
+
notifyToBackground();
|
|
146
149
|
}
|
|
147
150
|
catch (_a) {
|
|
148
151
|
// ignore
|
|
@@ -150,12 +153,7 @@ export function listenPageFocus() {
|
|
|
150
153
|
// Add a focus event listener to the window
|
|
151
154
|
window.addEventListener('focus', () => {
|
|
152
155
|
try {
|
|
153
|
-
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
void window.$onekey.$private.request({
|
|
157
|
-
method: "wallet_lastFocusUrl",
|
|
158
|
-
});
|
|
156
|
+
notifyToBackground();
|
|
159
157
|
}
|
|
160
158
|
catch (error) {
|
|
161
159
|
console.error('Error notifying frontend of page focus:', error);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/inpage-providers-hub",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.9",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"cross-inpage-provider"
|
|
6
6
|
],
|
|
@@ -30,26 +30,26 @@
|
|
|
30
30
|
"start": "tsc --watch"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@onekeyfe/cross-inpage-provider-core": "2.1.
|
|
34
|
-
"@onekeyfe/cross-inpage-provider-types": "2.1.
|
|
35
|
-
"@onekeyfe/onekey-algo-provider": "2.1.
|
|
36
|
-
"@onekeyfe/onekey-alph-provider": "2.1.
|
|
37
|
-
"@onekeyfe/onekey-aptos-provider": "2.1.
|
|
38
|
-
"@onekeyfe/onekey-btc-provider": "2.1.
|
|
39
|
-
"@onekeyfe/onekey-cardano-provider": "2.1.
|
|
40
|
-
"@onekeyfe/onekey-conflux-provider": "2.1.
|
|
41
|
-
"@onekeyfe/onekey-cosmos-provider": "2.1.
|
|
42
|
-
"@onekeyfe/onekey-eth-provider": "2.1.
|
|
43
|
-
"@onekeyfe/onekey-nostr-provider": "2.1.
|
|
44
|
-
"@onekeyfe/onekey-polkadot-provider": "2.1.
|
|
45
|
-
"@onekeyfe/onekey-private-external-account-provider": "2.1.
|
|
46
|
-
"@onekeyfe/onekey-private-provider": "2.1.
|
|
47
|
-
"@onekeyfe/onekey-scdo-provider": "2.1.
|
|
48
|
-
"@onekeyfe/onekey-solana-provider": "2.1.
|
|
49
|
-
"@onekeyfe/onekey-sui-provider": "2.1.
|
|
50
|
-
"@onekeyfe/onekey-ton-provider": "2.1.
|
|
51
|
-
"@onekeyfe/onekey-tron-provider": "2.1.
|
|
52
|
-
"@onekeyfe/onekey-webln-provider": "2.1.
|
|
33
|
+
"@onekeyfe/cross-inpage-provider-core": "2.1.9",
|
|
34
|
+
"@onekeyfe/cross-inpage-provider-types": "2.1.9",
|
|
35
|
+
"@onekeyfe/onekey-algo-provider": "2.1.9",
|
|
36
|
+
"@onekeyfe/onekey-alph-provider": "2.1.9",
|
|
37
|
+
"@onekeyfe/onekey-aptos-provider": "2.1.9",
|
|
38
|
+
"@onekeyfe/onekey-btc-provider": "2.1.9",
|
|
39
|
+
"@onekeyfe/onekey-cardano-provider": "2.1.9",
|
|
40
|
+
"@onekeyfe/onekey-conflux-provider": "2.1.9",
|
|
41
|
+
"@onekeyfe/onekey-cosmos-provider": "2.1.9",
|
|
42
|
+
"@onekeyfe/onekey-eth-provider": "2.1.9",
|
|
43
|
+
"@onekeyfe/onekey-nostr-provider": "2.1.9",
|
|
44
|
+
"@onekeyfe/onekey-polkadot-provider": "2.1.9",
|
|
45
|
+
"@onekeyfe/onekey-private-external-account-provider": "2.1.9",
|
|
46
|
+
"@onekeyfe/onekey-private-provider": "2.1.9",
|
|
47
|
+
"@onekeyfe/onekey-scdo-provider": "2.1.9",
|
|
48
|
+
"@onekeyfe/onekey-solana-provider": "2.1.9",
|
|
49
|
+
"@onekeyfe/onekey-sui-provider": "2.1.9",
|
|
50
|
+
"@onekeyfe/onekey-ton-provider": "2.1.9",
|
|
51
|
+
"@onekeyfe/onekey-tron-provider": "2.1.9",
|
|
52
|
+
"@onekeyfe/onekey-webln-provider": "2.1.9",
|
|
53
53
|
"web3": "^1.7.3"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"@types/node": "^20.12.7",
|
|
58
58
|
"playwright": "^1.43.1"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "dd6a7ac0873030af3f1e589a7d963200f4295a48"
|
|
61
61
|
}
|