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

Function getAutoSwitch

DarkMode.user.js:147–157  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

145 }
146 // 获取当前模式
147 function getAutoSwitch() {
148 let darkModeType = GM_getValue('menu_darkModeType'), hours = new Date().getHours(), time = GM_getValue('menu_customTime').split('|').map(Number);
149 if (GM_getValue('menu_autoSwitch') != '') { // 晚上自动切换模式
150 if (isDaytime()) { // 白天
151 darkModeType = GM_getValue('menu_autoSwitch').split('|')[0];
152 } else { // 晚上
153 darkModeType = GM_getValue('menu_autoSwitch').split('|')[1];
154 }
155 }
156 return parseInt(darkModeType)
157 }
158
159
160 // 自定义当前模式

Callers 3

registerMenuCommandFunction · 0.85
menu_customModeFunction · 0.85
addStyleFunction · 0.85

Calls 1

isDaytimeFunction · 0.85

Tested by

no test coverage detected