MCPcopy Create free account
hub / github.com/XIU2/UserScript / getCookie

Function getCookie

Autopage.user.js:2903–2912  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

2901 }
2902 // 获取 Cookie
2903 function getCookie(name) {
2904 if (!name) return ''
2905 let arr = document.cookie.split(';');
2906 name += '='
2907 for (let i=0; i<arr.length; i++) {
2908 let now = arr[i].trim();
2909 if (now.indexOf(name) == 0) return now.substring(name.length, now.length);
2910 }
2911 return '';
2912 }
2913 // 插入位置
2914 function getAddTo(num) {
2915 switch (num) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected