From 5cc81c30df2624360aa47c2359bc882b8434c89d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Tue, 9 Apr 2024 15:54:34 +0200 Subject: [PATCH] Minor improvement for openWindow for external urls --- src/app/helpers/plugin.ts | 4 ++-- src/app/services/uds-api.service.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/helpers/plugin.ts b/src/app/helpers/plugin.ts index b0e4317..09be66e 100644 --- a/src/app/helpers/plugin.ts +++ b/src/app/helpers/plugin.ts @@ -234,7 +234,7 @@ export class Plugin { let wnd = '__global__'; // check if on same window or not if (location.indexOf('o_s_w=') !== -1) { - const osw = /(.*)&o_s_w=.*/.exec(location); + const osw = /(.*)[&?]o_s_w=.*/.exec(location); wnd = '__same__'; // @ts-ignore osw is something for sure, checked before location = osw[1]; @@ -242,7 +242,7 @@ export class Plugin { // If the url contains "o_n_w", will open the url on a new window ALWAYS if (location.indexOf('o_n_w=') !== -1) { // Extract window name from o_n_w parameter if present - const onw = /(.*)&o_n_w=([a-zA-Z0-9._-]*)/.exec(location); + const onw = /(.*)[&?]o_n_w=([a-zA-Z0-9._-]*)/.exec(location); if (onw) { wnd = onw[2]; location = onw[1]; diff --git a/src/app/services/uds-api.service.ts b/src/app/services/uds-api.service.ts index 5fdd1ab..e016307 100644 --- a/src/app/services/uds-api.service.ts +++ b/src/app/services/uds-api.service.ts @@ -157,9 +157,9 @@ export class UDSApiService implements UDSApiServiceType { executeCustomJSForServiceLaunch(): void { // Executes a defined JS on launch servic event if defined // this is in fact a hook - if (udsData.customJSForServiceLaunch !== undefined) { + if (udsData.custom_js_for_service_launch !== undefined) { // eslint-disable-next-line no-eval - eval(udsData.customJSForServiceLaunch); + eval(udsData.custom_js_for_service_launch); } }