Skip to content

Commit

Permalink
local iframeResizer
Browse files Browse the repository at this point in the history
load iframeResizer from webui assets
ASSETS_COMMIT_HASH needs to be updated accordingly after AUTOMATIC1111/stable-diffusion-webui-assets#2 is merged
  • Loading branch information
w-e-w committed Aug 10, 2024
1 parent eed3b43 commit 4861dcc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/ui_gradio_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ def template_response(*args, **kwargs):

# 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()
Expand Down

0 comments on commit 4861dcc

Please sign in to comment.