卸载反馈页面(uninstall.astro),当用户卸载 TabLogger 扩展时自动打开。已从独立 Vite+React 项目迁移为 Astro 页面,路由为 /tablogger/uninstall。
cd media/frontend
pnpm dev
访问地址:http://localhost:4321/tablogger/uninstall
可附加 URL 参数模拟插件传入的数据:
http://localhost:4321/tablogger/uninstall?v=0.1.1&lang=zh_CN&installed=1700000000000
| 参数 | 说明 |
|---|---|
v | 插件版本号 |
lang | 用户语言(en / zh_CN / zh_TW / ko / ja),缺省时使用浏览器 locale |
installed | 安装时间戳(毫秒),用于计算安装天数 |
优先级:?lang= URL 参数 → navigator.language → navigator.languages[] → 兜底 en
支持的语言:English(en)、简体中文(zh_CN)、繁體中文(zh_TW)、한국어(ko)、日本語(ja)
反馈数据写入 Supabase uninstall_feedback 表:
| 字段 | 说明 |
|---|---|
product_id | 固定值 tablogger |
product_version | 插件版本号(来自 URL 参数 v,缺省取 TABLOGGER_VERSION) |
reason | 卸载原因(枚举) |
comment | 可选补充说明(最多 500 字) |
email | 可选联系邮箱(最多 254 字符) |
browser_locale | 浏览器语言 |
browser_name | 浏览器品牌(Chrome / Firefox / Safari / Edge / Opera 等) |
browser_version | 浏览器版本号字符串 |
install_duration_days | 安装使用了多少天 |
安全说明:Anon Key 嵌入前端是安全的,Supabase RLS 只允许匿名 INSERT,无法读取或修改数据。
create table if not exists uninstall_feedback (
id bigint generated always as identity primary key,
created_at timestamptz not null default now(),
product_id text not null,
product_version text,
reason text not null,
comment text,
email text,
browser_locale text not null,
browser_name text,
browser_version text,
install_duration_days integer
);
-- 限制匿名用户只能 INSERT,不能读写其他行
alter table uninstall_feedback enable row level security;
create policy "allow anon insert"
on uninstall_feedback
for insert
to anon
with check (true);
alter table uninstall_feedback
add column if not exists email text check (char_length(email) <= 254);
alter table uninstall_feedback
add column if not exists browser_name text;
alter table uninstall_feedback
add column if not exists browser_version text;