├── .github └── workflows │ └── deploy.yml ├── .gitignore ├── CHANGELOG.md ├── IMPLEMENTATION_PLAN.md ├── LICENSE ├── README.assets ├── JSREI Script Hook.png ├── ezgif-5-191ba6b41b.gif ├── image-20250109023632545.png ├── image-20250109024541404.png ├── image-20250109024829101.png ├── image-20250109024918866.png ├── image-20250109025028086.png ├── image-20250109201543898.png ├── image-20250109201852722.png ├── image-20250109202728996.png ├── image-20250109202738169.png ├── image-20250109203238494.png ├── image-20250109203252884.png ├── image-20250109203309612.png ├── image-20250109203331447.png ├── image-20250109203343343.png ├── image-20250109203357970.png ├── image-20250109203410731.png ├── image-20250109203421428.png ├── image-20250109203433061.png ├── image-20250109203445667.png ├── image-20250109203456868.png ├── image-20250109204028617.png ├── image-20250109204131222.png ├── image-20250109204143836.png ├── image-20250109213357997.png ├── image-20250109213542250.png ├── image-20250109215803301.png ├── jsonp-life-circle.drawio.png └── logo.png ├── README.md ├── docs ├── .$jsonp-life-circle.drawio.bkp ├── READMD.md ├── Script Hook.xmind ├── jQuery-jsonp │ └── README.md ├── jsonp-life-circle.drawio └── pr │ └── 征文活动 │ ├── README.assets │ ├── image-20250112032952576.png │ ├── image-20250112033020370.png │ └── image-20250112033031897.png │ └── README.md ├── fuck-hot-update.sh ├── migrate-jquery.sh ├── package-lock.json ├── package.json ├── script-hook-website ├── README.md ├── package-lock.json ├── package.json ├── public │ ├── 404.html │ ├── images │ │ ├── ezgif-5-191ba6b41b.gif │ │ └── logo.png │ └── index.html ├── src │ ├── App.css │ ├── App.tsx │ ├── components │ │ ├── CommunityGroup.css │ │ ├── CommunityGroup.tsx │ │ ├── DetailedFeatures.css │ │ ├── DetailedFeatures.tsx │ │ ├── FeatureTree.css │ │ ├── FeatureTree.tsx │ │ ├── Features.css │ │ ├── Features.tsx │ │ ├── Footer.css │ │ ├── Footer.tsx │ │ ├── GitHubStarButton.css │ │ ├── GitHubStarButton.tsx │ │ ├── Header.css │ │ ├── Header.tsx │ │ ├── Hero.css │ │ ├── Hero.tsx │ │ ├── Installation.css │ │ ├── Installation.tsx │ │ ├── LanguageSwitcher.css │ │ ├── LanguageSwitcher.tsx │ │ ├── LocalizedDate.tsx │ │ ├── LocalizedLink.tsx │ │ ├── LocalizedNumber.tsx │ │ ├── LocalizedRichText.tsx │ │ ├── Monitor.css │ │ ├── Monitor.tsx │ │ ├── StarHistory.css │ │ ├── StarHistory.tsx │ │ ├── Support.css │ │ ├── Support.tsx │ │ ├── WorkflowDiagram.css │ │ └── WorkflowDiagram.tsx │ ├── context │ │ └── I18nContext.tsx │ ├── i18n │ │ ├── index.ts │ │ └── locales │ │ │ ├── en.json │ │ │ └── zh.json │ ├── index.css │ ├── index.tsx │ └── utils │ │ ├── dateUtils.ts │ │ └── urlUtils.ts ├── tsconfig.json └── webpack.config.js ├── src ├── analyzer │ ├── param-encryption-analyzer.ts │ ├── request-analyzer.ts │ └── response-analyzer.ts ├── config │ ├── config.ts │ └── ui │ │ ├── component │ │ ├── about │ │ │ ├── about-component.ts │ │ │ ├── index.ts │ │ │ └── styles.ts │ │ ├── basic │ │ │ ├── alert-dialog │ │ │ │ ├── alert-dialog-component.ts │ │ │ │ ├── index.ts │ │ │ │ └── styles.ts │ │ │ ├── button │ │ │ │ ├── button-component.ts │ │ │ │ ├── index.ts │ │ │ │ ├── styles.ts │ │ │ │ └── types.ts │ │ │ ├── checkbox │ │ │ │ ├── checkbox-component.ts │ │ │ │ ├── index.ts │ │ │ │ ├── styles.ts │ │ │ │ └── types.ts │ │ │ ├── confirm-dialog │ │ │ │ ├── confirm-dialog-component.ts │ │ │ │ ├── index.ts │ │ │ │ └── styles.ts │ │ │ ├── index.ts │ │ │ ├── input-dialog │ │ │ │ ├── index.ts │ │ │ │ ├── input-dialog-component.ts │ │ │ │ └── styles.ts │ │ │ ├── input │ │ │ │ ├── index.ts │ │ │ │ ├── input-component.ts │ │ │ │ └── styles.ts │ │ │ ├── select │ │ │ │ ├── index.ts │ │ │ │ ├── select-component.ts │ │ │ │ ├── styles.ts │ │ │ │ └── types.ts │ │ │ ├── tab │ │ │ │ ├── index.ts │ │ │ │ ├── styles.ts │ │ │ │ ├── tab-component.ts │ │ │ │ └── types.ts │ │ │ ├── textarea │ │ │ │ ├── index.ts │ │ │ │ ├── styles.ts │ │ │ │ └── textarea-component.ts │ │ │ └── tips │ │ │ │ ├── index.ts │ │ │ │ ├── styles.ts │ │ │ │ └── tips-component.ts │ │ ├── configuration │ │ │ ├── configuration-component.ts │ │ │ ├── icons.ts │ │ │ ├── index.ts │ │ │ ├── styles.ts │ │ │ └── template.ts │ │ ├── debugger-manager │ │ │ ├── debugger-manager-component.ts │ │ │ ├── events.ts │ │ │ ├── index.ts │ │ │ ├── styles.ts │ │ │ ├── template.ts │ │ │ └── utils.ts │ │ ├── debugger │ │ │ ├── debugger-component.ts │ │ │ ├── events.ts │ │ │ ├── index.ts │ │ │ ├── language-update.ts │ │ │ ├── styles.ts │ │ │ ├── template.ts │ │ │ └── types.ts │ │ ├── global-options │ │ │ ├── events.ts │ │ │ ├── global-options-component.ts │ │ │ ├── index.ts │ │ │ ├── styles.ts │ │ │ ├── template.ts │ │ │ ├── types.ts │ │ │ └── utils.ts │ │ ├── language-event │ │ │ ├── index.ts │ │ │ ├── language-event-manager.ts │ │ │ └── language-updateable.ts │ │ └── language │ │ │ ├── en.ts │ │ │ ├── index.ts │ │ │ ├── types.ts │ │ │ └── zh.ts │ │ └── menu.ts ├── context │ ├── request │ │ ├── param.ts │ │ └── request-context.ts │ ├── response │ │ └── response-context.ts │ └── script │ │ └── script-context.ts ├── debugger │ ├── debugger-tester.ts │ └── debugger.ts ├── formatter │ ├── json-formatter.ts │ ├── request-formatter.ts │ ├── response-formatter.ts │ └── table-formatter.ts ├── hook │ ├── document-hook.ts │ ├── jsonp-callback-hook.ts │ ├── object-function-hook.ts │ ├── script-hook.ts │ └── watch-hook.ts ├── index.ts ├── init │ └── init.ts ├── logger │ └── index.ts ├── storage │ └── index.ts └── utils │ ├── code-util.ts │ ├── color-util.ts │ ├── dom-utils.ts │ ├── id-util.ts │ ├── log-util.ts │ ├── scope-util.ts │ ├── string-util.ts │ └── url-util.ts ├── test ├── jQuery │ ├── README.md │ ├── jquery.html │ └── server.js ├── native │ ├── client.html │ ├── context │ │ └── request │ │ │ ├── Param.test.js │ │ │ └── RequestContext.test.js │ └── server.js └── webmodules-jsonp │ ├── README.md │ └── webmodules-jsonp.html ├── tsconfig.json ├── userscript-headers-dev.js ├── userscript-headers.js ├── webpack.common.js ├── webpack.dev.js ├── webpack.prod.js └── yarn.lock /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy to GitHub Pages 2 | 3 | on: 4 | push: 5 | branches: 6 | - main # 当推送到main分支时触发 7 | # 允许手动触发工作流 8 | workflow_dispatch: 9 | 10 | # 权限设置 11 | permissions: 12 | contents: write 13 | 14 | jobs: 15 | build-and-deploy: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - name: Checkout 🛎️ 19 | uses: actions/checkout@v3 20 | 21 | - name: Setup Node.js 🔧 22 | uses: actions/setup-node@v3 23 | with: 24 | node-version: '18' 25 | cache: 'npm' 26 | cache-dependency-path: './script-hook-website/package-lock.json' 27 | 28 | - name: Install Dependencies 📦 29 | run: | 30 | cd script-hook-website 31 | npm ci 32 | 33 | - name: Build 🏗️ 34 | run: | 35 | cd script-hook-website 36 | npm run build 37 | 38 | - name: Deploy 🚀 39 | uses: JamesIves/github-pages-deploy-action@v4 40 | with: 41 | folder: script-hook-website/dist # 要部署的文件夹 42 | branch: gh-pages # 部署到的分支 43 | clean: true # 在部署前清理目标分支 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | .pnpm-debug.log* 9 | 10 | # Diagnostic reports (https://nodejs.org/api/report.html) 11 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 12 | 13 | # Runtime data 14 | pids 15 | *.pid 16 | *.seed 17 | *.pid.lock 18 | 19 | # Directory for instrumented libs generated by jscoverage/JSCover 20 | lib-cov 21 | 22 | # Coverage directory used by tools like istanbul 23 | coverage 24 | *.lcov 25 | 26 | # nyc test coverage 27 | .nyc_output 28 | 29 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 30 | .grunt 31 | 32 | # Bower dependency directory (https://bower.io/) 33 | bower_components 34 | 35 | # node-waf configuration 36 | .lock-wscript 37 | 38 | # Compiled binary addons (https://nodejs.org/api/addons.html) 39 | build/Release 40 | 41 | # Dependency directories 42 | node_modules/ 43 | jspm_packages/ 44 | 45 | # Snowpack dependency directory (https://snowpack.dev/) 46 | web_modules/ 47 | 48 | # TypeScript cache 49 | *.tsbuildinfo 50 | 51 | # Optional npm cache directory 52 | .npm 53 | 54 | # Optional eslint cache 55 | .eslintcache 56 | 57 | # Optional stylelint cache 58 | .stylelintcache 59 | 60 | # Microbundle cache 61 | .rpt2_cache/ 62 | .rts2_cache_cjs/ 63 | .rts2_cache_es/ 64 | .rts2_cache_umd/ 65 | 66 | # Optional REPL history 67 | .node_repl_history 68 | 69 | # Output of 'npm pack' 70 | *.tgz 71 | 72 | # Yarn Integrity file 73 | .yarn-integrity 74 | 75 | # dotenv environment variable files 76 | .env 77 | .env.development.local 78 | .env.test.local 79 | .env.production.local 80 | .env.local 81 | 82 | # parcel-bundler cache (https://parceljs.org/) 83 | .cache 84 | .parcel-cache 85 | 86 | # Next.js build output 87 | .next 88 | out 89 | 90 | # Nuxt.js build / generate output 91 | .nuxt 92 | dist 93 | 94 | # Gatsby files 95 | .cache/ 96 | # Comment in the public line in if your project uses Gatsby and not Next.js 97 | # https://nextjs.org/blog/next-9-1#public-directory-support 98 | # public 99 | 100 | # vuepress build output 101 | .vuepress/dist 102 | 103 | # vuepress v2.x temp and cache directory 104 | .temp 105 | .cache 106 | 107 | # Docusaurus cache and generated files 108 | .docusaurus 109 | 110 | # Serverless directories 111 | .serverless/ 112 | 113 | # FuseBox cache 114 | .fusebox/ 115 | 116 | # DynamoDB Local files 117 | .dynamodb/ 118 | 119 | # TernJS port file 120 | .tern-port 121 | 122 | # VS Code settings 123 | .vscode/ 124 | 125 | # Stores VSCode versions used for testing VSCode extensions 126 | .vscode-test 127 | 128 | # yarn v2 129 | .yarn/cache 130 | .yarn/unplugged 131 | .yarn/build-state.yml 132 | .yarn/install-state.gz 133 | .pnp.* 134 | 135 | .idea 136 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | # v0.1(2021年-01-02) 4 | - 在逆向时有初步的心得,并将其整理为一个简单的脚本。 5 | 6 | # v0.2(不记得了) 7 | - 具体啥功能不记得了,应该是进行了一些优化 8 | 9 | # v0.3(2025-01-09) 10 | - 完全重做,增加了界面、控制台的支持,对Hook功能也进行了增强。 11 | 12 | # v0.4 13 | - 重构为使用TypeScript 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /IMPLEMENTATION_PLAN.md: -------------------------------------------------------------------------------- 1 | # 语言切换实时更新实现计划 2 | 3 | ## 1. 当前状态分析 4 | 5 | ### 1.1 现有语言切换流程 6 | 1. 语言配置存储在 `Config` 类中的 `language` 字段 7 | 2. 语言切换通过 `GlobalOptionsComponent` 中的下拉框实现 8 | 3. 切换后调用 `oldConfig.persist()` 保存配置 9 | 4. 当前实现会重新加载整个配置界面 (`configComponent.show()`) 10 | 11 | ### 1.2 配置管理相关组件 12 | - `Config` 类:管理全局配置 13 | - `ConfigurationComponent`:主配置界面 14 | - `GlobalOptionsComponent`:全局选项组件 15 | - `DebuggerManagerComponent`:调试器管理组件 16 | - `AboutComponent`:关于页面组件 17 | 18 | ### 1.3 语言资源管理 19 | - 语言定义在 `language.ts` 中 20 | - 包含 `chinese` 和 `english` 两个语言对象 21 | - 通过 `getLanguage()` 和 `getLanguageByGlobalConfig()` 获取语言配置 22 | 23 | ## 2. 问题分析 24 | 25 | ### 2.1 当前实现的问题 26 | 1. 语言切换后需要重新加载整个配置界面 27 | 2. 用户体验不够流畅,会有明显的闪烁 28 | 3. 可能丢失用户在其他选项上的未保存更改 29 | 30 | ### 2.2 技术限制 31 | 1. 需要保持现有的配置持久化机制 32 | 2. 需要确保所有组件的语言一致性 33 | 3. 需要处理动态创建的组件 34 | 35 | ## 3. 解决方案 36 | 37 | ### 3.1 核心思路 38 | 1. 实现一个语言更新事件机制 39 | 2. 所有需要显示文本的组件订阅语言更新事件 40 | 3. 语言切换时触发更新事件,各组件响应式更新文本 41 | 42 | ### 3.2 具体实现步骤 43 | 44 | #### 3.2.1 创建语言更新事件管理器 45 | ```typescript 46 | // 创建 LanguageEventManager 类 47 | - 实现观察者模式 48 | - 提供订阅和取消订阅方法 49 | - 提供触发更新的方法 50 | ``` 51 | 52 | #### 3.2.2 修改基础组件 53 | 1. 为所有基础组件添加语言更新支持: 54 | - `TabComponent` 55 | - `TipsComponent` 56 | - `SelectComponent` 57 | - `CheckboxComponent` 58 | - `InputComponent` 59 | - `TextareaComponent` 60 | 61 | 2. 实现组件的更新方法: 62 | ```typescript 63 | interface LanguageUpdateable { 64 | updateLanguage(language: Language): void; 65 | } 66 | ``` 67 | 68 | #### 3.2.3 修改主要组件 69 | 1. `ConfigurationComponent`: 70 | - 订阅语言更新事件 71 | - 实现 `updateLanguage` 方法 72 | - 更新标题、按钮等文本 73 | 74 | 2. `GlobalOptionsComponent`: 75 | - 订阅语言更新事件 76 | - 实现 `updateLanguage` 方法 77 | - 更新所有选项的标签和提示文本 78 | 79 | 3. `DebuggerManagerComponent`: 80 | - 订阅语言更新事件 81 | - 实现 `updateLanguage` 方法 82 | - 更新调试器列表的文本 83 | 84 | 4. `AboutComponent`: 85 | - 订阅语言更新事件 86 | - 实现 `updateLanguage` 方法 87 | - 更新关于页面的所有文本 88 | 89 | #### 3.2.4 修改语言切换逻辑 90 | 1. 在 `GlobalOptionsComponent` 中: 91 | ```typescript 92 | // 语言选择回调中 93 | - 保存新的语言设置 94 | - 获取新的语言配置 95 | - 触发语言更新事件 96 | ``` 97 | 98 | ### 3.3 优化方案 99 | 1. 缓存语言资源,避免重复加载 100 | 2. 使用防抖处理频繁的语言切换 101 | 3. 添加语言切换动画效果 102 | 103 | ## 4. 测试计划 104 | 105 | ### 4.1 单元测试 106 | 1. 测试语言更新事件机制 107 | 2. 测试各组件的语言更新方法 108 | 3. 测试配置保存和加载 109 | 110 | ### 4.2 集成测试 111 | 1. 测试完整的语言切换流程 112 | 2. 测试多组件协同工作 113 | 3. 测试边界情况处理 114 | 115 | ### 4.3 性能测试 116 | 1. 测试语言切换的响应时间 117 | 2. 测试内存占用情况 118 | 3. 测试大量组件同时更新的性能 119 | 120 | ## 5. 实施步骤 121 | 122 | ### 5.1 第一阶段:基础架构 123 | 1. 实现 LanguageEventManager 124 | 2. 修改基础组件 125 | 3. 添加语言更新接口 126 | 127 | ### 5.2 第二阶段:组件适配 128 | 1. 改造 ConfigurationComponent 129 | 2. 改造 GlobalOptionsComponent 130 | 3. 改造 DebuggerManagerComponent 131 | 4. 改造 AboutComponent 132 | 133 | ### 5.3 第三阶段:优化和测试 134 | 1. 实现性能优化 135 | 2. 执行测试计划 136 | 3. 修复问题和优化 137 | 138 | ## 6. 注意事项 139 | 140 | ### 6.1 兼容性考虑 141 | 1. 确保旧版本配置的兼容性 142 | 2. 处理语言资源加载失败的情况 143 | 3. 考虑浏览器兼容性 144 | 145 | ### 6.2 性能考虑 146 | 1. 最小化DOM操作 147 | 2. 优化事件触发频率 148 | 3. 合理使用缓存 149 | 150 | ### 6.3 用户体验 151 | 1. 添加适当的过渡动画 152 | 2. 提供清晰的反馈 153 | 3. 确保操作的可回退性 154 | 155 | ## 7. 后续优化 156 | 157 | ### 7.1 可能的扩展 158 | 1. 支持更多语言 159 | 2. 添加语言包动态加载 160 | 3. 支持自定义翻译 161 | 162 | ### 7.2 监控和维护 163 | 1. 添加语言切换的日志记录 164 | 2. 监控性能指标 165 | 3. 收集用户反馈 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 CC11001100 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.assets/JSREI Script Hook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/JSREI Script Hook.png -------------------------------------------------------------------------------- /README.assets/ezgif-5-191ba6b41b.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/ezgif-5-191ba6b41b.gif -------------------------------------------------------------------------------- /README.assets/image-20250109023632545.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109023632545.png -------------------------------------------------------------------------------- /README.assets/image-20250109024541404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109024541404.png -------------------------------------------------------------------------------- /README.assets/image-20250109024829101.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109024829101.png -------------------------------------------------------------------------------- /README.assets/image-20250109024918866.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109024918866.png -------------------------------------------------------------------------------- /README.assets/image-20250109025028086.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109025028086.png -------------------------------------------------------------------------------- /README.assets/image-20250109201543898.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109201543898.png -------------------------------------------------------------------------------- /README.assets/image-20250109201852722.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109201852722.png -------------------------------------------------------------------------------- /README.assets/image-20250109202728996.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109202728996.png -------------------------------------------------------------------------------- /README.assets/image-20250109202738169.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109202738169.png -------------------------------------------------------------------------------- /README.assets/image-20250109203238494.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109203238494.png -------------------------------------------------------------------------------- /README.assets/image-20250109203252884.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109203252884.png -------------------------------------------------------------------------------- /README.assets/image-20250109203309612.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109203309612.png -------------------------------------------------------------------------------- /README.assets/image-20250109203331447.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109203331447.png -------------------------------------------------------------------------------- /README.assets/image-20250109203343343.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109203343343.png -------------------------------------------------------------------------------- /README.assets/image-20250109203357970.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109203357970.png -------------------------------------------------------------------------------- /README.assets/image-20250109203410731.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109203410731.png -------------------------------------------------------------------------------- /README.assets/image-20250109203421428.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109203421428.png -------------------------------------------------------------------------------- /README.assets/image-20250109203433061.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109203433061.png -------------------------------------------------------------------------------- /README.assets/image-20250109203445667.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109203445667.png -------------------------------------------------------------------------------- /README.assets/image-20250109203456868.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109203456868.png -------------------------------------------------------------------------------- /README.assets/image-20250109204028617.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109204028617.png -------------------------------------------------------------------------------- /README.assets/image-20250109204131222.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109204131222.png -------------------------------------------------------------------------------- /README.assets/image-20250109204143836.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109204143836.png -------------------------------------------------------------------------------- /README.assets/image-20250109213357997.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109213357997.png -------------------------------------------------------------------------------- /README.assets/image-20250109213542250.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109213542250.png -------------------------------------------------------------------------------- /README.assets/image-20250109215803301.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/image-20250109215803301.png -------------------------------------------------------------------------------- /README.assets/jsonp-life-circle.drawio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/jsonp-life-circle.drawio.png -------------------------------------------------------------------------------- /README.assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/README.assets/logo.png -------------------------------------------------------------------------------- /docs/READMD.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 案例: 6 | - https://github.com/JSREP/www.xxsypro.com-RE 7 | - https://github.com/JSREP/www.readnovel.com-RE 8 | - https://github.com/JSREP/www.37.com-RE 9 | - https://github.com/JSREP/www.hongxiu.com-RE 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/Script Hook.xmind: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/docs/Script Hook.xmind -------------------------------------------------------------------------------- /docs/jQuery-jsonp/README.md: -------------------------------------------------------------------------------- 1 | # jQuery jsonp原理分析 2 | 3 | 4 | 5 | # 要讨论的问题是什么? 6 | 7 | 8 | 9 | # 使用示例 10 | 11 | 12 | 13 | ```js 14 | $.getJSON(url+"?callback=?",function(data){ 15 | .... 16 | }); 17 | ``` 18 | 19 | 20 | 21 | ```js 22 | $.ajax({ 23 | type: "get", 24 | url: "http://examples.learningjquery.com/jsonp/g.php", 25 | dataType: "jsonp", 26 | jsonp: "callback", 27 | jsonpCallback: "hehe", 28 | success: function(json){ 29 | console.log(json); 30 | } 31 | }); 32 | ``` 33 | 34 | 35 | 36 | 37 | 38 | # 代码浅读 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /docs/pr/征文活动/README.assets/image-20250112032952576.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/docs/pr/征文活动/README.assets/image-20250112032952576.png -------------------------------------------------------------------------------- /docs/pr/征文活动/README.assets/image-20250112033020370.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/docs/pr/征文活动/README.assets/image-20250112033020370.png -------------------------------------------------------------------------------- /docs/pr/征文活动/README.assets/image-20250112033031897.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/docs/pr/征文活动/README.assets/image-20250112033031897.png -------------------------------------------------------------------------------- /docs/pr/征文活动/README.md: -------------------------------------------------------------------------------- 1 | # JSREI Script Hook逆向实战征文活动 2 | 3 | ## 活动规则 4 | 5 | - 写逆向实战文章或录演示视频,使用[JSREI Script Hook](https://github.com/JSREI/js-script-hook)辅助逆向真实网站案例,难度不限,阅读或播放数超过100认为是有效参与 6 | 7 | ## 参与方式 8 | 9 | - 把参与活动的文章链接或视频链接粘贴在此issue https://github.com/JSREI/js-script-hook/issues/41 中即可 10 | - 活动时间截止到2025-02-28 11 | - 如有任何疑问,请联系活动组织者咨询,微信 CC11001100-weixin 12 | 13 | ## 中奖规则 14 | 15 | - **中奖名额**:共10个中奖名额,每人仅限中奖一次。 16 | - **中奖方式**: 17 | 1. **Top 3 直接中奖**:阅读量或播放量最高的前3个有效参与作品将直接中奖。 18 | 2. **随机抽取**:剩余7个中奖名额将从所有有效参与者中随机抽取。 19 | - **特殊情况处理**: 20 | - 如果有效参与人数不足10个,则所有有效参与者都将中奖,剩余名额从全部参与者中随机抽取。 21 | - 如果有效参与人数为0,则从全部参与者中随机抽取10个中奖者;若全部参与者不足10个,则所有参与者都将中奖。 22 | - 如果无人参与,活动组织者将把钱留着过年吃点好的(第一次搞这类活动,应该不会这么惨吧...)。 23 | 24 | ## 领奖方式 25 | 26 | - 2025-02-28当天会艾特每个中奖的人并留下活动组织者微信,请中奖者于一个月内(2025-03-31)加微信联系发货,过时不候 27 | 28 | ## 奖品 29 | 30 | 锦鲤蛇公仔,大小大约8寸26cm 31 | 32 | ![image-20250112032952576](./README.assets/image-20250112032952576.png) 33 | 34 | ![image-20250112033020370](./README.assets/image-20250112033020370.png) 35 | 36 | 37 | 38 | ![image-20250112033031897](./README.assets/image-20250112033031897.png) 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /fuck-hot-update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 热编译好像有点问题,这是一个折中的方案 4 | while true; do 5 | # 执行 yarn build 命令 6 | yarn build 7 | # 等待1秒 8 | sleep 1 9 | done -------------------------------------------------------------------------------- /migrate-jquery.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 查找所有引用jquery-adapter的文件 4 | FILES=$(find /Users/cc11001100/github/JSREI/js-script-hook/src -type f -name "*.ts" | xargs grep -l "jquery-adapter") 5 | 6 | # 替换所有文件中的jQuery引用为原生DOM API 7 | for FILE in $FILES; do 8 | echo "处理文件: $FILE" 9 | 10 | # 替换引入语句 11 | sed -i '' 's/import { jQuery as \$, JQuery } from .*.\/utils\/jquery-adapter.*/import { dom } from "..\/..\/..\/..\/utils\/dom-utils";/g' "$FILE" 12 | sed -i '' 's/import { jQuery as \$ } from .*.\/utils\/jquery-adapter.*/import { dom } from "..\/..\/..\/..\/utils\/dom-utils";/g' "$FILE" 13 | 14 | # 替换JQuery类型为HTMLElement 15 | sed -i '' 's/JQuery/HTMLElement/g' "$FILE" 16 | sed -i '' 's/: JQuery", 18 | "license": "MIT", 19 | "devDependencies": { 20 | "@types/jquery": "^3.5.32", 21 | "@types/tampermonkey": "^5.0.4", 22 | "current-script-polyfill": "^1.0.0", 23 | "ts-loader": "^9.5.1", 24 | "typescript": "^5.8.3", 25 | "webpack": "5.94.0", 26 | "webpack-cli": "^5.1.4", 27 | "webpack-merge": "^5.9.0" 28 | }, 29 | "dependencies": { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /script-hook-website/README.md: -------------------------------------------------------------------------------- 1 | # JS Script Hook Website 2 | 3 |
4 | English | 中文 5 |
6 | 7 | ## About 8 | 9 | This is the official website for the JS Script Hook project, featuring a React-based SPA that showcases the library's features, provides installation instructions, and offers community support resources. 10 | 11 | The website is built with React, TypeScript, and supports full internationalization with both English and Chinese languages. 12 | 13 | ## Features 14 | 15 | - Responsive design that works on all devices 16 | - Comprehensive internationalization (i18n) support for English and Chinese 17 | - Optimized SEO metadata with language-specific content 18 | - Interactive UI components to demonstrate the library's capabilities 19 | - Social sharing functionality 20 | 21 | ## Development 22 | 23 | ### Prerequisites 24 | 25 | - Node.js (v14.0.0 or higher) 26 | - npm or yarn 27 | 28 | ### Installation 29 | 30 | ```bash 31 | # Clone the repository 32 | git clone https://github.com/JSREI/js-script-hook.git 33 | cd js-script-hook/script-hook-website 34 | 35 | # Install dependencies 36 | npm install 37 | # or 38 | yarn install 39 | ``` 40 | 41 | ### Development Server 42 | 43 | ```bash 44 | # Start the development server 45 | npm start 46 | # or 47 | yarn start 48 | ``` 49 | 50 | The website will be available at `http://localhost:8080`. 51 | 52 | ### Building for Production 53 | 54 | ```bash 55 | # Build for production 56 | npm run build 57 | # or 58 | yarn build 59 | ``` 60 | 61 | The compiled website will be available in the `dist` directory. 62 | 63 | ## Internationalization 64 | 65 | The website supports both English and Chinese languages. The language is automatically detected based on the user's browser settings, but can also be manually selected through the language switcher in the header. 66 | 67 | Translation files are located in: 68 | - `src/i18n/locales/en.json` (English) 69 | - `src/i18n/locales/zh.json` (Chinese) 70 | 71 | ## Deployment 72 | 73 | The website is deployed to GitHub Pages automatically via GitHub Actions when changes are pushed to the main branch. 74 | 75 | --- 76 | 77 |
78 |

JS Script Hook 网站

79 |
80 | 81 |
82 | English | 中文 83 |
84 | 85 | ## 简介 86 | 87 | 这是JS Script Hook项目的官方网站,基于React的单页应用程序,展示了该库的功能特性,提供安装指南,并提供社区支持资源。 88 | 89 | 该网站使用React和TypeScript构建,支持英文和中文的完整国际化。 90 | 91 | ## 特性 92 | 93 | - 响应式设计,适用于所有设备 94 | - 全面支持英文和中文的国际化(i18n) 95 | - 针对不同语言优化的SEO元数据 96 | - 交互式UI组件,展示库的功能 97 | - 社交媒体分享功能 98 | 99 | ## 开发 100 | 101 | ### 环境要求 102 | 103 | - Node.js (v14.0.0或更高版本) 104 | - npm或yarn 105 | 106 | ### 安装 107 | 108 | ```bash 109 | # 克隆仓库 110 | git clone https://github.com/JSREI/js-script-hook.git 111 | cd js-script-hook/script-hook-website 112 | 113 | # 安装依赖 114 | npm install 115 | # 或 116 | yarn install 117 | ``` 118 | 119 | ### 开发服务器 120 | 121 | ```bash 122 | # 启动开发服务器 123 | npm start 124 | # 或 125 | yarn start 126 | ``` 127 | 128 | 网站将在`http://localhost:8080`可访问。 129 | 130 | ### 生产环境构建 131 | 132 | ```bash 133 | # 构建生产版本 134 | npm run build 135 | # 或 136 | yarn build 137 | ``` 138 | 139 | 编译后的网站将在`dist`目录中可用。 140 | 141 | ## 国际化 142 | 143 | 该网站支持英文和中文两种语言。语言会根据用户的浏览器设置自动检测,也可以通过页头的语言切换器手动选择。 144 | 145 | 翻译文件位于: 146 | - `src/i18n/locales/en.json`(英文) 147 | - `src/i18n/locales/zh.json`(中文) 148 | 149 | ## 部署 150 | 151 | 当更改推送到主分支时,网站会通过GitHub Actions自动部署到GitHub Pages。 -------------------------------------------------------------------------------- /script-hook-website/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "script-hook-website", 3 | "version": "1.0.0", 4 | "description": "JS Script Hook官方网站 | JS Script Hook Official Website", 5 | "homepage": "https://jsrei.github.io/js-script-hook", 6 | "main": "index.js", 7 | "scripts": { 8 | "start": "webpack serve --mode development --port auto --open", 9 | "build": "webpack --mode production", 10 | "predeploy": "npm run build", 11 | "deploy": "gh-pages -d dist", 12 | "test": "echo \"Error: no test specified\" && exit 1" 13 | }, 14 | "keywords": [ 15 | "js-script-hook", 16 | "javascript", 17 | "hook", 18 | "intercept" 19 | ], 20 | "author": "JSREI", 21 | "license": "MIT", 22 | "dependencies": { 23 | "@types/dompurify": "^3.0.5", 24 | "@types/react": "^18.2.0", 25 | "@types/react-dom": "^18.2.0", 26 | "@types/react-router-dom": "^5.3.3", 27 | "d3": "^7.9.0", 28 | "dompurify": "^3.2.5", 29 | "i18next": "^25.1.3", 30 | "i18next-browser-languagedetector": "^8.1.0", 31 | "react": "^18.2.0", 32 | "react-dom": "^18.2.0", 33 | "react-i18next": "^15.5.1", 34 | "react-medium-image-zoom": "^5.2.14", 35 | "react-router-dom": "^7.6.0", 36 | "react-syntax-highlighter": "^15.6.1", 37 | "reactflow": "^11.11.4", 38 | "typescript": "^5.0.0" 39 | }, 40 | "devDependencies": { 41 | "@types/react-syntax-highlighter": "^15.5.13", 42 | "copy-webpack-plugin": "^13.0.0", 43 | "css-loader": "^6.7.3", 44 | "gh-pages": "^6.3.0", 45 | "html-webpack-plugin": "^5.5.1", 46 | "style-loader": "^3.3.2", 47 | "ts-loader": "^9.4.2", 48 | "webpack": "^5.80.0", 49 | "webpack-cli": "^5.0.2", 50 | "webpack-dev-server": "^4.13.3" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /script-hook-website/public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JS Script Hook 6 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /script-hook-website/public/images/ezgif-5-191ba6b41b.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/script-hook-website/public/images/ezgif-5-191ba6b41b.gif -------------------------------------------------------------------------------- /script-hook-website/public/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JSREI/js-script-hook/317fa457bac9e47eaf5fe79c4af6e1961cbb33e1/script-hook-website/public/images/logo.png -------------------------------------------------------------------------------- /script-hook-website/src/App.css: -------------------------------------------------------------------------------- 1 | .app { 2 | min-height: 100vh; 3 | display: flex; 4 | flex-direction: column; 5 | contain: layout style; 6 | will-change: contents; 7 | } 8 | 9 | /* 防止滚动闪烁 */ 10 | html { 11 | scroll-behavior: smooth; 12 | height: 100%; 13 | overflow-anchor: none; 14 | } 15 | 16 | body { 17 | min-height: 100%; 18 | overflow-x: hidden; 19 | } 20 | 21 | /* 确保图片和其他元素在加载前预留空间 */ 22 | img, iframe, video { 23 | height: auto; 24 | max-width: 100%; 25 | } 26 | 27 | /* 确保主要区域有最小高度,防止布局跳跃 */ 28 | .container { 29 | min-height: 50vh; 30 | /* 减少布局计算 */ 31 | contain: layout style; 32 | } 33 | 34 | /* 优化滚动体验 */ 35 | @media (prefers-reduced-motion: no-preference) { 36 | html { 37 | scroll-behavior: smooth; 38 | } 39 | } -------------------------------------------------------------------------------- /script-hook-website/src/App.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect } from 'react'; 2 | import { HashRouter as Router, Routes, Route, Navigate, useLocation } from 'react-router-dom'; 3 | import { useTranslation } from 'react-i18next'; 4 | import Header from './components/Header'; 5 | import Hero from './components/Hero'; 6 | import Features from './components/Features'; 7 | import WorkflowDiagram from './components/WorkflowDiagram'; 8 | import FeatureTree from './components/FeatureTree'; 9 | import DetailedFeatures from './components/DetailedFeatures'; 10 | import Installation from './components/Installation'; 11 | import Support from './components/Support'; 12 | import CommunityGroup from './components/CommunityGroup'; 13 | import Footer from './components/Footer'; 14 | import GitHubStarButton from './components/GitHubStarButton'; 15 | import { I18nProvider } from './context/I18nContext'; 16 | import './App.css'; 17 | 18 | // 滚动恢复组件,防止路由切换时的滚动问题 19 | const ScrollToTop: React.FC = () => { 20 | const { pathname, hash } = useLocation(); 21 | 22 | useEffect(() => { 23 | // 只有当没有hash值或hash值为空时,才滚动到顶部 24 | if (!hash) { 25 | window.scrollTo(0, 0); 26 | } 27 | }, [pathname, hash]); 28 | 29 | return null; 30 | }; 31 | 32 | // 封装主页面内容为一个组件 33 | const HomePage: React.FC = () => { 34 | const { t, i18n } = useTranslation(); 35 | 36 | // 更新文档标题和meta描述 - 重构后,将由I18nContext处理 37 | useEffect(() => { 38 | document.title = t('html.title'); 39 | 40 | // 更新meta描述 41 | const metaDescription = document.querySelector('meta[name="description"]'); 42 | if (metaDescription) { 43 | metaDescription.setAttribute('content', t('html.description')); 44 | } 45 | 46 | // 更新noscript消息 47 | const noscriptElement = document.getElementById('noscript-message'); 48 | if (noscriptElement) { 49 | noscriptElement.textContent = t('html.noscript'); 50 | } 51 | 52 | // 更新社交媒体元数据 53 | const updateMetaTag = (id: string, attr: string, value: string) => { 54 | const tag = document.getElementById(id); 55 | if (tag) tag.setAttribute(attr, value); 56 | }; 57 | 58 | updateMetaTag('og-title', 'content', t('html.title')); 59 | updateMetaTag('og-description', 'content', t('html.description')); 60 | updateMetaTag('twitter-title', 'content', t('html.title')); 61 | updateMetaTag('twitter-description', 'content', t('html.description')); 62 | 63 | // 更新语言标签 64 | document.documentElement.setAttribute('lang', i18n.language); 65 | }, [t, i18n.language]); 66 | 67 | return ( 68 | <> 69 | 70 |
71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 |