From 6cf365ff6d62ccff413050932e1f2c6e16ed07e1 Mon Sep 17 00:00:00 2001 From: qwqcode Date: Wed, 20 Dec 2023 23:15:32 +0800 Subject: [PATCH] fix(ui): add `referrerpolicy` attribute for iframe (#687) --- ui/packages/artalk-sidebar/index.html | 1 + ui/packages/artalk/src/components/checker/captcha-renders.ts | 2 +- ui/packages/artalk/src/layer/sidebar-layer.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/packages/artalk-sidebar/index.html b/ui/packages/artalk-sidebar/index.html index 55db33a83..683120527 100644 --- a/ui/packages/artalk-sidebar/index.html +++ b/ui/packages/artalk-sidebar/index.html @@ -3,6 +3,7 @@ + Artalk Sidebar diff --git a/ui/packages/artalk/src/components/checker/captcha-renders.ts b/ui/packages/artalk/src/components/checker/captcha-renders.ts index 2b0f05786..c56a39e0d 100644 --- a/ui/packages/artalk/src/components/checker/captcha-renders.ts +++ b/ui/packages/artalk/src/components/checker/captcha-renders.ts @@ -27,7 +27,7 @@ export function imgBody(checker: CheckerCtx) { /** iframe 形式的通用验证服务 */ export function iframeBody(checker: CheckerCtx) { const $iframeWrap = Utils.createElement(`
`) - const $iframe = Utils.createElement(``) + const $iframe = Utils.createElement(``) $iframe.style.display = 'none' Ui.showLoading($iframeWrap, { transparentBg: true }) $iframe.src = `${checker.getOpts().getIframeURLBase() || ''}/api/captcha/get?t=${+new Date()}` diff --git a/ui/packages/artalk/src/layer/sidebar-layer.ts b/ui/packages/artalk/src/layer/sidebar-layer.ts index 8731fffc9..5e35b283d 100644 --- a/ui/packages/artalk/src/layer/sidebar-layer.ts +++ b/ui/packages/artalk/src/layer/sidebar-layer.ts @@ -116,7 +116,7 @@ export default class SidebarLayer extends Component { } private createIframe(view?: string) { - const $iframe = Utils.createElement('') + const $iframe = Utils.createElement('') // 准备 Iframe 参数 const baseURL = (import.meta.env.DEV) ? 'http://localhost:23367/'