Skip to content

Commit

Permalink
Merge pull request #357 from CorbinWunderlich/master
Browse files Browse the repository at this point in the history
#356 Add the ability to override the page title with --session-name
  • Loading branch information
totaam authored Jan 21, 2025
2 parents bec4576 + 40dc01a commit e1100bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions html5/js/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ class XpraClient {
init_state() {
// state
this.connected = false;
this.session_name = undefined;
this.desktop_width = 0;
this.desktop_height = 0;
this.server_remote_logging = false;
Expand Down Expand Up @@ -2497,6 +2498,9 @@ class XpraClient {
throw "no common packet encoders, 'rencodeplus' is required by this client";
}

this.session_name = hello["session_name"];
$("title").text(this.session_name);

this.server_display = hello["display"] || "";
this.server_platform = hello["platform"] || "";
this.server_remote_logging = hello["remote-logging.multi-line"];
Expand Down
10 changes: 7 additions & 3 deletions html5/js/Window.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,13 @@ class XpraWindow {
jQuery(this.div).addClass("windowinfocus");

// Update window title
jQuery("title").text(
`${location.pathname.replaceAll("/", "")}: ${this.title}`
);
if (this.client.session_name === undefined) {
jQuery("title").text(
`${location.pathname.replaceAll("/", "")}: ${this.title}`
);
} else {
jQuery("title").text(client.session_name);
}

// Update the icon
if (this.icon !== null) {
Expand Down

0 comments on commit e1100bb

Please sign in to comment.