File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 4
4
< meta charset ="UTF-8 " />
5
5
< title > 重定向地址获取</ title >
6
6
< script >
7
- const version = '1.0.2 ' ; // 版本号
7
+ const version = '1.0.3 ' ; // 版本号
8
8
const targetUrl = 'https://koa-download.kingsgroup.cn/koa.apk' ;
9
- const redirectDiv = document . querySelector ( '# redirect') ; // 使用 querySelector 确保 redirectDiv 存在
9
+ const redirectDiv = document . getElementById ( ' redirect') ; // 使用 getElementById 确保 redirectDiv 存在
10
10
11
11
// 获取重定向地址
12
12
async function getRedirectUrl ( ) {
24
24
25
25
// 更新网页显示
26
26
if ( redirectDiv ) {
27
- redirectDiv . innerHTML = `重定向地址:${ redirectUrl } ` ;
27
+ redirectDiv . textContent = `重定向地址:${ redirectUrl } ` ; // 使用 textContent 避免注入攻击
28
28
}
29
29
} catch ( error ) {
30
30
if ( redirectDiv ) {
31
- redirectDiv . innerHTML = `获取重定向地址失败:${ error } ` ;
31
+ redirectDiv . textContent = `获取重定向地址失败:${ error } ` ; // 使用 textContent 避免注入攻击
32
32
}
33
33
}
34
34
}
You can’t perform that action at this time.
0 commit comments