MCPcopy Create free account
hub / github.com/zxlie/FeHelper / _checkBasicRestrictions

Function _checkBasicRestrictions

apps/json-format/format-lib.js:1553–1572  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1551 * @returns {boolean}
1552 */
1553 let _checkBasicRestrictions = function() {
1554 // 检查是否在iframe中且被沙盒化
1555 if (window !== window.top) {
1556 try {
1557 // 尝试访问父窗口,如果被沙盒化会抛出异常
1558 window.parent.document;
1559 } catch (e) {
1560 // 静默处理,不输出日志
1561 return true;
1562 }
1563 }
1564
1565 // 检查是否在受限的协议下(非chrome-extension:、http:、https:)
1566 if (location.protocol !== 'chrome-extension:' && location.protocol !== 'http:' && location.protocol !== 'https:') {
1567 // 静默处理,不输出日志
1568 return true;
1569 }
1570
1571 return false;
1572 };
1573
1574
1575 /**

Callers 1

_getWorkerInstanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected