向下兼容处理

pull/311/head
王良 2024-04-27 22:27:51 +08:00
parent 654f6dc503
commit 1248016afd
1 changed files with 6 additions and 1 deletions

View File

@ -124,7 +124,12 @@ module.exports = {
return
}
const urlPath = rOptions.path
const filename = urlPath.replace(contextPath, '')
let filename = urlPath.replace(contextPath, '')
// 重命名过,向下兼容
if (filename === 'global') {
filename = 'tampermonkey'
}
const script = monkey.get(setting.script.defaultDir)[filename]
// log.info(`urlPath: ${urlPath}, fileName: ${filename}, script: ${script}`)