Skip to content

Commit

Permalink
Merge pull request #3282 from CVEProject/jd-3258-browserTab
Browse files Browse the repository at this point in the history
#3258 dynamically updates tab title to reflect searched cve record
  • Loading branch information
athu-tran authored Dec 2, 2024
2 parents f1dc818 + 564917a commit 481b48d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/cveRecordLookupModule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default {
this.resetStates();
useCveRecordLookupStore().cveId = this.cveId;
const newPath = `/CVERecord?id=${useCveRecordLookupStore().cveId}`;
this.$router.push(newPath);
this.$router.push({path: newPath, query: {id: useCveRecordLookupStore().cveId }});
this.lookupId()
}
},
Expand Down
5 changes: 5 additions & 0 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,11 @@ router.beforeEach((to, from, next) => {
// Remove any stale meta tags from the document using the key attribute we set below.
Array.from(document.querySelectorAll('[data-vue-router-controlled]'), (el) => el.parentNode.removeChild(el));

//Changes title to reflect CVE-ID
if (to.name === "CVERecord") {
document.title = to.query.id + " | CVE"
}

// Skip rendering meta tags if there are none.
if (!nearestWithMeta) return next();

Expand Down

0 comments on commit 481b48d

Please sign in to comment.