@krx3d/tizentube2 1.31.750 → 1.31.770
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Builds the bundles and compiles them with the V8 that runs them on the TVs,
|
|
2
|
+
# so a dependency bump or a syntax change that the old engines cannot parse
|
|
3
|
+
# fails here instead of on a TV. Nothing is executed, only compiled, and
|
|
4
|
+
# nothing built here is committed (build-publish-cleanup.yml owns dist/).
|
|
5
|
+
#
|
|
6
|
+
# - dist/service.js and standalone/service/dist/{index,bundle}.js run on the
|
|
7
|
+
# Tizen 5.5 service runtime, Node 4.4.3 (Tizen 6.5 has Node 12, a superset).
|
|
8
|
+
# Checked with real Node 4.4.3.
|
|
9
|
+
# - dist/userScript.js is built for Chrome 47 (mods/rollup.config.js). No Node
|
|
10
|
+
# ships that exact V8 (4.7); Node 5.12 has V8 4.6 (Chrome 46), and with
|
|
11
|
+
# --harmony_rest_parameters it parses what Chrome 47 shipped on top of that.
|
|
12
|
+
#
|
|
13
|
+
# --nolazy makes V8 parse every function body up front, so an error deep in a
|
|
14
|
+
# function fails the check too, not only on its first call. Runtime APIs
|
|
15
|
+
# (e.g. a missing Array.prototype method) are not covered, only syntax.
|
|
16
|
+
name: Runtime syntax check
|
|
17
|
+
|
|
18
|
+
on:
|
|
19
|
+
pull_request:
|
|
20
|
+
branches: [main]
|
|
21
|
+
paths:
|
|
22
|
+
- "mods/**"
|
|
23
|
+
- "service/**"
|
|
24
|
+
- "standalone/service/**"
|
|
25
|
+
- "scripts/runtime-syntax-check/**"
|
|
26
|
+
- ".github/workflows/runtime-syntax-check.yml"
|
|
27
|
+
workflow_dispatch:
|
|
28
|
+
|
|
29
|
+
permissions:
|
|
30
|
+
contents: read
|
|
31
|
+
|
|
32
|
+
env:
|
|
33
|
+
BUILD_NODE_VERSION: '24'
|
|
34
|
+
SERVICE_NODE_VERSION: '4.4.3'
|
|
35
|
+
USERSCRIPT_NODE_VERSION: '5.12.0'
|
|
36
|
+
|
|
37
|
+
jobs:
|
|
38
|
+
syntax:
|
|
39
|
+
runs-on: ubuntu-24.04
|
|
40
|
+
steps:
|
|
41
|
+
- uses: actions/checkout@v6
|
|
42
|
+
|
|
43
|
+
- uses: actions/setup-node@v6
|
|
44
|
+
with:
|
|
45
|
+
node-version: ${{ env.BUILD_NODE_VERSION }}
|
|
46
|
+
|
|
47
|
+
- name: Build userscript
|
|
48
|
+
working-directory: mods
|
|
49
|
+
run: |
|
|
50
|
+
npm ci
|
|
51
|
+
npx rollup -c
|
|
52
|
+
|
|
53
|
+
- name: Build DIAL service
|
|
54
|
+
working-directory: service
|
|
55
|
+
run: |
|
|
56
|
+
npm ci
|
|
57
|
+
npx rollup -c
|
|
58
|
+
|
|
59
|
+
- name: Build standalone service
|
|
60
|
+
working-directory: standalone/service
|
|
61
|
+
run: |
|
|
62
|
+
npm install
|
|
63
|
+
npm run build
|
|
64
|
+
|
|
65
|
+
- name: Download old Node runtimes
|
|
66
|
+
run: |
|
|
67
|
+
for v in "$SERVICE_NODE_VERSION" "$USERSCRIPT_NODE_VERSION"; do
|
|
68
|
+
curl -fsSL "https://nodejs.org/dist/v$v/node-v$v-linux-x64.tar.xz" | tar xJ -C "$RUNNER_TEMP"
|
|
69
|
+
done
|
|
70
|
+
|
|
71
|
+
- name: Service bundles parse on Node 4.4.3 (Tizen 5.5)
|
|
72
|
+
run: |
|
|
73
|
+
"$RUNNER_TEMP/node-v$SERVICE_NODE_VERSION-linux-x64/bin/node" --nolazy \
|
|
74
|
+
scripts/runtime-syntax-check/check-syntax.js --module \
|
|
75
|
+
dist/service.js standalone/service/dist/index.js standalone/service/dist/bundle.js
|
|
76
|
+
|
|
77
|
+
- name: Userscript parses as Chrome 47
|
|
78
|
+
run: |
|
|
79
|
+
"$RUNNER_TEMP/node-v$USERSCRIPT_NODE_VERSION-linux-x64/bin/node" --nolazy --harmony_rest_parameters \
|
|
80
|
+
scripts/runtime-syntax-check/check-syntax.js --script dist/userScript.js
|
package/AGENTS.md
CHANGED
|
@@ -28,8 +28,7 @@ they matter for understanding "what code path am I changing":
|
|
|
28
28
|
2. **Standalone mode (`standalone/`).** A self-contained, separately
|
|
29
29
|
installable Tizen app that doesn't need TizenBrew at all. See
|
|
30
30
|
"Standalone mode" section below — it's non-trivial and has its own
|
|
31
|
-
quirks
|
|
32
|
-
unresolved issues").
|
|
31
|
+
quirks. It is the path in daily use (see "Known issues").
|
|
33
32
|
|
|
34
33
|
Both paths ultimately load the *same* `mods/userScript.js` bundle from the
|
|
35
34
|
npm CDN at runtime — standalone mode does not bundle a copy of the mod
|
|
@@ -90,7 +89,7 @@ standalone/ # standalone installable app — see "Standalone mo
|
|
|
90
89
|
# SyntaxError while Node parses that huge bundle — which can't be
|
|
91
90
|
# caught from inside the bundle itself, since parse errors happen
|
|
92
91
|
# before any of that file's own code runs — is at least catchable
|
|
93
|
-
# and loggable here. See "Known
|
|
92
|
+
# and loggable here. See "Known issues" (history) re: Tizen 5.5.
|
|
94
93
|
build-service.js # ncc-bundles index.js, regex-patches known bundled-dep bugs, Babel-
|
|
95
94
|
# transpiles the bundle for Node 4.4.3, → dist/bundle.js; copies
|
|
96
95
|
# bootstrap.js → dist/index.js unmodified
|
|
@@ -102,19 +101,18 @@ standalone/ # standalone installable app — see "Standalone mo
|
|
|
102
101
|
build-standalone-release.yaml # builds/signs standalone/ into a .wgt via Tizen Studio, GitHub Release
|
|
103
102
|
codeql.yml # security scanning
|
|
104
103
|
i18n-check.yml # PRs: en/de key + placeholder parity, keys used in mods/ must exist
|
|
104
|
+
runtime-syntax-check.yml # PRs: built bundles must parse on Node 4.4.3 (service) / Chrome 47 (userscript)
|
|
105
105
|
claude.yml
|
|
106
106
|
assets/
|
|
107
107
|
profiles.xml # Tizen Studio signing profile for standalone (see Known issues)
|
|
108
108
|
|
|
109
109
|
scripts/tampermonkey/ # local Chrome-based dev/test loader — see README.md
|
|
110
110
|
scripts/i18n-check/ # CI-only en/de translation check (run by i18n-check.yml; also runnable locally)
|
|
111
|
+
scripts/runtime-syntax-check/ # CI-only: compiles built bundles in old V8 (run by runtime-syntax-check.yml)
|
|
111
112
|
scripts/log-receiver/ # PC-side PS1 receiver for logServer.js's remote logging (see Feature map)
|
|
112
113
|
scripts/npm-cleanup/ # local `npm unpublish` of old versions, with a 2FA code — the publish
|
|
113
114
|
# workflow attempts removal too, but npm refuses it from any token it
|
|
114
115
|
# still issues, so this is the only path that works
|
|
115
|
-
scripts/pc-installer/ # PC-side install/update script (SDB from the PC, no on-device installer app
|
|
116
|
-
# needed) — workaround for the Host PC IP 127.0.0.1 conflict with standalone's
|
|
117
|
-
# proxy path; in progress, see AGENTS.md "Known unresolved issues"
|
|
118
116
|
```
|
|
119
117
|
|
|
120
118
|
## Configuration system (`mods/config.js`)
|
|
@@ -156,7 +154,7 @@ scripts/pc-installer/ # PC-side install/update script (SDB from the PC,
|
|
|
156
154
|
| `remoteAccess.js` | Standalone only (`enableRemoteAccess`, `enableRemoteEval`, both off by default and kept across restarts). Tells the service what the settings say — CDP path: `window.__ttRemoteAccess`, drained by `injector.js`'s log poll, which writes the answer back to `window.__ttRemoteInfo`; proxy path: `POST /tizentube/remoteAccess`. The service (`standalone/service/remoteAccess.js`) serves a page on TCP 8098 with a 4-digit PIN kept in `tt-remote-access.json` (bookmarks keep working; *New PIN* replaces it). Its log buffer is fed by `relayLog`, so it holds every service line plus page lines. Page lines are sent while the remote page is open (`window.__ttRemoteViewer`: pushed by the injector poll on change, polled via `GET /tizentube/remoteAccess` on the proxy path; true while `/api/logs` was asked within 10 s), independent of `logServerEnabled`/syslog — `logServer.js` `isRelayActive()`. Lines not meant for the PC receiver are marked `__ttRemoteOnly` and `relayLog` stops them after buffering. JS eval runs via `injector.evaluateInPage` (CDP path only; promises are awaited by polling, 30 s). Ports for firewalls are in README "Network ports". |
|
|
157
155
|
| `homeBarPreview.js` | Standalone only: builds TizenTube's row on the TV home bar (Smart Hub Preview, TVs up to 2021) from the latest unfinished history entry, the latest playlists and the subscriptions page, via the InnerTube client; hands it to the service (POST on the proxy path, `window.__ttHomeBarPreview` drained by the injector's CDP poll otherwise). `openLaunchAction()` opens what a tile asked for (`window.__ttLaunchAction`, set by the injector from index.html's `ttLaunch`). |
|
|
158
156
|
| `subscriptionChannelFilter.js` | Channels hidden only on the Subscriptions page (and the subscriptions part of the home bar row), picked in `mods/ui/subscriptionChannelsSettings.js` from the channel list (browse `FEchannels`) plus the uploaders of feed videos. Feed tiles carry no channel id and often show an artist or "X und 2 weitere", so each video's uploader is looked up once via oEmbed (`author_name`) and cached in localStorage `ytaf-video-uploaders`; applied through `channelHider.js`'s `filterHiddenChannels` when the page is `subscriptions`. |
|
|
159
|
-
| `internalsCheck.js` | Startup check (`enableInternalsCheck`, default on): once `resolveCommand` exists plus 10s, looks up every icon name TizenTube uses (its own `ICONS` list) in the app's icon registry (the big string-valued `Map` on `_yttv`) and the internals other modules find by string (`resolveCommand`, InnerTube `mappings`, `_yttv` `JSON.parse`, `ENABLE_PREVIEWS_WITH_SOUND`, `this.actionName`);
|
|
157
|
+
| `internalsCheck.js` | Startup check (`enableInternalsCheck`, default on): once `resolveCommand` exists plus 10s, looks up every icon name TizenTube uses (its own `ICONS` list) in the app's icon registry (the big string-valued `Map` on `_yttv`) and the internals other modules find by string (`resolveCommand`, InnerTube `mappings`, `_yttv` `JSON.parse`, `ENABLE_PREVIEWS_WITH_SOUND`, `this.actionName`); once the first video plays (not when the `<video>` element appears, which YouTube TV has from start), the player container `customUI.js` patches and its button groups. Shows one toast per phase listing missing names, silent otherwise; logs under `internals.`. **Add new icon names to `ICONS` when you use them**, or they go unchecked. |
|
|
160
158
|
| `injectorAlive.js` | CDP path only: `checkInjector()` waits for a fresh `window.__ttInjectorSeenAt` stamp (set by `injector.js`'s log poll every 2 s) and answers alive/gone/unknown. `resumeAfterSuspend.js` skips its wake reload when the injector is gone (a reload would bring back YouTube without the mod) and asks the user to reopen TizenTube. 'unknown' (proxy path, or a service older than the stamp) keeps the old behaviour. When the injected session's CDP connection drops, `injector.js` `reattach()` reconnects to the same debug port every 3 s (no relaunch), skips contexts that already carry the mod (`window.__ttStandalone`), and injects new ones; the page waits up to 15 s for that before giving up. Also logs once whether the page can use `tizen.application` (`standalone.pageApis`). If the injector is still gone, `requestServiceRestart()` starts the service with app-control data `ttReattach` (only possible where the page has `tizen.application`); `standalone/service/index.js` `onRequest` then calls `injector.reattachSaved()`, which reconnects to the debug port saved in `tt-debug-port.json` at each debug launch. The reopen toast is the last fallback. |
|
|
161
159
|
| `visualConsole.js` | On-screen debug console (`enableDebugConsole`) — shows version via `../../package.json`, executes commands via `resolveCommand`. |
|
|
162
160
|
|
|
@@ -242,13 +240,24 @@ build step builds top-level `service/` first because
|
|
|
242
240
|
`standalone/config.xml` before packaging), or by a `v*.*.*` tag push, or
|
|
243
241
|
manually. Builds `mods/`, `service/`, and `standalone/service/`, then
|
|
244
242
|
signs `standalone/` into a `.wgt` using **Tizen Studio's own CLI**
|
|
245
|
-
(`tizen build-web` + `tizen package`, via `.github/assets/profiles.xml`)
|
|
246
|
-
|
|
243
|
+
(`tizen build-web` + `tizen package`, via `.github/assets/profiles.xml`).
|
|
244
|
+
Signing works since 2026-08-02; see "Known issues" for the `-legacy`
|
|
245
|
+
and one-cert-per-app lessons.
|
|
247
246
|
- **`i18n-check.yml`** — on PRs touching `mods/`: runs
|
|
248
247
|
`scripts/i18n-check/check-i18n.cjs`, which fails on en/de key or placeholder
|
|
249
248
|
mismatches and on `t('key')` calls whose key is in neither file. Only en and
|
|
250
249
|
de are checked. Locally: `node scripts/i18n-check/check-i18n.cjs --en
|
|
251
250
|
mods/translations/resources/en.json --de mods/translations/resources/de.json --src mods`
|
|
251
|
+
- **`runtime-syntax-check.yml`** — on PRs touching `mods/`, `service/` or
|
|
252
|
+
`standalone/service/`: builds all three bundles, then compiles (never runs)
|
|
253
|
+
them with `scripts/runtime-syntax-check/check-syntax.js` under old Node
|
|
254
|
+
binaries from nodejs.org: Node 4.4.3 for `dist/service.js` and
|
|
255
|
+
`standalone/service/dist/*` (Tizen 5.5's service runtime), Node 5.12 with
|
|
256
|
+
`--harmony_rest_parameters` (≈ Chrome 47's V8) for `dist/userScript.js`.
|
|
257
|
+
`--nolazy` so errors inside function bodies count too. Syntax only — a
|
|
258
|
+
missing runtime API is not caught. A failure prints the line, column and a
|
|
259
|
+
snippet of the bundle; fix it in the Babel config or the dependency, not by
|
|
260
|
+
editing `dist/`.
|
|
252
261
|
- **`codeql.yml`** — security scanning on PRs; check its findings before
|
|
253
262
|
merging anything touching `standalone/service/` (the proxy) or auth-ish
|
|
254
263
|
code — false positives happen (e.g. SSRF flags on the proxy's
|
|
@@ -264,7 +273,23 @@ cd standalone/service && npm install && npm run build # builds dist/index.js
|
|
|
264
273
|
Revert `dist/*` afterward if you're not intentionally changing it —
|
|
265
274
|
CI owns that file's committed state.
|
|
266
275
|
|
|
267
|
-
## Known
|
|
276
|
+
## Known issues
|
|
277
|
+
|
|
278
|
+
What is still open (as of 2026-11-19):
|
|
279
|
+
|
|
280
|
+
- **Proxy path: YouTube can stop playback.** With Host PC IP set to
|
|
281
|
+
anything other than `127.0.0.1`, standalone uses the local proxy, and
|
|
282
|
+
YouTube can answer the proxied traffic with a verification QR code that
|
|
283
|
+
stops video playback. Not fixable on our side; upstream added the CDP
|
|
284
|
+
injector to avoid it. Details in "Not resolved — reframed" below.
|
|
285
|
+
- **Host PC IP must stay `127.0.0.1`** for the CDP path and for
|
|
286
|
+
TizenBrew/TizenBrewInstaller, so `sdb` from a PC cannot connect to the
|
|
287
|
+
TVs.
|
|
288
|
+
- **Q-Symphony 5.1 audio** is a deferred feature, see the end of this
|
|
289
|
+
section.
|
|
290
|
+
|
|
291
|
+
Everything else in this section is history. Do not reopen it without a
|
|
292
|
+
new on-device log.
|
|
268
293
|
|
|
269
294
|
> **Read this first (2026-10-03).** Standalone mode is the path the user
|
|
270
295
|
> actually runs: the standalone `.wgt` is installed and in daily use on
|
|
@@ -407,11 +432,10 @@ Originally reported 2026-08-02 after the install issue above was fixed:
|
|
|
407
432
|
zero logs, whether `safeRequire`'s per-require logging finally shows
|
|
408
433
|
which one fails there.
|
|
409
434
|
|
|
410
|
-
Also found
|
|
411
|
-
not a function`
|
|
412
|
-
runner)
|
|
413
|
-
|
|
414
|
-
handler and upstream still works; and one `Cannot find context with
|
|
435
|
+
Also found at the time: `app.onRequest is
|
|
436
|
+
not a function` fired repeatedly every launch (from Tizen's own service
|
|
437
|
+
runner). Since fixed: `standalone/service/index.js` now exports
|
|
438
|
+
`onRequest` (also used for the `ttReattach` service restart); and one `Cannot find context with
|
|
415
439
|
specified id` from the CDP injector, a normal context-invalidation race
|
|
416
440
|
that seems to resolve itself once a fresh execution context appears.
|
|
417
441
|
Neither is proven unrelated to the retry-need — worth re-reading the
|
|
@@ -768,9 +792,11 @@ Originally reported 2026-08-02 after the install issue above was fixed:
|
|
|
768
792
|
mode (breaks *already-working* video playback, not just launch) that
|
|
769
793
|
the CDP path doesn't have at all.
|
|
770
794
|
|
|
771
|
-
**Net effect: neither path
|
|
772
|
-
connection-unreliable (this session's whole
|
|
773
|
-
genuine fixes landed, not fully solved).
|
|
795
|
+
**Net effect at the time (2026-08-03): neither path was simply "the
|
|
796
|
+
answer."** CDP was connection-unreliable (this session's whole
|
|
797
|
+
investigation, several genuine fixes landed, not fully solved). Since
|
|
798
|
+
2026-10-03 the CDP path's "works once" failure no longer reproduces —
|
|
799
|
+
see the top of this section. Proxy connects reliably but
|
|
774
800
|
can silently stop video playback via YouTube's own bot detection,
|
|
775
801
|
which isn't something fixable by patching our own code — it's why
|
|
776
802
|
upstream moved away from it. README.md now documents both failure
|
|
@@ -787,10 +813,8 @@ Originally reported 2026-08-02 after the install issue above was fixed:
|
|
|
787
813
|
SDB-based mechanisms (TizenBrewInstaller needs it to install/update
|
|
788
814
|
packages) — so a TV configured for standalone's proxy path can't use
|
|
789
815
|
those without switching Host PC IP back and forth. A PC-side
|
|
790
|
-
installer script (`scripts/pc-installer
|
|
791
|
-
|
|
792
|
-
installs work the same over network as USB and don't need
|
|
793
|
-
`127.0.0.1` — see that script's own docs. TizenBrew's own CDP
|
|
816
|
+
installer script (`scripts/pc-installer/`) was started as a workaround
|
|
817
|
+
for the install/update case but is not committed to this repo. TizenBrew's own CDP
|
|
794
818
|
injection has no equivalent workaround; whether it needs one is a
|
|
795
819
|
separate, cross-repo question, not resolved here.
|
|
796
820
|
|
|
@@ -823,7 +847,7 @@ isTypeSupported`/`canPlayType` for AC-3/E-AC-3/AC-4, careful never to claim
|
|
|
823
847
|
a codec the platform doesn't actually support), a settings toggle with 3
|
|
824
848
|
UA profiles, and a diagnostics panel (~600 lines total). Not yet ported —
|
|
825
849
|
deferred. Of its two reasons the first is now gone: standalone mode runs and
|
|
826
|
-
is in daily use (see the top of "Known
|
|
850
|
+
is in daily use (see the top of "Known issues"), so it can be
|
|
827
851
|
tested. Still open is that the user's hardware is an unconfirmed fit (has
|
|
828
852
|
a Samsung soundbar, not confirmed Q-Symphony-compatible). Ask before
|
|
829
853
|
implementing if this comes back up.
|
package/README.md
CHANGED
|
@@ -22,8 +22,8 @@ TizenTube can also run as its own installable Tizen app, without needing TizenBr
|
|
|
22
22
|
- Once built, install the `.wgt` the same way you'd install any other Tizen app (e.g. via [TizenBrewInstaller](https://github.com/KrX3D/TizenBrewInstaller)'s "Install from GitHub"/"Select file to install", or sideloaded directly).
|
|
23
23
|
- The standalone app always loads TizenTube from `https://cdn.jsdelivr.net/npm/@krx3d/tizentube2/dist/userScript.js`, so it stays in sync with whatever this repo last published to npm — no separate rebuild needed when only the mod itself changes.
|
|
24
24
|
- Its version is kept in lockstep with the userscript: once the build workflow above has the required secrets, it builds automatically right after every successful npm publish (triggered by `build-publish-cleanup.yml` completing), reading the just-bumped `package.json` version and writing it into `standalone/config.xml` before packaging — so "installed version" always matches the userscript version, no matter which of the two you're running.
|
|
25
|
-
- **The TV's Developer Mode "Host PC IP" setting picks between standalone's two internal paths
|
|
26
|
-
- `127.0.0.1`/localhost → the CDP/SDB-based injection path (`standalone/service/injector.js`, connects to the real `youtube.com` directly).
|
|
25
|
+
- **The TV's Developer Mode "Host PC IP" setting picks between standalone's two internal paths. Use `127.0.0.1`.**
|
|
26
|
+
- `127.0.0.1`/localhost → the CDP/SDB-based injection path (`standalone/service/injector.js`, connects to the real `youtube.com` directly). In daily use on Tizen 5.5 and 6.5 since 2026-10-03. Its earlier problem (works once, then fails until the app's cache is cleared) no longer reproduces; the investigation is in `AGENTS.md` "Known issues".
|
|
27
27
|
- Anything else (a real PC IP, or unset) → the local-proxy path (`standalone/service/index.js`, rewrites and proxies YouTube's traffic through `localhost:8099`). Connects reliably, but carries a real, confirmed-on-device risk: YouTube's own servers can detect the proxied traffic pattern as suspicious and throw up a verification challenge that stops video playback entirely — sometimes not immediately, but after the app's already been working for a while. This is *not* a bug we can straightforwardly fix: it's why upstream added the CDP injector in the first place (commit `c497c059`, "Since fixing #555 and #561 would be starting a cat and mouse game between me and YT, I think it's better to do it the old way") rather than continuing to patch the proxy path directly.
|
|
28
28
|
- This also has a practical side effect: `127.0.0.1` is the *same* setting TizenBrew and TizenBrewInstaller need for their own local SDB-based mechanisms (module injection, package installs), so a TV configured for standalone's proxy path can't use those without switching back and forth.
|
|
29
29
|
|