feat:添加测试页面并优化时间戳工具
refactor: 优化时间戳转换组件及整体代码结构 chore: 更新构建配置和包依赖项
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user