MCPcopy Create free account
hub / github.com/XIU2/UserScript / vfastpostDOMNodeInserted

Function vfastpostDOMNodeInserted

Hostloc-Enhanced.user.js:331–338  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

329 }
330 // 监听插入事件(预览快速回复带签名)
331 function vfastpostDOMNodeInserted() {
332 let vfastpost = e => {
333 if (e.target.nodeType == 1 && e.target.innerHTML && e.target.innerHTML.indexOf('id="vfastpost"') > -1) {
334 e.target.getElementsByTagName('form')[0].insertAdjacentHTML('afterbegin', `<input type="hidden" name="usesig" value="1">`);
335 }
336 }
337 document.addEventListener('DOMNodeInserted', vfastpost); // 监听插入事件
338 }
339 // 自定义小尾巴内容
340 function customLittleTail() {
341 let newLittleTail = prompt('编辑 [自定义小尾巴内容],刷新网页后生效(换行请使用 \\n\n提示①:记得在小尾巴前面加上几个 \\n 换行,用来分隔开回帖内容~\n提示②:建议使用 [align=right] 标签来使小尾巴居右~\n提示③:支持论坛富文本标签(建议先找个回复编辑预览好~\n示例:\\n\\n\\n\\n[align=right]第一行内容~\\n第二行内容~[/align]', GM_getValue('menu_customLittleTail'));

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected