From 7a56af8ffaa981e437d8e478d835d11c396fddb4 Mon Sep 17 00:00:00 2001 From: n1474335 Date: Thu, 27 Jul 2017 15:33:24 +0000 Subject: [PATCH] Page title changes to reflect recipe --- src/web/App.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/web/App.js b/src/web/App.js index ec0ed578..2880b8ac 100755 --- a/src/web/App.js +++ b/src/web/App.js @@ -666,10 +666,20 @@ App.prototype.alertCloseClick = function() { App.prototype.stateChange = function(e) { this.autoBake(); + // Set title + const recipeConfig = this.getRecipeConfig(); + let title = "CyberChef"; + if (recipeConfig.length === 1) { + title = `${recipeConfig[0].op} - ${title}`; + } else if (recipeConfig.length > 1) { + title = `${recipeConfig.length} operations - ${title}`; + } + document.title = title; + // Update the current history state (not creating a new one) if (this.options.updateUrl) { - this.lastStateUrl = this.manager.controls.generateStateUrl(true, true); - window.history.replaceState({}, "CyberChef", this.lastStateUrl); + this.lastStateUrl = this.manager.controls.generateStateUrl(true, true, recipeConfig); + window.history.replaceState({}, title, this.lastStateUrl); } };