feat:添加测试页面并优化时间戳工具

refactor: 优化时间戳转换组件及整体代码结构
chore: 更新构建配置和包依赖项
This commit is contained in:
雨霖铃
2026-02-13 17:29:01 +08:00
parent ee4d328b9c
commit 22985f4c18
17 changed files with 281 additions and 180 deletions
+7 -12
View File
@@ -61,10 +61,7 @@ export default defineBackground(() => {
})
.catch((error: Error) => {
if (error.message.includes('restricted URL')) {
console.warn(
'Could not check status: on a restricted page.',
error.message,
);
console.warn('Could not check status: on a restricted page.', error.message);
} else if (error.message.includes('No active tab found')) {
console.warn('Could not check status: no active tab found.');
} else {
@@ -84,10 +81,7 @@ export default defineBackground(() => {
})
.catch((error: Error) => {
if (error.message.includes('restricted URL')) {
console.warn(
'Could not start recording: on a restricted page.',
error.message,
);
console.warn('Could not start recording: on a restricted page.', error.message);
} else if (error.message.includes('No active tab found')) {
console.warn('Could not start recording: no active tab found.');
} else {
@@ -107,10 +101,7 @@ export default defineBackground(() => {
})
.catch((error: Error) => {
if (error.message.includes('restricted URL')) {
console.warn(
'Could not stop recording: on a restricted page.',
error.message,
);
console.warn('Could not stop recording: on a restricted page.', error.message);
} else if (error.message.includes('No active tab found')) {
console.warn('Could not stop recording: no active tab found.');
} else {
@@ -132,6 +123,10 @@ export default defineBackground(() => {
}
});
onMessage('getStringLength', (message) => {
return message.data.length;
});
async function sendToActiveTab(message: {
type: string;
data?: unknown;