Skip to content

Commit bf0f54d

Browse files
committed
fix: preserve page animation behavior in proxy content script
Signed-off-by: kryptocodes <srivatsantb@gmail.com>
1 parent 86f5d91 commit bf0f54d

1 file changed

Lines changed: 2 additions & 13 deletions

File tree

  • images/minimal-vnc-desktop/extensions/proxy

images/minimal-vnc-desktop/extensions/proxy/content.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,18 @@
44
(function() {
55
'use strict';
66

7-
// Two global stylesheet rules, injected at document_start on every document:
7+
// A global cursor rule, injected at document_start on every document:
88
//
99
// 1. cursor:none — this is a touch/kiosk stream; the pointer is a server-side
1010
// software cursor baked into the VNC framebuffer, and unclutter only hides
1111
// it while idle (it reappears over native <select>/date pickers). cursor:none
1212
// on page content makes Chromium report a blank cursor to X, so none is drawn.
1313
//
14-
// 2. Reduce motion — the pod renders on the CPU (SwiftShader, --disable-gpu), so
15-
// a page with many infinite CSS animations (e.g. sms.ndmu.edu.ph login: ~70
16-
// infinite animations) saturates the compositor, dropping the browser to
17-
// ~11fps and flooding the VNC framebuffer with repaints — a laggy stream.
18-
// Collapsing duration to ~0 and forcing one iteration stops the continuous
19-
// repaints (measured 14fps -> 57fps) while STILL reaching each animation's
20-
// end state and firing animationend/transitionend, so entrance animations
21-
// and JS flows that await those events keep working. Effect is cosmetic:
22-
// spinners freeze, fades/slides become instant.
2314
//
2415
// Re-applies on every navigation because the content script runs per document.
2516
try {
2617
const cs = document.createElement('style');
27-
cs.textContent =
28-
'*,*::before,*::after{cursor:none!important}' +
29-
'*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}';
18+
cs.textContent = '*,*::before,*::after{cursor:none!important}';
3019
(document.head || document.documentElement).appendChild(cs);
3120
} catch (_) {}
3221

0 commit comments

Comments
 (0)