diff --git a/jsHelper/spicetifyWrapper.js b/jsHelper/spicetifyWrapper.js index 460ae11dc9..83f0ab97cf 100644 --- a/jsHelper/spicetifyWrapper.js +++ b/jsHelper/spicetifyWrapper.js @@ -1,7 +1,4 @@ window.Spicetify = { - get CosmosAsync() { - return Spicetify.Player.origin?._cosmos; - }, Player: { addEventListener: (type, callback) => { if (!(type in Spicetify.Player.eventListeners)) { @@ -390,6 +387,11 @@ window.Spicetify = { }; Spicetify.Player.origin._cosmos = new Proxy(Spicetify.Player.origin._cosmos, handler); + Object.defineProperty(Spicetify, "CosmosAsync", { + get: () => { + return Spicetify.Player.origin?._cosmos; + } + }); })(); (function waitForPlatform() { diff --git a/src/preprocess/preprocess.go b/src/preprocess/preprocess.go index b9b2d6dee8..6e49e9f2d6 100644 --- a/src/preprocess/preprocess.go +++ b/src/preprocess/preprocess.go @@ -324,10 +324,10 @@ func disableLogging(input string) string { return fmt.Sprintf("%sreturn;", submatches[0]) }) utils.Replace(&input, `key:"logInteraction",value:function\([\w,]+\)\{`, func(submatches ...string) string { - return fmt.Sprintf("%sreturn{interactionId:null,pageInstanceId:null};", submatches[0]) + return fmt.Sprintf("%sreturn {interactionId:null,pageInstanceId:null};", submatches[0]) }) utils.Replace(&input, `key:"logNonAuthInteraction",value:function\([\w,]+\)\{`, func(submatches ...string) string { - return fmt.Sprintf("%sreturn{interactionId:null,pageInstanceId:null};", submatches[0]) + return fmt.Sprintf("%sreturn {interactionId:null,pageInstanceId:null};", submatches[0]) }) utils.Replace(&input, `key:"logImpression",value:function\([\w,]+\)\{`, func(submatches ...string) string { return fmt.Sprintf("%sreturn;", submatches[0]) @@ -354,11 +354,14 @@ func disableLogging(input string) string { return fmt.Sprintf("%s{return;}%s", submatches[1], submatches[2]) }) utils.Replace(&input, `key:"lastFlush",value:function\(\)\{`, func(submatches ...string) string { - return fmt.Sprintf("%sreturn;", submatches[0]) + return fmt.Sprintf("%sreturn Promise.resolve({fired:true});", submatches[0]) }) utils.Replace(&input, `key:"addItemInEventsStorage",value:function\([^)]*\)\s*\{`, func(submatches ...string) string { return fmt.Sprintf("%sreturn;", submatches[0]) }) + utils.Replace(&input, `key:"createLoggingParams",value:function\([^)]*\)\s*\{`, func(submatches ...string) string { + return fmt.Sprintf("%sreturn {interactionIds:null,pageInstanceIds:null};", submatches[0]) + }) utils.Replace(&input, `registerEventListeners\([^)]*\)\s*\{`, func(submatches ...string) string { return fmt.Sprintf("%sreturn;", submatches[0]) @@ -385,11 +388,14 @@ func disableLogging(input string) string { return fmt.Sprintf("%sreturn;", submatches[0]) }) utils.Replace(&input, `lastFlush\([^)]*\)\s*\{`, func(submatches ...string) string { - return fmt.Sprintf("%sreturn;", submatches[0]) + return fmt.Sprintf("%sreturn Promise.resolve({fired:true});", submatches[0]) }) utils.Replace(&input, `addItemInEventsStorage\([^)]*\)\s*\{`, func(submatches ...string) string { return fmt.Sprintf("%sreturn;", submatches[0]) }) + utils.Replace(&input, `createLoggingParams\([^)]*\)\s*\{`, func(submatches ...string) string { + return fmt.Sprintf("%sreturn {interactionIds:null,pageInstanceIds:null};", submatches[0]) + }) return input }