Skip to content

Commit

Permalink
Enhance README.md with visual examples and fix typographical errors
Browse files Browse the repository at this point in the history
- Added images demonstrating JS Hook functionality and architecture for better visual understanding.
- Corrected various typographical errors in section headers and JavaScript comments to improve clarity.
- Updated feature descriptions to ensure accurate representation of functionalities.

These changes improve the documentation's readability and provide users with clearer insights into the project's capabilities.
  • Loading branch information
yuaotian committed Dec 18, 2024
1 parent a3bbb5d commit 08c614b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@
- 字符串格式配置
- 动态注册/注销


<p align="center">
<img src="assets/js-hook.gif" alt="JS Hook Demo" width="600">

<br>
<img src="assets/js-hook.png" alt="JS Hook Architecture" width="600">
<em>JS Hook 运行演示</em>
</p>

## 📦 安装

### 前置要求
Expand Down Expand Up @@ -567,7 +576,7 @@ func registerHotkeys(w webview2.WebView, state *WindowState) {
}
```

#### JavaScript事件处理
#### JavaScript���件处理
```javascript
// 添加到HTML中的JavaScript代码
document.addEventListener('DOMContentLoaded', function() {
Expand Down Expand Up @@ -611,7 +620,7 @@ document.addEventListener('DOMContentLoaded', function() {
3. 边缘调整大小
4. 最大化/最小化/关闭控制
5. 快捷键支持
6. 窗口状态管理
6. 窗口��态管理
7. 平滑动画过渡
8. 响应式布局

Expand Down Expand Up @@ -937,7 +946,7 @@ w.Init(`
meta.content = "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';";
document.head.appendChild(meta);
// 防止XSS
// ���止XSS
function sanitizeHTML(str) {
const div = document.createElement('div');
div.textContent = str;
Expand Down Expand Up @@ -987,7 +996,7 @@ func (app *Application) sendSecureMessage(payload interface{}) {
| `ClearCache()` | 清除缓存 |
| `ClearCookies()` | 清除Cookies |

### 开发工具
### 开���工具
| API | 描述 |
|-----|------|
| `OpenDevTools()` | 打开开发者工具 |
Expand Down Expand Up @@ -1037,7 +1046,7 @@ w.Init(`
`)
```

### Q: 如何优化WebSocket连接?
### Q: 如何优化WebSocket���接?
```go
// 启用带动重连的WebSocket
w.Init(`
Expand Down
Binary file added assets/js-hook-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/js-hook-2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 08c614b

Please sign in to comment.