From 7c9f1f0f88a5b03735356933e86e9d4cde807427 Mon Sep 17 00:00:00 2001 From: zk2f <168441488+zk2f@users.noreply.github.com> Date: Sat, 30 Nov 2024 07:32:36 +0000 Subject: [PATCH] added script to redirect to main site if embedded --- docs/.vitepress/config.mts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index a7d8a9e4b..360eb1ca7 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -63,6 +63,18 @@ export default defineConfig({ name: 'google-site-verification', content: 'XCq-ZTw6VJPQ7gVNEOl8u0JRqfadK7WcsJ0H598Wv9E' } + ], + // Redirect to main site if embedded in iframe + [ + 'script', + {}, + ` + (function() { + if (window.self !== window.top) { + window.top.location = window.location.href; + } + })(); + ` ] ], transformHead: async (context) => generateMeta(context, meta.hostname),