File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import TightPNGDecoder from "./decoders/tightpng.js";
31
31
32
32
// How many seconds to wait for a disconnect to finish
33
33
const DISCONNECT_TIMEOUT = 3 ;
34
+ const DEFAULT_BACKGROUND = 'rgb(40, 40, 40)' ;
34
35
35
36
export default class RFB extends EventTargetMixin {
36
37
constructor ( target , url , options ) {
@@ -128,7 +129,7 @@ export default class RFB extends EventTargetMixin {
128
129
this . _screen . style . width = '100%' ;
129
130
this . _screen . style . height = '100%' ;
130
131
this . _screen . style . overflow = 'auto' ;
131
- this . _screen . style . backgroundColor = 'rgb(40, 40, 40)' ;
132
+ this . _screen . style . background = DEFAULT_BACKGROUND ;
132
133
this . _canvas = document . createElement ( 'canvas' ) ;
133
134
this . _canvas . style . margin = 'auto' ;
134
135
// Some browsers add an outline on focus
@@ -302,6 +303,9 @@ export default class RFB extends EventTargetMixin {
302
303
this . _refreshCursor ( ) ;
303
304
}
304
305
306
+ get background ( ) { return this . _screen . style . background ; }
307
+ set background ( cssValue ) { this . _screen . style . background = cssValue ; }
308
+
305
309
// ===== PUBLIC METHODS =====
306
310
307
311
disconnect ( ) {
Original file line number Diff line number Diff line change @@ -58,6 +58,12 @@ protocol stream.
58
58
instead of a zero-sized or fully-transparent cursor if the server
59
59
sets such invisible cursor. Disabled by default.
60
60
61
+ ` background `
62
+ - Is a valid CSS [ background] ( https://developer.mozilla.org/en-US/docs/Web/CSS/background )
63
+ style value indicating which background style should be applied
64
+ to the element containing the remote session screen. The default value is ` rgb(40, 40, 40) `
65
+ (solid gray color).
66
+
61
67
` capabilities ` * Read only*
62
68
- Is an ` Object ` indicating which optional extensions are available
63
69
on the server. Some methods may only be called if the corresponding
You can’t perform that action at this time.
0 commit comments