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

Function getTheme

Zhihu-Beautification.user.js:525–533  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

523
524 // 获取知乎 Cookie 中的主题类型
525 function getTheme() {
526 let name = 'theme=',
527 ca = document.cookie.split(';');
528 for (let i=0; i<ca.length; i++) {
529 let c = ca[i].trim();
530 if (c.indexOf(name)==0) return c.substring(name.length,c.length);
531 }
532 return 'light';
533 }
534
535 // 修改知乎 Cookie 中的主题类型
536 function setTheme(theme) {

Callers 3

menu_toggleFunction · 0.85
menu_switchFunction · 0.85
addStyleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected