tools/WeixinBrowserPlugin/src/TROUBLESHOOTING.md
检查插件是否已安装并启用
chrome://extensions/检查插件权限
*.weixin.qq.com确保你访问的是正确的微信文档页面:
https://developers.weixin.qq.com/doc/https://developers.weixin.qq.com/miniprogram/dev/https://work.weixin.qq.com/api/doc/https://weixin.qq.com/ (这不是文档页面)打开开发者工具
F12 或右键选择"检查"查看控制台日志 刷新页面后,应该看到类似以下日志:
Senparc.Weixin.AI 插件开始初始化...
当前页面URL: https://developers.weixin.qq.com/doc/
当前域名: developers.weixin.qq.com
✅ 检测到微信文档页面,初始化AI助手...
🎨 开始创建Logo按钮...
✅ Logo按钮已添加到页面
如果没有看到日志
content.js 文件在控制台中运行以下代码进行调试:
// 检查插件状态
console.log('当前域名:', window.location.hostname);
console.log('是否微信域名:', window.location.hostname.endsWith('weixin.qq.com'));
console.log('WeixinAIAssistant:', typeof window.WeixinAIAssistant);
// 查找Logo按钮
const button = document.getElementById('senparc-weixin-ai-button');
console.log('Logo按钮:', button);
// 手动创建测试按钮
const testBtn = document.createElement('div');
testBtn.style.cssText = 'position:fixed;top:20px;left:20px;z-index:9999;background:red;color:white;padding:10px;';
testBtn.textContent = '测试按钮';
document.body.appendChild(testBtn);
症状:控制台显示权限错误 解决:
chrome://extensions/症状:控制台没有任何插件相关日志 解决:
manifest.json 中的 matches 配置症状:按钮创建了但不可见 解决:
// 检查按钮样式
const button = document.getElementById('senparc-weixin-ai-button');
if (button) {
console.log('按钮样式:', window.getComputedStyle(button));
// 强制显示按钮
button.style.cssText = 'position:fixed!important;top:20px!important;left:20px!important;z-index:99999!important;background:green!important;color:white!important;padding:10px!important;display:block!important;';
}
症状:页面加载完成前插件就执行了 解决:
// 手动重新初始化
if (window.WeixinAIAssistant) {
new window.WeixinAIAssistant();
}
如果以上步骤都无法解决问题:
完全卸载插件
chrome://extensions/ 中点击"移除"重新安装
测试基本功能
https://developers.weixin.qq.com/doc/如果问题仍然存在,请提供以下信息:
浏览器信息
错误日志
插件状态
将 debug.js 文件内容复制到控制台运行,获取详细的调试信息。
确认 manifest.json 配置正确:
{
"content_scripts": [
{
"matches": ["https://*.weixin.qq.com/*"],
"js": ["content.js"],
"css": ["styles.css"],
"run_at": "document_end"
}
]
}
确认以下文件存在且内容完整:
manifest.jsoncontent.jsstyles.csspopup.htmlpopup.jsicon.svg