@micro-zoe/micro-app 1.0.0-rc.26 → 1.0.0-rc.27
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/lib/index.esm.js +11 -4
- package/lib/index.esm.js.map +1 -1
- package/lib/index.min.js +1 -1
- package/lib/index.min.js.map +1 -1
- package/lib/index.umd.js +1 -1
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/typings/global.d.ts +1 -0
package/lib/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const version = '1.0.0-rc.
|
|
1
|
+
const version = '1.0.0-rc.27';
|
|
2
2
|
// do not use isUndefined
|
|
3
3
|
const isBrowser = typeof window !== 'undefined';
|
|
4
4
|
// do not use isUndefined
|
|
@@ -4983,7 +4983,7 @@ function createMicroXMLHttpRequest(url, target) {
|
|
|
4983
4983
|
const rawXMLHttpRequest = !isUndefined(target) ? target : globalEnv.rawWindow.XMLHttpRequest;
|
|
4984
4984
|
if (!isConstructor(rawXMLHttpRequest))
|
|
4985
4985
|
return rawXMLHttpRequest;
|
|
4986
|
-
|
|
4986
|
+
class MicroXMLHttpRequest extends rawXMLHttpRequest {
|
|
4987
4987
|
open(method, reqUrl, ...rests) {
|
|
4988
4988
|
if ((isString(reqUrl) && !/^f(ile|tp):\/\//.test(reqUrl)) || isURL(reqUrl)) {
|
|
4989
4989
|
reqUrl = createURL(reqUrl, url).toString();
|
|
@@ -4991,7 +4991,10 @@ function createMicroXMLHttpRequest(url, target) {
|
|
|
4991
4991
|
removeDomScope();
|
|
4992
4992
|
super.open(method, reqUrl, ...rests);
|
|
4993
4993
|
}
|
|
4994
|
-
}
|
|
4994
|
+
}
|
|
4995
|
+
// The methods defined by class are hung on the prototype, and enumerable is false by default
|
|
4996
|
+
MicroXMLHttpRequest.prototype && Object.defineProperty(MicroXMLHttpRequest.prototype, 'open', { enumerable: true });
|
|
4997
|
+
return MicroXMLHttpRequest;
|
|
4995
4998
|
}
|
|
4996
4999
|
function useMicroEventSource() {
|
|
4997
5000
|
let eventSourceMap;
|
|
@@ -5722,6 +5725,7 @@ function patchWindowProperty$1(appName, microAppWindow, sandbox) {
|
|
|
5722
5725
|
});
|
|
5723
5726
|
Object.getOwnPropertyNames(microAppWindow)
|
|
5724
5727
|
.filter((key) => {
|
|
5728
|
+
var _a;
|
|
5725
5729
|
escape2RawWindowRegExpKeys.some((reg) => {
|
|
5726
5730
|
if (reg.test(key) && key in microAppWindow.parent) {
|
|
5727
5731
|
if (isFunction(rawWindow[key])) {
|
|
@@ -5755,7 +5759,10 @@ function patchWindowProperty$1(appName, microAppWindow, sandbox) {
|
|
|
5755
5759
|
* 4. native url instanceof iframe window.URL
|
|
5756
5760
|
* ...
|
|
5757
5761
|
*/
|
|
5758
|
-
if (isConstructor(microAppWindow[key]) &&
|
|
5762
|
+
if (isConstructor(microAppWindow[key]) &&
|
|
5763
|
+
key in rawWindow &&
|
|
5764
|
+
!UN_PROXY_INSTANCEOF_KEYS.includes(key) &&
|
|
5765
|
+
!((_a = microApp.options.excludeRewriteIframeConstructor) === null || _a === void 0 ? void 0 : _a.includes(key))) {
|
|
5759
5766
|
rawDefineProperty(microAppWindow[key], Symbol.hasInstance, {
|
|
5760
5767
|
configurable: true,
|
|
5761
5768
|
enumerable: false,
|