Skip to content

fix: YouTube bot-check bypass via authenticated embeds and sign-in flow#345

Merged
koala73 merged 1 commit into
mainfrom
fix/defer-map-youtube-loading
Feb 24, 2026
Merged

fix: YouTube bot-check bypass via authenticated embeds and sign-in flow#345
koala73 merged 1 commit into
mainfrom
fix/defer-map-youtube-loading

Conversation

@koala73

@koala73 koala73 commented Feb 24, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #287 — UI freezing and cursor lag during initial load caused by MapLibre WebGL init, YouTube iframe API, and 15-20 concurrent API fetches all competing on the main thread simultaneously.

Performance

  • Defer YouTube player initLiveNewsPanel no longer loads the YouTube iframe API during createPanels(). Uses IntersectionObserver + requestIdleCallback gate to wait until the panel is visible AND the browser is idle. Shows a lightweight clickable placeholder until then.
  • Stagger data loads into 3 tiersloadAllData() now uses lazy task execution:
    • Tier 1 (news, markets, pizzint, intelligence): fires immediately
    • Tier 2 (predictions, fred, oil, spending, firms): yields one requestAnimationFrame frame first
    • Tier 3 (natural, weather, ais, cables, flights, cyber, techEvents): fire-and-forget via requestIdleCallback
  • Defer supercluster rebuilds — moved from DeckGLMap constructor into map load callback

Bug Fixes

  • Suppress notification sound when alerts disabledIntelligenceGapBadge.playSound() now gated on popupEnabled toggle
  • Bot-check detection — detects YouTube "Sign in to confirm you're not a bot" and offers sign-in/retry/open-on-YouTube options
  • Lifecycle safety — tier-3 deferred callbacks tracked and cancelled on App.destroy()
  • Safe DOM construction — all new UI paths use createElement/textContent (no innerHTML with user data)

Version

  • Bumped to 2.5.7

Test plan

  • Page loads — map renders with all layers
  • Scroll to LiveNewsPanel → YouTube player initializes and starts playing
  • Click placeholder "Load Player" → immediate init
  • Channel switch before auto-init → correct channel loads
  • All data panels populate (news/markets first, then others staggered)
  • Toggle "Pop up new alerts" OFF → no sound on new findings
  • Toggle "Pop up new alerts" ON → sound plays on new findings
  • No new console errors
  • tsc --noEmit — zero errors
  • npm run build:full — succeeds

…g time (#287)

- Defer YouTube player init via IntersectionObserver + requestIdleCallback
  gate with clickable placeholder (no eager iframe_api load)
- Stagger loadAllData() into 3 priority tiers: critical (immediate),
  important (after rAF yield), deferred (requestIdleCallback fire-and-forget)
- Move DeckGL supercluster rebuilds into map 'load' callback
- Cancel deferred tier-3 callbacks on App destroy (prevents post-teardown work)
- Add bot-check detection with YouTube sign-in window for desktop (Tauri)
- Safe DOM construction for all new UI paths (no innerHTML with user data)
@koala73 koala73 changed the title perf: defer YouTube/map init and stagger data loads (#287) fix: YouTube bot-check bypass via authenticated embeds and sign-in flow Feb 24, 2026
@koala73
koala73 merged commit d1ea374 into main Feb 24, 2026
5 checks passed
@vercel

vercel Bot commented Feb 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
worldmonitor Ready Ready Preview, Comment Feb 25, 2026 0:09am
worldmonitor-finance Ready Ready Preview, Comment Feb 25, 2026 0:09am
worldmonitor-happy Ready Ready Preview, Comment Feb 25, 2026 0:09am
worldmonitor-startup Ready Ready Preview, Comment Feb 25, 2026 0:09am

Request Review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

andreteow pushed a commit to andreteow/worldmonitor-a47 that referenced this pull request Feb 25, 2026
…g time (koala73#287) (koala73#345)

- Defer YouTube player init via IntersectionObserver + requestIdleCallback
  gate with clickable placeholder (no eager iframe_api load)
- Stagger loadAllData() into 3 priority tiers: critical (immediate),
  important (after rAF yield), deferred (requestIdleCallback fire-and-forget)
- Move DeckGL supercluster rebuilds into map 'load' callback
- Cancel deferred tier-3 callbacks on App destroy (prevents post-teardown work)
- Add bot-check detection with YouTube sign-in window for desktop (Tauri)
- Safe DOM construction for all new UI paths (no innerHTML with user data)
facusturla pushed a commit to facusturla/worldmonitor that referenced this pull request Feb 27, 2026
…g time (koala73#287) (koala73#345)

- Defer YouTube player init via IntersectionObserver + requestIdleCallback
  gate with clickable placeholder (no eager iframe_api load)
- Stagger loadAllData() into 3 priority tiers: critical (immediate),
  important (after rAF yield), deferred (requestIdleCallback fire-and-forget)
- Move DeckGL supercluster rebuilds into map 'load' callback
- Cancel deferred tier-3 callbacks on App destroy (prevents post-teardown work)
- Add bot-check detection with YouTube sign-in window for desktop (Tauri)
- Safe DOM construction for all new UI paths (no innerHTML with user data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lagging with simultaneously loading of map and youtube live

1 participant