@alicloud/sandbox-escape 1.0.2 → 1.1.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/build/cjs/index.js
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
6
|
var _util = require("./util");
|
|
8
|
-
|
|
9
7
|
Object.keys(_util).forEach(function (key) {
|
|
10
8
|
if (key === "default" || key === "__esModule") return;
|
|
11
9
|
if (key in exports && exports[key] === _util[key]) return;
|
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = getWindow;
|
|
9
|
-
|
|
10
8
|
var _getWindowByNewFunction = _interopRequireDefault(require("./get-window-by-new-function"));
|
|
11
|
-
|
|
12
9
|
var _getWindowByDom = _interopRequireDefault(require("./get-window-by-dom"));
|
|
13
|
-
|
|
14
10
|
var win;
|
|
11
|
+
|
|
15
12
|
/**
|
|
16
13
|
* 避免沙箱模式下 window 被 with 劫持
|
|
17
14
|
*/
|
|
18
|
-
|
|
19
15
|
function getWindow() {
|
|
20
16
|
if (!win) {
|
|
21
17
|
// 取一次即可
|
|
22
18
|
win = (0, _getWindowByNewFunction.default)() || (0, _getWindowByDom.default)() || window;
|
|
23
19
|
}
|
|
24
|
-
|
|
25
20
|
return win;
|
|
26
21
|
}
|
package/build/cjs/util/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -11,5 +10,4 @@ Object.defineProperty(exports, "getWindow", {
|
|
|
11
10
|
return _getWindow.default;
|
|
12
11
|
}
|
|
13
12
|
});
|
|
14
|
-
|
|
15
13
|
var _getWindow = _interopRequireDefault(require("./get-window"));
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import getWindowByNewFunction from './get-window-by-new-function';
|
|
2
2
|
import getWindowByDom from './get-window-by-dom';
|
|
3
3
|
var win;
|
|
4
|
+
|
|
4
5
|
/**
|
|
5
6
|
* 避免沙箱模式下 window 被 with 劫持
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
8
|
export default function getWindow() {
|
|
9
9
|
if (!win) {
|
|
10
10
|
// 取一次即可
|
|
11
11
|
win = getWindowByNewFunction() || getWindowByDom() || window;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
13
|
return win;
|
|
15
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alicloud/sandbox-escape",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "沙箱逃逸",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "build/cjs/index.js",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@alicloud/console-toolkit-cli": "^1.2.30",
|
|
28
28
|
"@alicloud/console-toolkit-preset-component": "^1.2.61",
|
|
29
|
-
"@types/lodash": "^4.14.
|
|
29
|
+
"@types/lodash": "^4.14.186",
|
|
30
30
|
"@types/react": "^17.0.48",
|
|
31
31
|
"react": "^17.0.2",
|
|
32
|
-
"typescript": "^4.
|
|
32
|
+
"typescript": "^4.8.4"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"start": "breezr start-storybook",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"clean": "rm -rf build",
|
|
43
43
|
"prepublishOnly": "yarn clean && yarn build"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "4b5eefd0215b1f8028fce664d64484ceeb703ef1"
|
|
46
46
|
}
|