Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

右鍵選單將選取範圍在 kbbi 查詢 #13

Closed
Shiou-Ju opened this issue Jan 9, 2024 · 5 comments · Fixed by #14
Closed

右鍵選單將選取範圍在 kbbi 查詢 #13

Shiou-Ju opened this issue Jan 9, 2024 · 5 comments · Fixed by #14

Comments

@Shiou-Ju
Copy link
Owner

Shiou-Ju commented Jan 9, 2024

No description provided.

@Shiou-Ju
Copy link
Owner Author

Shiou-Ju commented Jan 9, 2024

puppeteer/puppeteer#1575

根據這一篇,似乎 puppeteer 只能透過模擬鍵盤的操作來選取

試著實作

@Shiou-Ju
Copy link
Owner Author

Shiou-Ju commented Jan 9, 2024

puppeteer/puppeteer#2486 (comment)

這篇回覆提到 chrome.contextMenus.onClicked

@Shiou-Ju
Copy link
Owner Author

Shiou-Ju commented Jan 9, 2024

先嘗試使用 puppeteer 實作

  1. 透過模擬鍵盤操作:或許開啟之後他的選單位置需要確定
  2. chrome.contextMenus.onClicked (待研究)

如有必要也可以用 Playwright

https://www.npmjs.com/package/playwright

並參考這篇

open-sauced/ai#291

@Shiou-Ju
Copy link
Owner Author

Shiou-Ju commented Jan 9, 2024

Context Menu in 119.0.6045.105 (正式版本) (arm64)

截圖 2024-01-09 14 06 39
  1. 查詢 xxx
  2. 複製
  3. 複製醒目提醒...
  4. 透過 google 搜尋
  5. 列印...
  6. seperate line
  7. 檢查
  8. seperate line
  9. 語音

@Shiou-Ju
Copy link
Owner Author

Shiou-Ju commented Jan 9, 2024

發現模擬鍵盤往下按的功能只能 scroll page,不能跟 context menu 聯動。

https://github.com/asweigart/pyautogui

或許考慮使用這個套件

但這是 Python 的套件或許會讓專案變複雜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant