# Desktop test (Chrome)

Test the mod logic before publishing to the TV. Publishing is slow; the console is fast.

## 1. Load the site + inject

1. Open `https://streamingcommunityz.tech` in Chrome.
2. Open DevTools console.
3. Paste the entire contents of `../index.js` and press Enter.
4. You should see `SCZ TV: popup blocker active` then `SCZ TV: init complete, N focusable`.

## 2. Simulate the remote

The TV remote sends `keydown` events with these keyCodes. Simulate them:

```js
function key(code){ document.dispatchEvent(new KeyboardEvent('keydown',{keyCode:code, which:code})); }
key(40); // down
key(39); // right
key(38); // up
key(37); // left
key(13); // OK / Enter -> clicks focused element
key(10009); // Samsung BACK
```

Watch the green focus highlight move between cards. `key(13)` should open the focused title.

## 3. Verify popup blocking

- `window.open('https://example.com')` should return `null` (overridden).
- Navigate to a title → `Riproduci` → watch page. The player iframe should have **no** `sandbox`
  attribute (vix needs to run unsandboxed):
  ```js
  document.querySelector('iframe').getAttribute('sandbox'); // -> null
  ```
- Press play. The popunder ad should NOT open: the overlay click-catcher above the player is
  removed by `killPlayerOverlays()`. The video should start.
- If a popunder still slips through, inspect what sits over the player center and widen the
  match in `killPlayerOverlays()`:
  ```js
  document.elementsFromPoint(innerWidth/2, innerHeight/2).slice(0,5)
    .map(function(e){return e.tagName+'.'+e.className;});
  ```

## Notes

- Desktop Chrome is far newer than the TV's Chromium 47. Code that works on desktop may still
  break on TV if it uses ES6+. Keep `index.js` ES5.
- The cross-origin `vixcloud` `<video>` is not reachable from the console either — same limit as
  on the TV.
