Failed to execute 'setItem' on 'Storage': Setting the value of 'articles' exceeded the quota.
不要直接插入图片,而是:
- 上传图片到 https://sm.ms
- 复制图片链接
- 在编辑器中插入链接
- 打开
test-image-compression.html - 上传图片
- 下载压缩后的图片
- 使用压缩后的图片
在控制台(F12)运行:
// 查看存储使用情况
let total = 0;
for (let key in localStorage) {
if (localStorage.hasOwnProperty(key)) {
total += localStorage[key].length;
}
}
console.log('已使用:', (total / 1024 / 1024).toFixed(2), 'MB / 5 MB');- 使用图床服务(Imgur, SM.MS)
- 图片压缩到 < 200KB
- 定期清理旧文章
- 直接插入 > 1MB 的图片
- 在一篇文章中插入大量图片
- 忽略存储空间警告
IMAGE_STORAGE_GUIDE.md- 完整解决方案ARTICLE_MANAGER_DEBUG.md- 调试指南test-image-compression.html- 压缩测试工具
用图床,别用 base64!