Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion mpMath/assets/js/mpm-inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ var readyStateCheckInterval = setInterval(function() {
editing.innerHTML = event.data.text.substring(beg, end);
editingMode = false; // 还原为非编辑模式
} else {
window.UE.getEditor('js_editor').execCommand('insertHTML', '\xA0' + event.data.text + '\xA0');
window.__MP_Editor_JSAPI__.invoke({
apiName: 'mp_editor_insert_html',
apiParam: {
html: '\xA0' + event.data.text + '\xA0',
isSelect: false
},
sucCb: (res) => {console.log('设置成功', res)},
errCb: (err) => {console.log('设置失败', err)}
})
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion mpMath/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "微信公众号公式插件.",
"permissions": ["storage", "declarativeContent", "activeTab", "scripting"],
"background": {
"background.service_worker": "assets/js/background.js",
"service_worker": "assets/js/background.js",
"type": "module"
},
"action": {
Expand Down