local iframeResizer

load iframeResizer from webui assets
ASSETS_COMMIT_HASH needs to be updated accordingly after https://github.com/AUTOMATIC1111/stable-diffusion-webui-assets/pull/2 is merged
This commit is contained in:
w-e-w 2024-08-10 19:34:01 +09:00
parent eed3b43252
commit 4861dccf7c

View File

@ -62,7 +62,9 @@ def reload_javascript():
# remove preconnects
res.body = re_preconnect.sub(b'', res.body)
# replace iframeResizer with local version
res.body = res.body.replace(b'src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.6/iframeResizer.contentWindow.min.js"', b'src="webui-assets/js/iframe-resizer/4.3.6/iframeResizer.contentWindow.min.js"')
res.body = res.body.replace(b'</head>', f'{js}<meta name="referrer" content="no-referrer"/></head>'.encode("utf8"))
res.body = res.body.replace(b'</body>', f'{css}</body>'.encode("utf8"))
res.init_headers()