diff --git a/browser-extension b/browser-extension index d9b28cc1e..f2715e950 160000 --- a/browser-extension +++ b/browser-extension @@ -1 +1 @@ -Subproject commit d9b28cc1e23b64fdb4e666d5b5b49cc8e583aabd +Subproject commit f2715e950e3c8afc471609afe518bf5452bc1049 diff --git a/frontend/src/pages/GeneralSettings/EmbedConfigs/NewEmbedModal/index.jsx b/frontend/src/pages/GeneralSettings/EmbedConfigs/NewEmbedModal/index.jsx index e9cef75e9..9aa9a9db5 100644 --- a/frontend/src/pages/GeneralSettings/EmbedConfigs/NewEmbedModal/index.jsx +++ b/frontend/src/pages/GeneralSettings/EmbedConfigs/NewEmbedModal/index.jsx @@ -250,6 +250,25 @@ export const PermittedDomains = ({ defaultValue = [] }) => { setDomains(validDomains); }; + const handleBlur = (event) => { + const currentInput = event.target.value; + if (!currentInput) return; + + const validDomains = [...domains, currentInput].map((input) => { + let url = input; + if (!url.includes("http://") && !url.includes("https://")) + url = `https://${url}`; + try { + new URL(url); + return url; + } catch { + return null; + } + }); + event.target.value = ""; + setDomains(validDomains); + }; + return (
@@ -270,6 +289,7 @@ export const PermittedDomains = ({ defaultValue = [] }) => {