@@ -306,8 +306,55 @@ window.Spicetify = {
306
306
Platform : { } ,
307
307
} ;
308
308
309
+ ( function waitForPlatform ( ) {
310
+ if ( ! Spicetify . _platform ) {
311
+ setTimeout ( waitForPlatform , 50 ) ;
312
+ return ;
313
+ }
314
+ const { _platform } = Spicetify ;
315
+ for ( const key of Object . keys ( _platform ) ) {
316
+ if ( key . startsWith ( "get" ) && typeof _platform [ key ] === "function" ) {
317
+ Spicetify . Platform [ key . slice ( 3 ) ] = _platform [ key ] ( ) ;
318
+ } else {
319
+ Spicetify . Platform [ key ] = _platform [ key ] ;
320
+ }
321
+ }
322
+ } ) ( ) ;
323
+
324
+ ( function addMissingPlatformAPIs ( ) {
325
+ if ( ! Spicetify . Platform ?. version && ! Spicetify . Platform ?. Registry ) {
326
+ setTimeout ( addMissingPlatformAPIs , 50 ) ;
327
+ return ;
328
+ }
329
+ const version = Spicetify . Platform . version . split ( "." ) . map ( ( i ) => Number . parseInt ( i ) ) ;
330
+ if ( version [ 0 ] === 1 && version [ 1 ] === 2 && version [ 2 ] < 38 ) return ;
331
+
332
+ for ( const [ key , _ ] of Spicetify . Platform . Registry . _map . entries ( ) ) {
333
+ if ( typeof key ?. description !== "string" || ! key ?. description . endsWith ( "API" ) ) continue ;
334
+ const symbolName = key . description ;
335
+ if ( Object . hasOwn ( Spicetify . Platform , symbolName ) ) continue ;
336
+ const resolvedAPI = Spicetify . Platform . Registry . resolve ( key ) ;
337
+ if ( ! resolvedAPI ) {
338
+ console . warn ( `[spicetifyWrapper] Failed to resolve PlatformAPI from Registry: ${ symbolName } ` ) ;
339
+ continue ;
340
+ }
341
+
342
+ Spicetify . Platform [ symbolName ] = resolvedAPI ;
343
+ console . debug ( `[spicetifyWrapper] Resolved PlatformAPI from Registry: ${ symbolName } ` ) ;
344
+ }
345
+ } ) ( ) ;
346
+
309
347
// Based on https://blog.aziz.tn/2025/01/spotify-fix-lagging-issue-on-scrolling.html
310
348
function applyScrollingFix ( ) {
349
+ if ( ! Spicetify . Platform ?. version ) {
350
+ setTimeout ( applyScrollingFix , 50 ) ;
351
+ return ;
352
+ }
353
+
354
+ // Run only for 1.2.56 and lower
355
+ const version = Spicetify . Platform . version . split ( "." ) . map ( ( i ) => Number . parseInt ( i ) ) ;
356
+ if ( version [ 1 ] >= 2 && version [ 2 ] >= 57 ) return ;
357
+
311
358
const scrollableElements = Array . from ( document . querySelectorAll ( "*" ) ) . filter ( ( el ) => {
312
359
if (
313
360
el . id === "context-menu" ||
@@ -351,44 +398,6 @@ window.addEventListener("popstate", () => {
351
398
352
399
applyScrollingFix ( ) ;
353
400
354
- ( function waitForPlatform ( ) {
355
- if ( ! Spicetify . _platform ) {
356
- setTimeout ( waitForPlatform , 50 ) ;
357
- return ;
358
- }
359
- const { _platform } = Spicetify ;
360
- for ( const key of Object . keys ( _platform ) ) {
361
- if ( key . startsWith ( "get" ) && typeof _platform [ key ] === "function" ) {
362
- Spicetify . Platform [ key . slice ( 3 ) ] = _platform [ key ] ( ) ;
363
- } else {
364
- Spicetify . Platform [ key ] = _platform [ key ] ;
365
- }
366
- }
367
- } ) ( ) ;
368
-
369
- ( function addMissingPlatformAPIs ( ) {
370
- if ( ! Spicetify . Platform ?. version && ! Spicetify . Platform ?. Registry ) {
371
- setTimeout ( addMissingPlatformAPIs , 50 ) ;
372
- return ;
373
- }
374
- const version = Spicetify . Platform . version . split ( "." ) . map ( ( i ) => Number . parseInt ( i ) ) ;
375
- if ( version [ 0 ] === 1 && version [ 1 ] === 2 && version [ 2 ] < 38 ) return ;
376
-
377
- for ( const [ key , _ ] of Spicetify . Platform . Registry . _map . entries ( ) ) {
378
- if ( typeof key ?. description !== "string" || ! key ?. description . endsWith ( "API" ) ) continue ;
379
- const symbolName = key . description ;
380
- if ( Object . hasOwn ( Spicetify . Platform , symbolName ) ) continue ;
381
- const resolvedAPI = Spicetify . Platform . Registry . resolve ( key ) ;
382
- if ( ! resolvedAPI ) {
383
- console . warn ( `[spicetifyWrapper] Failed to resolve PlatformAPI from Registry: ${ symbolName } ` ) ;
384
- continue ;
385
- }
386
-
387
- Spicetify . Platform [ symbolName ] = resolvedAPI ;
388
- console . debug ( `[spicetifyWrapper] Resolved PlatformAPI from Registry: ${ symbolName } ` ) ;
389
- }
390
- } ) ( ) ;
391
-
392
401
( async function addProxyCosmos ( ) {
393
402
if ( ! Spicetify . Player . origin ?. _cosmos && ! Spicetify . Platform ?. Registry ) {
394
403
setTimeout ( addProxyCosmos , 50 ) ;
@@ -413,7 +422,7 @@ applyScrollingFix();
413
422
414
423
if ( typeof internalFetch !== "function" || ! allowedMethodsSet . has ( prop ) ) return internalFetch ;
415
424
const version = Spicetify . Platform . version . split ( "." ) . map ( ( i ) => Number . parseInt ( i ) ) ;
416
- if ( version [ 0 ] === 1 && version [ 1 ] == = 2 && version [ 2 ] < 31 ) return internalFetch ;
425
+ if ( version [ 1 ] > = 2 && version [ 2 ] < 31 ) return internalFetch ;
417
426
418
427
return async function ( url , body ) {
419
428
const urlObj = new URL ( url ) ;
@@ -2247,7 +2256,7 @@ Spicetify.Topbar = (() => {
2247
2256
function waitForTopbarMounted ( ) {
2248
2257
const globalHistoryButtons = document . querySelector ( ".main-globalNav-historyButtons" ) ;
2249
2258
leftGeneratedClassName = document . querySelector (
2250
- ".main-topBar-historyButtons .main-topBar-button, .main-globalNav-historyButtons .main-globalNav-icon"
2259
+ ".main-topBar-historyButtons .main-topBar-button, .main-globalNav-historyButtons .main-globalNav-icon, .main-globalNav-historyButtons .e-9640-button-tertiary--condensed "
2251
2260
) ?. className ;
2252
2261
rightGeneratedClassName = document . querySelector (
2253
2262
".main-topBar-container .main-topBar-buddyFeed, .main-actionButtons .main-topBar-buddyFeed, .main-actionButtons .main-globalNav-buddyFeed"
0 commit comments