From e9ecbd6a270616993e3fa7bf1316e890a92bc920 Mon Sep 17 00:00:00 2001 From: Willian Galvani Date: Tue, 30 Jan 2024 00:41:03 -0300 Subject: [PATCH] core: frontend: add support for 'avoid_iframes' field in register_service --- core/frontend/src/App.vue | 4 ++++ core/frontend/src/types/helper.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/core/frontend/src/App.vue b/core/frontend/src/App.vue index fa836fb309..51ee4e5c44 100644 --- a/core/frontend/src/App.vue +++ b/core/frontend/src/App.vue @@ -673,6 +673,10 @@ export default Vue.extend({ } }, createExtensionAddress(service: Service): string { + if (service.metadata?.avoid_iframes) { + const base_url = window.location.origin.split(":").slice(0, 2).join(":") + return `${base_url}:${service.port}` + } let address = `/extension/${service?.metadata?.sanitized_name}` if (service?.metadata?.new_page) { address += '?full_page=true' diff --git a/core/frontend/src/types/helper.ts b/core/frontend/src/types/helper.ts index ab3df3bedf..022cdcd30d 100644 --- a/core/frontend/src/types/helper.ts +++ b/core/frontend/src/types/helper.ts @@ -10,6 +10,7 @@ export interface ServiceMetadata { new_page?: boolean sanitized_name?: string extra_query?: string + avoid_iframes?: boolean } export interface Service {