From 3f950a42dc445c402f896ce74a3f4dc6cb2014b6 Mon Sep 17 00:00:00 2001 From: Soufiane Fariss Date: Tue, 1 Oct 2024 14:45:13 +0200 Subject: [PATCH 1/5] explorer web: improve url navigation This commit enhances the navigation guard for the /analysis route to provide a better user experience when loading data from a URL: Previously: users browsing to /analysis were always redirected to the homepage (/). With this commit: - If a user accesses /analysis without an rdoc parameter, they are still redirected to the homepage. - If a user accesses /analysis with an rdoc parameter, the following occurs: The user is redirected to the homepage (/) and the rdoc parameter is preserved in the URL, capa Explorer Web then loads the rdoc from URL. --- web/explorer/src/router/index.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/web/explorer/src/router/index.js b/web/explorer/src/router/index.js index 3dc90bb4c..4d9d0f067 100644 --- a/web/explorer/src/router/index.js +++ b/web/explorer/src/router/index.js @@ -18,12 +18,20 @@ const router = createRouter({ name: "analysis", component: AnalysisView, beforeEnter: (to, from, next) => { - if (rdocStore.data.value === null) { - // No rdoc loaded, redirect to home page - next({ name: "home" }); - } else { - // rdoc is loaded, proceed to analysis page + // check if rdoc is loaded + if (rdocStore.data.value !== null) { + // rdocStore.data already contains the rdoc json - continue next(); + } else { + // rdoc is not loaded, check if the rdoc query param is set in the URL + const rdocUrl = to.query.rdoc; + if (rdocUrl) { + // query param is set - try to load the rdoc from the homepage + next({ name: "home", query: { rdoc: rdocUrl } }); + } else { + // no query param is set - go back home + next({ name: "home" }); + } } } }, From 474ed8a31f023720600ab9b772ccd399ea39d206 Mon Sep 17 00:00:00 2001 From: Soufiane Fariss Date: Tue, 1 Oct 2024 16:40:00 +0200 Subject: [PATCH 2/5] changelog: improve navigation in capa Explorer Web --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3515b19d9..46783641b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ ### capa explorer IDA Pro plugin ### Development +- capa Explorer Web: improve navigation in capa Explorer Web ### Raw diffs From 995d20ffb9199410c417bc4e72f5186e4f496609 Mon Sep 17 00:00:00 2001 From: Soufiane Fariss Date: Tue, 1 Oct 2024 19:19:22 +0200 Subject: [PATCH 3/5] add new changelog section for capa Explorer Web --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46783641b..a57dbceba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,8 +34,10 @@ ### capa explorer IDA Pro plugin +### capa Explorer Web +- improve navigation in capa Explorer Web @s-ff #2425 + ### Development -- capa Explorer Web: improve navigation in capa Explorer Web ### Raw diffs From 357537d1476bd9964bde6f90508bb6933a435697 Mon Sep 17 00:00:00 2001 From: Moritz Date: Tue, 1 Oct 2024 19:23:43 +0200 Subject: [PATCH 4/5] Update CHANGELOG.md --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a57dbceba..5f79357cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,11 +32,10 @@ - replace tabulate, tqdm, and termcolor with rich #2374 @s-ff - dynamic: emit complete features for A/W APIs #2409 @mike-hunhoff -### capa explorer IDA Pro plugin - ### capa Explorer Web - improve navigation in capa Explorer Web @s-ff #2425 +### capa Explorer IDA Pro plugin ### Development ### Raw diffs From 50f5ae9fed199dc0054e8a9ca366ee7ba46e1520 Mon Sep 17 00:00:00 2001 From: Moritz Date: Tue, 1 Oct 2024 19:24:02 +0200 Subject: [PATCH 5/5] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f79357cb..7e1ab22d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ - improve navigation in capa Explorer Web @s-ff #2425 ### capa Explorer IDA Pro plugin + ### Development ### Raw diffs