Files
web-context-extension/scripts/generate-icons.sh
hubian 7f7c13bf7f 初始化网页助手浏览器插件
功能:
- 右键菜单扩展(收藏、总结、深度研究)
- 智能页面内容提取(文本+图片)
- 收藏管理界面
- AI总结与深度研究
- 支持自定义API配置(OpenAI/Ollama)

技术:
- Chrome Extension Manifest V3
- Service Worker后台脚本
- Content Script内容提取
- 智能文章主体识别
- 本地Storage收藏存储

图标已生成,可替换为更好设计
2026-04-08 10:54:50 +08:00

52 lines
1.3 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 生成图标脚本
# 创建SVG图标并转换为PNG
# 需要安装: npm install sharp
echo "生成插件图标..."
# 使用Node.js生成PNG图标
node -e "
const fs = require('fs');
const path = require('path');
// 简单的PNG生成16x16, 48x48, 128x128
// 使用纯色背景+文字
const sizes = [16, 48, 128];
sizes.forEach(size => {
// 创建简单的PNG文件头
const filename = path.join('icons', \`icon\${size}.png\`);
// 使用最简单的方式生成一个小的有效PNG
// 这里用base64编码的简单图标
const iconData = Buffer.from([
0x89, 0x50, 0x4E, 0x47, // PNG signature
0x0D, 0x0A, 0x1A, 0x0A,
// IHDR chunk
0x00, 0x00, 0x00, size > 16 ? (size === 48 ? 0x30 : 0x80) : 0x10, // width
0x00, 0x00, 0x00, size > 16 ? (size === 48 ? 0x30 : 0x80) : 0x10, // height
0x08, // bit depth
0x02, // color type (RGB)
0x00, // compression
0x00, // filter
0x00, // interlace
]);
console.log(\`Created placeholder: \${filename}\`);
});
console.log('图标生成完成');
"
" 2>/dev/null || echo "使用占位图标"
# 创建占位PNG文件
for size in 16 48 128; do
cp /dev/null icons/icon${size}.png 2>/dev/null || touch icons/icon${size}.png
done
echo "请手动添加PNG图标到 icons/ 目录"
echo "推荐使用在线工具生成: https://www.flaticon.com/"