1
0
mirror of https://github.com/dkmstr/openuds-gui.git synced 2024-10-26 08:55:23 +03:00

Minor improvement for openWindow for external urls

This commit is contained in:
Adolfo Gómez García 2024-04-09 15:54:34 +02:00
parent 37b0b44ab3
commit 5cc81c30df
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23
2 changed files with 4 additions and 4 deletions

View File

@ -234,7 +234,7 @@ export class Plugin {
let wnd = '__global__'; let wnd = '__global__';
// check if on same window or not // check if on same window or not
if (location.indexOf('o_s_w=') !== -1) { if (location.indexOf('o_s_w=') !== -1) {
const osw = /(.*)&o_s_w=.*/.exec(location); const osw = /(.*)[&?]o_s_w=.*/.exec(location);
wnd = '__same__'; wnd = '__same__';
// @ts-ignore osw is something for sure, checked before // @ts-ignore osw is something for sure, checked before
location = osw[1]; 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 the url contains "o_n_w", will open the url on a new window ALWAYS
if (location.indexOf('o_n_w=') !== -1) { if (location.indexOf('o_n_w=') !== -1) {
// Extract window name from o_n_w parameter if present // 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) { if (onw) {
wnd = onw[2]; wnd = onw[2];
location = onw[1]; location = onw[1];

View File

@ -157,9 +157,9 @@ export class UDSApiService implements UDSApiServiceType {
executeCustomJSForServiceLaunch(): void { executeCustomJSForServiceLaunch(): void {
// Executes a defined JS on launch servic event if defined // Executes a defined JS on launch servic event if defined
// this is in fact a hook // this is in fact a hook
if (udsData.customJSForServiceLaunch !== undefined) { if (udsData.custom_js_for_service_launch !== undefined) {
// eslint-disable-next-line no-eval // eslint-disable-next-line no-eval
eval(udsData.customJSForServiceLaunch); eval(udsData.custom_js_for_service_launch);
} }
} }