您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Enhance BambooHR website
// ==UserScript== // @name BambooHR // @description Enhance BambooHR website // @version 1.0 // @author Guten // @homepageURL https://github.com/gutenye/userscripts/tree/main/BambooHR // @namespace gutenye // @grant GM.xmlHttpRequest // @match https://*.bamboohr.com/home // @match https://*.bamboohr.com/home/ // ==/UserScript== function main() { const employeeId = SESSION_USER.employeeId const year = new Date().getFullYear() const endDate = `${year}-12-31` GM.xmlHttpRequest({ url: `/time_off/calculator/calculate?employeeId=${employeeId}&endDate=${endDate}&timeOffType=96`, onload, responseType: 'json', }) } function onload(res) { const found = res.response.total.match(/^\d+.\d+/) if (!found) { return } const days = found[0] updateDays(days) } function updateDays(totalDays) { const currentDays = document.querySelector('.TimeOffWidget__type-available').lastChild currentDays.nodeValue = `${currentDays.nodeValue} / ${totalDays}` } main()