plasma6-window-title-applet
plasma6-window-title-applet copied to clipboard
HTML Rendering Issue in Window Titles
Version: 0.9.0
Description
The current implementation unexpectedly processes HTML tags.
Example
This title contains the following text <h1>bigg<\h1>
I assume you want kitty to be big? Try doing <h1>%a</h1>.
%a replaces application name
%w replaces window name
And %q for activity name
Sorry for not being clear, I want the complete opposite.
I encountered this issue while using Firefox on certain websites that include HTML tags in the title. Since Firefox updates the window title based on the website’s title, I faced an issue where the window title would render the HTML code, which I didn’t want to happen.
Is there a way to escape the HTML tags in the title so that they are displayed as raw HTML in the window title, without being interpreted or rendered by the browser?
That definitely is an issue. It would require me to (optionally) scan through each string and escape these tags. I will fix it this weekend, thanks for reporting.
I can make a pr adding an additional function and using it here https://github.com/dhruv8sh/plasma6-window-title-applet/blob/a6eaf5086a473919ed2fffc5d3b8d98237c2dd41/contents/tools/Tools.js#L10-L15
function sub(str){
return str
.replace("%a", escapeHtml(activeTaskItem?.appName??""))
.replace("%w", escapeHtml(activeTaskItem?.title??""))
.replace("%q", escapeHtml(fullActivityInfo?.name??""))
}