From 575bf35e7fd76f5983f7c78a01552adc938e355e Mon Sep 17 00:00:00 2001 From: Sophia Atkinson Date: Wed, 25 Jun 2025 17:13:46 -0700 Subject: [PATCH] fix the repeat requests for the same URL --- content.js | 5 ++++- manifest.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/content.js b/content.js index 60a21ba..29fbb97 100644 --- a/content.js +++ b/content.js @@ -44,7 +44,10 @@ async function getNowPlayingData() { const timestampInput = document.querySelector('amp-lcd.lcd.lcd__music')?.shadowRoot ?.querySelector('input#playback-progress[aria-valuenow][aria-valuemax]'); - const defaultArtworkBase64 = await imageUrlToBase64(defaultArtwork); + if (!artworkBase64Cache.defaultArtworkBase64) { + artworkBase64Cache.defaultArtworkBase64 = await imageUrlToBase64(defaultArtwork); + } + const defaultArtworkBase64 = artworkBase64Cache.defaultArtworkBase64; if (!media) { pauseStartTime = null; diff --git a/manifest.json b/manifest.json index 7ff9681..416995a 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "Apple Music Now Playing", - "version": "1.4.1", + "version": "1.4.2", "description": "Easily display your currently playing Apple Music track on your website with this extension.", "permissions": [ "storage",