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

Function _checkContentSecurityPolicy

apps/json-format/content-script.js:1003–1010  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1001 // 检测当前页面的CSP,防止出现这种情况:
1002 // DOMException: Failed to read the 'localStorage' property from 'Window': The document is sandboxed and lacks the 'allow-same-origin' flag.
1003 let _checkContentSecurityPolicy = () => {
1004 try {
1005 localStorage.getItem(1);
1006 } catch (e) {
1007 return false;
1008 }
1009 return true;
1010 };
1011
1012 let _getSortLabel = sortType => {
1013 const labels = {

Callers 1

_initToolbarFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected