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); } }; diff --git a/src/web/html/index.html b/src/web/html/index.html index 315e4c3a..34c0958a 100755 --- a/src/web/html/index.html +++ b/src/web/html/index.html @@ -26,7 +26,7 @@ CyberChef - + @@ -76,6 +76,11 @@ changeLoadingMsg(); window.loadingMsgsInt = setInterval(changeLoadingMsg, (Math.random() * 1000) + 1000); + <% if (!htmlWebpackPlugin.options.inline) { %> + + <% } %> diff --git a/src/web/static/structuredData.json b/src/web/static/structuredData.json new file mode 100644 index 00000000..08677281 --- /dev/null +++ b/src/web/static/structuredData.json @@ -0,0 +1,23 @@ +[ + { + "@context": "http://schema.org", + "@type": "Organization", + "url": "https://gchq.github.io/CyberChef/", + "logo": "https://gchq.github.io/CyberChef/images/cyberchef-128x128.png", + "sameAs": [ + "https://github.com/gchq/CyberChef", + "https://www.npmjs.com/package/cyberchef" + ] + }, + { + "@context": "http://schema.org", + "@type": "WebSite", + "url": "https://gchq.github.io/CyberChef/", + "name": "CyberChef", + "potentialAction": { + "@type": "SearchAction", + "target": "https://gchq.github.io/CyberChef/?op={operation_search_term}", + "query-input": "required name=operation_search_term" + } + } +]