开发工具

PWA 桌面快捷方式

生成 PWA (Progressive Web App) manifest.json + HTML 注册代码,让网站可"安装"到桌面。


            

使用说明

参数与限制

  • name (必填):完整应用名。
  • shortName:桌面图标下显示的短名(≤ 12 字符)。
  • startUrl:打开时加载的 URL。
  • themeColor:浏览器 UI 颜色。
  • bgColor:启动屏背景色。
  • iconUrl:192x192 / 512x512 PNG 图标 URL。

使用

  • 将 manifest JSON 保存为 /manifest.json
  • HTML <head> 引用:<link rel="manifest" href="/manifest.json">
  • 注册 service worker(API 输出含示例代码)。

运行环境

  • 纯前端 + Node.js;Agent 调用 /api/urlapp/

Agent API 调用示例

// Step 1: 读取工具 Schema
GET https://clawam.com/tools/urlapp/schema.json

// Step 2: 调用 API
POST https://clawam.com/api/urlapp/
{

  "name": "My App",
  "themeColor": "#4a90e2"}
\n\n'; return { result: '=== /manifest.json ===\n' + JSON.stringify(manifest, null, 2) + '\n\n=== /index.html 头部 ===\n' + html, meta: 'PWA manifest 已生成' }; } form.addEventListener('submit', function(e) { e.preventDefault(); btnMain.disabled = true; var origLabel = btnMain.textContent; btnMain.textContent = '处理中…'; errorMsg.classList.remove('show'); resultArea.classList.remove('show'); try { var out = runTool(); showResult(out.result, out.meta); } catch (err) { showError('错误:' + err.message); } btnMain.disabled = false; btnMain.textContent = origLabel; }); btnClear.addEventListener('click', function() { form.reset(); resultArea.classList.remove('show'); errorMsg.classList.remove('show'); }); })();'''