From d8108bff0ecbddb53cb8a9b5f0a8a8a20fdf9e38 Mon Sep 17 00:00:00 2001 From: Alexandr Stelnykovych Date: Fri, 31 Jan 2025 17:50:00 +0200 Subject: [PATCH] [fix] UI: Error when clicking on 'Apps' in the application configuration https://github.com/safing/portmaster/issues/1721 --- desktop/angular/src/app/pages/app-view/app-view.html | 2 +- desktop/angular/src/main.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/desktop/angular/src/app/pages/app-view/app-view.html b/desktop/angular/src/app/pages/app-view/app-view.html index 0bba8b7b..72a7ad81 100644 --- a/desktop/angular/src/app/pages/app-view/app-view.html +++ b/desktop/angular/src/app/pages/app-view/app-view.html @@ -3,7 +3,7 @@
- Apps +
Apps
diff --git a/desktop/angular/src/main.ts b/desktop/angular/src/main.ts index 1d83337d..f6fc9b2c 100644 --- a/desktop/angular/src/main.ts +++ b/desktop/angular/src/main.ts @@ -27,9 +27,15 @@ if (typeof (CSS as any)['registerProperty'] === 'function') { } function handleExternalResources(e: Event) { + // TODO: + // This code executes "openExternal()" when any "" element in the app is clicked. + // This could potentially be a security issue. + // We should consider restricting this to only external links that belong to a certain domain (e.g., https://safing.io). + // get click target let target: HTMLElement | null = e.target as HTMLElement; - // traverse until we reach an a tag + + // traverse until we reach element "" while (!!target && target.tagName !== "A") { target = target.parentElement; }