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

讓 UserScript 和擴充版本使用同一份腳本 #17

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

bluenk
Copy link
Contributor

@bluenk bluenk commented Jun 27, 2024

TODO

  • Merge 修正Zip壓縮速度異常緩慢 #16 first.
  • 也許可以刪除其中一份 FantiaDownloader.js
  • 解決 MV3 的 background script persistent 問題
  • background.js 能夠在 service worker 運作
  • 解決 firefox 擴充版本的 ReadableStream bug 造成 zip.js 無法使用的問題
  • 測試
    • Chromium-base
    • Firefox
    • TamperMonkey

改動

  • 使用 Manifest V3
  • 擴充版本不再使用 inject.js
  • 準備檔案時就直接轉換成 Blob 而非 arrayBuffer
  • FantiaDownloader.js 運作於擴充版本中時:
    • 在 Firefox 的環境下 URL.createObjectURL 會被無效化,直接將 blob 傳到 background script。
    • 呼叫 GM* 函式會使用 userscriptAdapter.js 內的同名函式

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我不知道為什麼它認為整個檔案都被換掉了,不過這邊的內容和 userscript 版本是完全一樣的。

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 this pull request may close these issues.

1 participant