Skip to content

Commit

Permalink
Prevent using the clipboard when it's disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
JanCVanB committed Dec 27, 2021
1 parent 96b94ea commit 4f0fd25
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions html5/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,8 @@ <h2>Xpra Bug Report</h2>
// disable right click menu:
window.oncontextmenu = function(e) {
client._poll_clipboard(e);
e.preventDefault();
e.stopPropagation();
return false;
}
}
Expand Down
6 changes: 6 additions & 0 deletions html5/js/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1578,6 +1578,9 @@ XpraClient.prototype.do_window_mouse_scroll = function(e, window) {


XpraClient.prototype._poll_clipboard = function(e) {
if (this.clipboard_enabled === false) {
return;
}
//see if the clipboard contents have changed:
if (this.clipboard_pending) {
//we're still waiting to set the clipboard..
Expand Down Expand Up @@ -1619,6 +1622,9 @@ XpraClient.prototype._poll_clipboard = function(e) {
};

XpraClient.prototype.read_clipboard_text = function() {
if (this.clipboard_enabled === false) {
return;
}
const client = this;
client.debug("clipboard", "read_clipboard()");
//warning: this can take a while,
Expand Down

0 comments on commit 4f0fd25

Please sign in to comment.