feat: visual debug console, Tampermonkey dev scripts, and several bug fixes - #462
Open
KrX3D wants to merge 34 commits into
Open
feat: visual debug console, Tampermonkey dev scripts, and several bug fixes#462KrX3D wants to merge 34 commits into
KrX3D wants to merge 34 commits into
Conversation
Brings in i18n support, language translations, sortSubscriptionsByAlphabet, reloadHomeOnStartup, and other upstream improvements. Preserves debug console feature (config keys and settings entries). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…_browser Sync upstream/main into get_debug_logs_on_browser
Removed unnecessary whitespace and updated comment formatting.
Get debug logs on browser
- Add _deArrowEnqueue / _deArrowRunNext queue (max 5 concurrent) to avoid hammering the DeArrow API when the homepage shows many tiles - Switch to backward index iteration so splice-by-index is safe - Add fallback videoId extraction from onSelectCommand.watchEndpoint - Guard data.titles / data.thumbnails with Array.isArray before .length - Use capturedItem to correctly close over the loop variable in async callbacks Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ting Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New features
In-page visual debug console (
mods/features/visualConsole.js)Adds a toggleable overlay console that captures
console.log/warn/erroroutput directly on the TV screen. Useful for debugging without needing a connected PC.Ykey on desktopTampermonkey dev scripts (
scripts/tampermonkey/)Two userscripts for browser-based development and testing without a TV:
Bug fixes
moreSubtitles— interval never cleared on partial patch failureThe
setIntervalwas always cleared after callingpatchSubtitleMenu(), even if patching didn't actually succeed (isPatchedwas still false). It now only clears whenisPatched === true, so it keeps retrying until the patch takes.sponsorblock— observer attached to detached DOM nodeThe slider element was found via
querySelectorand observed immediately, but it could be a node that is no longer in the document. Added an.isConnectedcheck before proceeding withobserver.observe.resolveCommand— double-patching and no retry on early callpatchResolveCommandcould be called multiple times (e.g. from the init interval), patching the sameresolveCommandinstance repeatedly and wrapping it in nested closures. Added a__ttPatchedflag to skip already-patched instances. Also added asetTimeout(patchResolveCommand, 500)retry for when it is called before_yttvis populated.ui.js— init fires before_yttvis readyThe startup interval only waited for a
<video>element before callingpatchResolveCommand, but_yttvcould still be empty at that point, causing the patch to find nothing and silently do nothing. The check now also requiresObject.keys(window._yttv).length > 0.ui.js— TrustedHTML CSP violation oninnerHTMLThe theme configuration UI was built with
uiContainer.innerHTML = \...`. This triggers TrustedHTML policy violations in strict CSP environments. Replaced with explicitcreateElement/appendChild` calls.Improvements
config.js— deduplicate populate warnings and null guardconfigReadcould emit the sameconsole.warnon every call for a missing key. Added apopulatedConfigWarningsSet so each key is only warned about once. Also added a null guard onlocalConfigin caseJSON.parseproduces a non-object.ui.js— remove redundant event listeners and verbose loggingkeypressandkeyuplisteners were registered in addition tokeydownbut served no purpose. Removed them. Also removed theconsole.info('Key event: ...')log that fired on every keypress.Desktop color key mapping for development
Added
mapDesktopColorKey()which mapsR/G/Y/B,F1–F4, and1–4to the TV remote color key codes (403–406). This makes it possible to test color-button features in a regular browser without a remote.