refactor(storage): 将 storage 工具类导出名重命名为 storageUtil
- 将 utils/chromeStorage.ts 中的 storage 导出重命名为 storageUtil - 更新 RoutePersistence.tsx 中的导入和引用以使用新名称 - 优化 recordUtils.tsx 中 chrome.downloads 的链式调用格式 使工具类的命名更加清晰,避免与全局 storage 概念混淆
This commit is contained in:
@@ -40,4 +40,4 @@ class StorageUtils {
|
||||
}
|
||||
}
|
||||
|
||||
export const storage = new StorageUtils();
|
||||
export const storageUtil = new StorageUtils();
|
||||
|
||||
@@ -55,11 +55,13 @@ export const downloadHtmlInBackground = (events: unknown[]) => {
|
||||
const blob = new Blob([htmlContent], { type: 'text/html' });
|
||||
const reader = new FileReader();
|
||||
reader.onload = () => {
|
||||
chrome.downloads.download({
|
||||
url: reader.result as string,
|
||||
filename: `replay-${Date.now()}.html`,
|
||||
saveAs: true,
|
||||
}).then(r => console.log(r));
|
||||
chrome.downloads
|
||||
.download({
|
||||
url: reader.result as string,
|
||||
filename: `replay-${Date.now()}.html`,
|
||||
saveAs: true,
|
||||
})
|
||||
.then((r) => console.log(r));
|
||||
};
|
||||
reader.readAsDataURL(blob);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user