|
4 | 4 | (function() { |
5 | 5 | 'use strict'; |
6 | 6 |
|
7 | | - // Hide the mouse cursor everywhere. This is a touch/kiosk stream: the pointer |
8 | | - // is a server-side software cursor baked into the VNC framebuffer, and |
9 | | - // unclutter only hides it while idle — it reappears over native popups |
10 | | - // (<select>, date pickers). Setting cursor:none on page content makes |
11 | | - // Chromium report a blank cursor to X, so nothing is drawn. Re-applies on |
12 | | - // every navigation because the content script runs per document. |
| 7 | + // A global cursor rule, injected at document_start on every document: |
| 8 | + // |
| 9 | + // 1. cursor:none — this is a touch/kiosk stream; the pointer is a server-side |
| 10 | + // software cursor baked into the VNC framebuffer, and unclutter only hides |
| 11 | + // it while idle (it reappears over native <select>/date pickers). cursor:none |
| 12 | + // on page content makes Chromium report a blank cursor to X, so none is drawn. |
| 13 | + // |
| 14 | + // |
| 15 | + // Re-applies on every navigation because the content script runs per document. |
13 | 16 | try { |
14 | 17 | const cs = document.createElement('style'); |
15 | 18 | cs.textContent = '*,*::before,*::after{cursor:none!important}'; |
16 | 19 | (document.head || document.documentElement).appendChild(cs); |
17 | 20 | } catch (_) {} |
18 | 21 |
|
19 | | - // Inject the page-level script |
20 | | - const script = document.createElement('script'); |
21 | | - script.src = chrome.runtime.getURL('injected.js'); |
22 | | - script.onload = function() { |
23 | | - this.remove(); |
24 | | - }; |
25 | | - (document.head || document.documentElement).appendChild(script); |
| 22 | + // injected.js runs as a MAIN-world content script (see manifest) so its |
| 23 | + // stealth patches install synchronously at document_start, before any page |
| 24 | + // script. |
26 | 25 |
|
27 | 26 | // ---- JS dialog bridge (isolated world half) ------------------------------- |
28 | 27 | // injected.js overrides alert/confirm/prompt in the PAGE world so Chromium never |
|
0 commit comments