Skip to content

Commit

Permalink
#2881 add button to launch the native client via a URI and update the…
Browse files Browse the repository at this point in the history
… x-scheme-handler to not use '+' as this seems to cause problems

git-svn-id: https://xpra.org/svn/Xpra/trunk@27567 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Oct 1, 2020
1 parent 6d3f906 commit 651036d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
20 changes: 18 additions & 2 deletions src/html5/connect.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ <h2 class="form-signin-heading">Xpra HTML5 Client</h2>

<div class="form-group">
<a class="btn btn-lg btn-success" role="button" onclick="doConnect();">Connect</a>
<a class="btn btn-lg btn-success" role="button" onclick="doConnectURI();">Launch Native Client</a>
</div>

<div class="panel-group" role="tablist">
Expand Down Expand Up @@ -309,9 +310,24 @@ <h4 class="panel-title">Advanced options</h4>
}

function doConnect() {
let url = "./index.html" + add_prop("submit", true, true);
let url = "./index.html" + add_prop("submit", true, true) + get_URL_action() + get_URL_props();
window.location = url;
}

window.location = url + get_URL_action() + get_URL_props();
function doConnectURI() {
let url = "xpraws://";
const ssl = document.getElementById("ssl").checked;
if (ssl) {
url = "xprawss://";
}
const username = document.getElementById("username").value;
if (username) {
url += username+"@";
}
url += document.getElementById("server").value;
url += ":"+document.getElementById("port").value+"/";
url += get_URL_action() + get_URL_props();
window.location = url;
}

function get_URL_action() {
Expand Down
2 changes: 1 addition & 1 deletion src/xdg/xpra.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ NoDisplay=true
Type=Application
StartupNotify=false
Categories=Network;RemoteAccess;
MimeType=x-scheme-handler/xpra;x-scheme-handler/xpras;x-scheme-handler/xpra+tls;x-scheme-handler/xpra+ssl;x-scheme-handler/xpra+tcp;x-scheme-handler/xpra+ssh;x-scheme-handler/xpra+ws;x-scheme-handler/xpra+wss;
MimeType=x-scheme-handler/xpra;x-scheme-handler/xpras;x-scheme-handler/xpra+tls;x-scheme-handler/xpratls;x-scheme-handler/xpra+ssl;x-scheme-handler/xprassl;x-scheme-handler/xpra+tcp;x-scheme-handler/xpratcp;x-scheme-handler/xpra+ssh;x-scheme-handler/xprassh;x-scheme-handler/xpra+ws;x-scheme-handler/xpraws;x-scheme-handler/xpra+wss;x-scheme-handler/xprawss;
6 changes: 6 additions & 0 deletions src/xpra/scripts/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1270,11 +1270,17 @@ def ignore(defaults):
"xpra" : "tcp",
"xpras" : "ssl",
"xpra+tcp" : "tcp",
"xpratcp" : "tcp",
"xpra+tls" : "ssl",
"xpratls" : "ssl",
"xpra+ssl" : "ssl",
"xprassl" : "ssl",
"xpra+ssh" : "ssh",
"xprassh" : "ssh",
"xpra+ws" : "ws",
"xpraws" : "ws",
"xpra+wss" : "wss",
"xprawss" : "wss",
}
for prefix, mode in URL_MODES.items():
url = args[1]
Expand Down

0 comments on commit 651036d

Please sign in to comment.