chore: added debug possibilities

This commit is contained in:
Rick van Lieshout 2025-04-20 13:04:01 +02:00
parent 90d81d2178
commit 4330994b32
3 changed files with 26 additions and 5 deletions

26
.vscode/launch.json vendored
View File

@ -2,15 +2,35 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
// we can use this to debug the main process
"name": "Electron: Main", "name": "Electron: Main",
"type": "node", "type": "node",
"request": "launch", "request": "launch",
"program": "${workspaceFolder}/node_modules/electron/dist/electron", "runtimeExecutable": "${workspaceFolder}/node_modules/electron/dist/electron",
"args": ["."], "args": [
"${workspaceFolder}/ts-dist/main.js",
"--no-sandbox",
"--disable-gpu",
"--disable-software-rasterizer",
"--in-process-gpu",
"--inspect=0.0.0.0:5858",
"--remote-debugging-port=8315"
],
"protocol": "inspector", "protocol": "inspector",
"env": { "env": {
"ELECTRON_DISABLE_SECURITY_WARNINGS": "false" "ELECTRON_DISABLE_SECURITY_WARNINGS": "false"
} },
"outputCapture": "std"
},
// first run, then connect this to make sure we debug the UI
{
"name": "Electron: Renderer",
"type": "chrome",
"request": "attach",
"port": 8315,
"webRoot": "${workspaceFolder}",
"sourceMaps": true,
"skipFiles": ["<node_internals>/**"]
} }
] ]
} }

View File

@ -103,7 +103,7 @@ export class DomTidalController implements TidalController<DomControllerOptions>
globalThis.location.href.includes("/playlist/") || globalThis.location.href.includes("/playlist/") ||
globalThis.location.href.includes("/mix/") globalThis.location.href.includes("/mix/")
) { ) {
if (this.getCurrentlyPlayingStatus() === MediaStatus.playing) { if (this.currentlyPlaying === MediaStatus.playing) {
// find the currently playing element from the list (which might be in an album icon), traverse back up to the mediaItem (row) and select the album cell. // find the currently playing element from the list (which might be in an album icon), traverse back up to the mediaItem (row) and select the album cell.
// document.querySelector("[class^='isPlayingIcon'], [data-test-is-playing='true']").closest('[data-type="mediaItem"]').querySelector('[class^="album"]').textContent // document.querySelector("[class^='isPlayingIcon'], [data-test-is-playing='true']").closest('[data-type="mediaItem"]').querySelector('[class^="album"]').textContent
const row = window.document.querySelector(this.currentlyPlaying).closest(this.mediaItem); const row = window.document.querySelector(this.currentlyPlaying).closest(this.mediaItem);

View File

@ -32,7 +32,8 @@ const PROTOCOL_PREFIX = "tidal";
const windowPreferences = { const windowPreferences = {
sandbox: false, sandbox: false,
plugins: true, plugins: true,
devTools: true, // I like tinkering, others might too devTools: true, // Ensure devTools is enabled for debugging
contextIsolation: false, // Disable context isolation for debugging
}; };
setDefaultFlags(app); setDefaultFlags(app);