Showing with 15 additions and 2 deletions.
  1. +5 −2 jsHelper/spicetifyWrapper.js
  2. +3 −0 spicetify.go
  3. +5 −0 src/cmd/restart.go
  4. +1 −0 src/preprocess/preprocess.go
  5. +1 −0 src/utils/config.go
7 changes: 5 additions & 2 deletions jsHelper/spicetifyWrapper.js
Expand Up @@ -384,7 +384,9 @@ window.Spicetify = {
ReactComponent: {
...Spicetify.ReactComponent,
TextComponent: modules.find(m => m?.h1 && m?.render),
ConfirmDialog: functionModules.find(m => m.toString().includes("isOpen") && m.toString().includes("shouldCloseOnEsc")),
ConfirmDialog: functionModules.find(
m => m.toString().includes("isOpen") && m.toString().includes("shouldCloseOnEsc") && m.toString().includes("onClose")
),
Menu: functionModules.find(m => m.toString().includes("getInitialFocusElement") && m.toString().includes("children")),
MenuItem: functionModules.find(m => m.toString().includes("handleMouseEnter") && m.toString().includes("onClick")),
Slider: wrapProvider(functionModules.find(m => m.toString().includes("onStepBackward"))),
Expand All @@ -407,7 +409,8 @@ window.Spicetify = {
Snackbar: {
wrapper: functionModules.find(m => m.toString().includes("encore-light-theme")),
simpleLayout: functionModules.find(m => m.toString().includes("leading")),
ctaText: functionModules.find(m => m.toString().includes("ctaText"))
ctaText: functionModules.find(m => m.toString().includes("ctaText")),
styledImage: functionModules.find(m => m.toString().includes("placeholderSrc"))
},
...Object.fromEntries(menus)
},
Expand Down
3 changes: 3 additions & 0 deletions spicetify.go
Expand Up @@ -473,6 +473,9 @@ spotify_launch_flags
Separate each flag with "|".
List of valid flags: https://spicetify.app/docs/development/spotify-cli-flags
always_enable_devtools <0 | 1>
Whether Chrome DevTools is enabled when launching/restarting Spotify.
` + utils.Bold("[Preprocesses]") + `
disable_sentry <0 | 1>
Prevents Sentry and Amazon Qualaroo to send console log/error/warning to Spotify developers.
Expand Down
5 changes: 5 additions & 0 deletions src/cmd/restart.go
Expand Up @@ -15,6 +15,11 @@ func EvalSpotifyRestart(start bool, flags ...string) {
flags = append(flags, launchFlag...)
}

enableDevtools := settingSection.Key("always_enable_devtools").MustBool(false)
if enableDevtools {
SetDevTools()
}

switch runtime.GOOS {
case "windows":
isRunning := exec.Command("tasklist", "/FI", "ImageName eq spotify.exe")
Expand Down
1 change: 1 addition & 0 deletions src/preprocess/preprocess.go
Expand Up @@ -45,6 +45,7 @@ func readRemoteCssMap(tag string, cssTranslationMap *map[string]string) error {
err := json.NewDecoder(cssMapResp.Body).Decode(cssTranslationMap)
if err != nil {
utils.PrintWarning("Remote CSS map JSON malformed.")
return err
}
}
return nil
Expand Down
1 change: 1 addition & 0 deletions src/utils/config.go
Expand Up @@ -23,6 +23,7 @@ var (
"overwrite_assets": "0",
"spotify_launch_flags": "",
"check_spicetify_upgrade": "1",
"always_enable_devtools": "0",
},
"Preprocesses": {
"disable_sentry": "1",
Expand Down