Skip to content

Commit 56f705f

Browse files
committed
Use correct cdn when fixing icon url
1 parent 8f7fc8f commit 56f705f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

scripts/appicon.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,16 @@ GetOption( {
4141
return;
4242
}
4343

44-
/** @type {HTMLLinkElement} */
45-
const metaImage = document.querySelector( 'link[rel="image_src"]' );
44+
const applicationConfigElement = document.getElementById( 'application_config' );
4645

47-
if( !metaImage )
46+
if( !applicationConfigElement )
4847
{
4948
return;
5049
}
5150

52-
const url = new URL( metaImage.href );
51+
const applicationConfig = JSON.parse( applicationConfigElement.dataset.config );
5352

54-
icon.src = src.replace( '%CDN_HOST_MEDIA_SSL%', url.host );
53+
icon.src = src.replace( 'https://%CDN_HOST_MEDIA_SSL%/', applicationConfig.MEDIA_CDN_URL );
5554
} );
5655
}
5756
} );

0 commit comments

Comments
 (0)