Skip to content

Commit 5739604

Browse files
committed
1 parent df4cfe1 commit 5739604

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

chatgpt/autoclear-chatgpt-history/autoclear-chatgpt-history.user.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225
// @description:zu Ziba itshala lokucabanga okuzoshintshwa ngokuzenzakalelayo uma ukubuka chatgpt.com
226226
// @author Adam Lui
227227
// @namespace https://github.com/adamlui
228-
// @version 2025.1.30
228+
// @version 2025.1.30.1
229229
// @license MIT
230230
// @icon https://assets.autoclearchatgpt.com/images/icons/openai/black/icon48.png?v=f461c06
231231
// @icon64 https://assets.autoclearchatgpt.com/images/icons/openai/black/icon64.png?v=f461c06
@@ -876,9 +876,19 @@
876876
},
877877

878878
update: {
879-
navicon() {
880-
toggles.sidebar.navicon.src = `${app.urls.assetHost}/images/icons/incognito/${
881-
env.ui.scheme == 'dark' ? 'white' : 'black' }/icon32.png?v=${app.latestResourceCommitHash}`
879+
880+
navicon({ preload = false } = {}) {
881+
const baseURL = `${app.urls.assetHost}/images/icons/incognito`,
882+
schemeMap = { light: 'black', dark: 'white' },
883+
fileName = 'icon32.png'
884+
885+
if (preload)
886+
Object.keys(schemeMap).forEach(scheme =>
887+
new Image().src = `${baseURL}/${schemeMap[scheme]}/${fileName}?v=`
888+
+ app.latestResourceCommitHash
889+
)
890+
else toggles.sidebar.navicon.src = baseURL
891+
+ `/${schemeMap[env.ui.scheme]}/${fileName}?v=${app.latestResourceCommitHash}`
882892
},
883893

884894
scheme() { // to match UI scheme
@@ -900,7 +910,6 @@
900910
toggles.sidebar.toggleInput.checked ? 13 : 0 }px)`
901911
}, 1) // min delay to trigger 1st transition fx
902912
}
903-
904913
}
905914
}
906915
}
@@ -931,6 +940,7 @@
931940
// Run MAIN routine
932941

933942
menu.register() // create browser toolbar menu
943+
toggles.sidebar.update.navicon({ preload: true }) // preload sidebar NAVICON variants
934944

935945
// Init UI props
936946
await Promise.race([chatgpt.isLoaded(), new Promise(resolve => setTimeout(resolve, 5000))]) // initial UI loaded

0 commit comments

Comments
 (0)