fix(preload): expose desktop bridge as window.feedBackDesktop (#40)

* fix(preload): expose desktop bridge as window.feedBackDesktop

The core feedback app reads window.feedBackDesktop, but the desktop
preload exposed the bridge as window.slopsmithDesktop. On the desktop
build window.feedBackDesktop was therefore undefined: the DLC-folder
Browse button stayed hidden in both the first-run wizard
(#v3-ob-songdir-browse) and Settings (#btn-pick-dlc), and the rest of the
bridge silently fell back to browser mode.

Finish the rebrand: rename the exposed global slopsmithDesktop ->
feedBackDesktop, plus the internal api object, the renderer +
plugin-manager consumers, the private __feedBackDesktopAudioHooks scratch
namespace, and the comments/migration doc. No compatibility alias — the
ecosystem moves to the new name (TARGET-CURRENT).

Plugins that still read window.slopsmithDesktop are renamed in their own
PRs; nothing ships until the next desktop build bundles them together, so
there is no broken shipped artifact.

Fixes the "Select DLC Songs Folder — No Browse" report (wizard + Settings,
Mac + Windows).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QbexxfTt8q2tAn436MqGWF

* fix(preload): also expose bridge under legacy slopsmithDesktop name

Keep plugins/community code built against the pre-rename bridge working
after the rename. Same isMainFrame gating. See got-feedback/feedBack-desktop#41.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: ChrisBeWithYou <chris@rifflarr.local>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: byrongamatos <xasiklas@gmail.com>
This commit is contained in:
ChrisBeWithYou
2026-06-27 13:16:03 +02:00
committed by GitHub
co-authored by Claude Opus 4.8 ChrisBeWithYou byrongamatos
parent 5188aab938
commit 59e1c1cb0e
5 changed files with 42 additions and 36 deletions
+2 -2
View File
@@ -372,7 +372,7 @@ const rendererWebPreferences: Electron.WebPreferences = {
// a remote iframe can't ride the privileged preload, but the tutorials plugin
// legitimately embeds YouTube. This is safe only because preload.ts now gates
// its IPC bridge to the main frame — an allow-listed embed frame loads with no
// slopsmithDesktop surface. Host-suffix match (exact host or `.`-prefixed
// feedBackDesktop surface. Host-suffix match (exact host or `.`-prefixed
// sub-domain) so `evil-youtube.com` / `youtube.com.evil.com` don't slip past.
const EMBED_ALLOWED_HOSTS = ['youtube.com', 'youtube-nocookie.com'];
function isAllowedEmbedUrl(url: string): boolean {
@@ -1094,7 +1094,7 @@ async function startup(): Promise<void> {
ipcMain.handle(IPC_UPDATE_APPLY, () => updateManager.applyAndRestart());
// Keep the display awake while a song plays (got-feedback/feedback#686). The
// renderer toggles this via window.slopsmithDesktop.power.setScreenAwake on
// renderer toggles this via window.feedBackDesktop.power.setScreenAwake on
// play/pause; the single OS blocker is refcounted across renderers below.
ipcMain.handle(IPC_POWER_SET_SCREEN_AWAKE, (event, keep: unknown) => {
setRendererScreenAwake(event.sender, keep === true);