Debugging Spotify Apps in Javascript -- there's gotta be a better way [closed]
Asked Answered
A

2

5

Is there some kind of Spotify Developer Kit that I'm missing on their website? The developer docs suggest that getting tools for Spotify development is "as easy as downloading the Spotify desktop client."

However, in order to run the Spotify API, I need to run my app with Spotify, which means opening it in the Spotify client. It also means that opening it with something like Firefox is impossible. Thus, the only view of my application is the Spotify app view, which provides no debug features or even any compiler level error handling. If I screw up a minor part of the code that still allows the app to run, I get no warnings and no errors. Moreover, I have to restart Spotify every time I make a change to the app.

If I try opening it with a debugger like Firefox, the debugger won't get past the first line of code, because getSpotifyApi(1) makes no sense outside of Spotify. Any suggestions?

Aphanite answered 6/2, 2013 at 15:15 Comment(0)
Q
5

The Spotify application contains the standard Chrome developer inspector and toolset.

To get it, right-click your application and choose "Inspect Element" or choose "Open Inspector" from the "Develop" menu. Please note that this only works on applications that are running locally from your ~/Spotify folder.

Quoit answered 6/2, 2013 at 15:47 Comment(0)
S
2

You can't open the Dev Tools by default in the Spotify desktop app.

To enable the Dev Tools, make sure Spotify is closed, open the file %appdata%\Spotify\prefs, add a new line app.enable-developer-mode=true and make sure to save the file.

After that, you can launch your Spotify app again and open the Dev Tools using Ctrl + Shift + I.

If you are having issues with opening the Dev Tools after closing Spotify, this may be because the app resets this prefs file. This can probably be fixed by only giving read access to the file.

Stilted answered 18/2, 2022 at 17:34 Comment(2)
Has anyone got this to work on macOS? I tried adding app.enable-developer-mode=true in "~/Library/Application Support/Spotify/prefs" but Command + Option + I did nothing :/Examine
Tried to add app.enable-developer-mode=true in ~/Library/Application Support/Spotify/prefs file, and it disappeared, as you said it may do @TaskID, when starting the Application. After repeating the same procedure again, and changing permission for the file to only read access it still did not work with the Command + Option + I shortcut. I'm starting to wonder if this solution may be obsolete? 🤔Prolix

© 2022 - 2024 — McMap. All rights reserved.