Add page data delivery and publication guards
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import crypto from 'node:crypto';
|
||||
import { injectBeforeDocumentClosingBody } from './html-document-injection.mjs';
|
||||
|
||||
const PUBLIC_FILE_SHARE_SCRIPT = `(function(){
|
||||
var root=document.querySelector('[data-mindspace-public-share]');
|
||||
@@ -199,7 +200,7 @@ ${plazaButtonMarkup} <button type="button" data-action="capture">保存长图
|
||||
<script>${PUBLIC_FILE_SHARE_SCRIPT}</script>`;
|
||||
if (/<\/body>/i.test(source)) {
|
||||
return {
|
||||
html: source.replace(/<\/body>/i, `${markup}</body>`),
|
||||
html: injectBeforeDocumentClosingBody(source, markup),
|
||||
scriptHashes: [PUBLIC_FILE_SHARE_SCRIPT_HASH],
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user