Skip to content

chore: repo hygiene — .gitattributes 與隱私聲明 - #1

Merged
1morr merged 2 commits into
mainfrom
chore/repo-hygiene
Sep 16, 2026
Merged

1morr merged 2 commits into
mainfrom
chore/repo-hygiene

Conversation

@1morr

@1morr 1morr commented Sep 16, 2026

Copy link
Copy Markdown
Owner

套用 repo-hygiene skill 的分級清單,先量再加,本 PR 只做量出來成立的兩項。

1. .gitattributes(* text=auto)

觸發條件:在 Windows 上開發 —— 成立。

先量的結果:

  • git add --renormalize . → 零 diff(除了新增的 .gitattributes 本身)。
  • 追蹤中的 34 個文字 blob,0 個含 CR。

所以這是純保險,不是修正:防的是未來在沒有 core.autocrlf=true 的機器上 clone,而不是修現有檔案。沒有任何既有檔案被重新正規化。

2. PRIVACY.md

觸發條件:manifest 的 permissions 含 cookies,且是裝在別人機器上的瀏覽器擴充 —— 成立。

內容逐條對應程式碼,不寫程式碼沒說的話:

  • 讀哪個 cookie:只有 shared/api.js 的 chrome.cookies.get({ url: 'https://www.bilibili.com', name: 'DedeUserID' }),全庫唯一一處 cookie 讀取。
  • 呼叫哪些 endpoint:shared/api.js 的五個 api.live.bilibili.com 路徑,各自標明什麼時候會打。
  • 圖片與預覽:hdslb.com 的頭像/封面(credentials: 'omit' + no-referrer),以及 hover 時嵌入的 blackboard/live/live-activity-player.html iframe。
  • 資料去哪:只有 chrome.storage.local(全庫 0 處 chrome.storage.sync),匯出是瀏覽器下載成本機檔案,且 exportConfig 只複製 SETTINGS_KEYS 白名單。
  • 沒有收集什麼:無 analytics/telemetry/sendBeacon/WebSocket/第三方 host;manifest 的 host_permissions 就只有 *.bilibili.com 與 *.hdslb.com 兩個。
  • 怎麼收回:Site access 或移除擴充;cookies 權限 Chrome 不能單獨撤銷,所以照實說。

README 的「Permissions」節與 README.zh-Hant.md 的「權限」節各加一行連過去。

驗證

npx eslint . 通過;node --test "tests/**/*.mjs" 21 pass / 0 fail。

Measured before committing: `git add --renormalize .` is a zero diff and
no tracked blob contains a CR, so this is insurance against a checkout on
a machine without core.autocrlf, not a correction.
The README's permission table says what each permission is for; a user
deciding whether to grant `cookies` and bilibili.com host access needs to
know which cookie, which endpoints, and that nothing leaves the machine.
Every claim points at the file that backs it, so the notice goes stale
loudly rather than quietly.
@1morr
1morr merged commit 766e8f1 into main Sep 16, 2026
1 check passed
@1morr
1morr deleted the chore/repo-hygiene branch September 16, 2026 02:42
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