From 32b3ebdf5e5465a464d26d76591f3ff4a1b3b582 Mon Sep 17 00:00:00 2001 From: Taka Date: Fri, 3 Dec 2021 21:15:59 +1100 Subject: [PATCH] Strip HTML when setting the browser titlebar. --- web/src/App.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/src/App.js b/web/src/App.js index 4578948..3ccf235 100644 --- a/web/src/App.js +++ b/web/src/App.js @@ -563,6 +563,10 @@ export class App extends React.Component this.setWindowTitle( null ) ; } setWindowTitle( caption ) { + if ( caption ) { + let doc = new DOMParser().parseFromString( caption, "text/html" ) ; + caption = doc.body.textContent ; + } document.title = caption ? APP_NAME + " - " + caption : APP_NAME ; }