1+ <!doctype html> < html > < head > < meta charset ="utf-8 "/> < meta name ="viewport " content ="width=device-width,initial-scale=1 "/> < meta name ="theme-color " content ="#000000 "/> < meta id ="meta-description " name ="description " content ="JS Script Hook - 高级JavaScript脚本钩子工具 "/> < meta property ="og:title " id ="og-title " content ="JS Script Hook - 官方网站 "/> < meta property ="og:description " id ="og-description " content ="JS Script Hook - 高级JavaScript脚本钩子工具 "/> < meta property ="og:type " content ="website "/> < meta property ="og:url " content ="https://jsrei.github.io/js-script-hook/ "/> < meta property ="og:image " content ="https://jsrei.github.io/js-script-hook/images/logo.png "/> < meta name ="twitter:card " content ="summary_large_image "/> < meta name ="twitter:title " id ="twitter-title " content ="JS Script Hook - 官方网站 "/> < meta name ="twitter:description " id ="twitter-description " content ="JS Script Hook - 高级JavaScript脚本钩子工具 "/> < meta name ="twitter:image " content ="https://jsrei.github.io/js-script-hook/images/logo.png "/> < meta name ="keywords " content ="JS Script Hook, Javascript, JSONP, 脚本钩子, 网络拦截, Web逆向, Reverse Engineering "/> < meta name ="author " content ="JSREI "/> < meta name ="application-name " content ="JS Script Hook "/> < link rel ="icon " href ="./images/favicon.ico "/> < link rel ="apple-touch-icon " href ="./images/logo192.png "/> < title id ="page-title "> JS Script Hook - 官方网站</ title > < link rel ="preconnect " href ="https://fonts.googleapis.com "> < link rel ="preconnect " href ="https://fonts.gstatic.com " crossorigin > < link href ="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap " rel ="stylesheet "> < script > ( function ( ) {
2+ try {
3+ // 尝试获取用户语言偏好
4+ var userLang = localStorage . getItem ( 'language' ) ||
5+ ( navigator . language || navigator . userLanguage ) . split ( '-' ) [ 0 ] ;
6+
7+ // 只支持zh和en,如果获取到其他语言,默认使用英文
8+ if ( userLang !== 'zh' && userLang !== 'en' ) {
9+ userLang = 'en' ;
10+ }
11+
12+ // 设置HTML的lang属性
13+ document . documentElement . setAttribute ( 'lang' , userLang ) ;
14+
15+ // 根据语言设置页面标题、描述和noscript
16+ var translations = {
17+ 'zh' : {
18+ title : 'JS Script Hook - 官方网站' ,
19+ description : 'JS Script Hook - 高级JavaScript脚本钩子工具' ,
20+ noscript : '您需要启用JavaScript才能运行此应用。' ,
21+ keywords : 'JS Script Hook, Javascript, JSONP, 脚本钩子, 网络拦截, Web逆向'
22+ } ,
23+ 'en' : {
24+ title : 'JS Script Hook - Official Website' ,
25+ description : 'JS Script Hook - Advanced JavaScript Script Hooking Tool' ,
26+ noscript : 'You need to enable JavaScript to run this app.' ,
27+ keywords : 'JS Script Hook, Javascript, JSONP, Script Hook, Web Interception, Reverse Engineering'
28+ }
29+ } ;
30+
31+ // 应用翻译
32+ var t = translations [ userLang ] ;
33+ document . getElementById ( 'page-title' ) . textContent = t . title ;
34+ document . getElementById ( 'meta-description' ) . setAttribute ( 'content' , t . description ) ;
35+
36+ // 更新社交媒体元数据
37+ document . getElementById ( 'og-title' ) . setAttribute ( 'content' , t . title ) ;
38+ document . getElementById ( 'og-description' ) . setAttribute ( 'content' , t . description ) ;
39+ document . getElementById ( 'twitter-title' ) . setAttribute ( 'content' , t . title ) ;
40+ document . getElementById ( 'twitter-description' ) . setAttribute ( 'content' , t . description ) ;
41+
42+ // 更新关键词
43+ document . querySelector ( 'meta[name="keywords"]' ) . setAttribute ( 'content' , t . keywords ) ;
44+
45+ var noscriptElem = document . getElementById ( 'noscript-message' ) ;
46+ if ( noscriptElem ) {
47+ noscriptElem . textContent = t . noscript ;
48+ }
49+
50+ // 记录初始语言以便React接管后能保持一致
51+ if ( ! localStorage . getItem ( 'language' ) ) {
52+ localStorage . setItem ( 'language' , userLang ) ;
53+ }
54+ } catch ( e ) {
55+ // 出错时不影响页面加载
56+ console . error ( 'Language initialization error:' , e ) ;
57+ }
58+ } ) ( ) ; </ script > < script > // Handle parameters if redirected from 404.html
59+ ( function ( l ) {
60+ if ( l . search [ 1 ] === '/' ) {
61+ var decoded = l . search . slice ( 1 ) . split ( '&' ) . map ( function ( s ) {
62+ return s . replace ( / ~ a n d ~ / g, '&' )
63+ } ) . join ( '?' ) ;
64+ window . history . replaceState ( null , null ,
65+ l . pathname . slice ( 0 , - 1 ) + decoded + l . hash
66+ ) ;
67+ }
68+ } ( window . location ) ) </ script > < meta http-equiv ="Cache-Control " content ="no-cache, no-store, must-revalidate "> < meta http-equiv ="Pragma " content ="no-cache "> < meta http-equiv ="Expires " content ="0 "> < script defer ="defer " src ="./runtime.a102c25a.js "> </ script > < script defer ="defer " src ="./vendors.dc8b02f8.js "> </ script > < script defer ="defer " src ="./main.de52ed4f.js "> </ script > </ head > < body > < noscript id ="noscript-message "> 您需要启用JavaScript才能运行此应用。</ noscript > < div id ="root "> </ div > </ body > </ html >
0 commit comments