@deppon/deppon-router 2.4.15 → 2.4.18
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/es/utils.js +9 -1
- package/package.json +1 -1
package/es/utils.js
CHANGED
|
@@ -32,7 +32,15 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
32
32
|
* @returns {boolean} 是否支持 viewTab
|
|
33
33
|
*/
|
|
34
34
|
function isViewTabSupported() {
|
|
35
|
-
|
|
35
|
+
if (typeof window === 'undefined' || !window.top || window.top === window.self) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
// 跨域 iframe 下读取 top 的任意命名属性会抛 SecurityError,需降级为 router.push
|
|
40
|
+
return typeof window.top.viewTab === 'function';
|
|
41
|
+
} catch (_unused) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
36
44
|
}
|
|
37
45
|
|
|
38
46
|
/**
|