No updates for disabled extensions, unless you insist.
| @@ -794,6 +794,16 @@ async function showExtensionsDetails() { | ||
| 794 | 794 | }; |
| 795 | 795 | |
| 796 | 796 | /** @type {import('./popup.js').CustomPopupButton} */ |
| 797 | + const updateEnabledOnlyButton = { | |
| 798 | + text: t`Update enabled only`, | |
| 799 | + action: async () => { | |
| 800 | + requiresReload = true; | |
| 801 | + await autoUpdateExtensions(false); | |
| 802 | + await popup.complete(POPUP_RESULT.AFFIRMATIVE); | |
| 803 | + }, | |
| 804 | + }; | |
| 805 | + | |
| 806 | + /** @type {import('./popup.js').CustomPopupButton} */ | |
| 797 | 807 | const sortOrderButton = { |
| 798 | 808 | text: sortByName ? t`Sort: Display Name` : t`Sort: Loading Order`, |
| 799 | 809 | action: async () => { |
| @@ -809,7 +819,7 @@ async function showExtensionsDetails() { | ||
| 809 | 819 | okButton: t`Close`, |
| 810 | 820 | wide: true, |
| 811 | 821 | large: true, |
| 812 | 822 | customButtons: [sortOrderButton, updateEnabledOnlyButton, updateAllButton], |
| 813 | 823 | allowVerticalScrolling: true, |
| 814 | 824 | onClosing: async () => { |
| 815 | 825 | if (waitingForSave) { |
| @@ -1196,7 +1206,7 @@ async function checkForUpdatesManual(sortFn, abortSignal) { | ||
| 1196 | 1206 | } |
| 1197 | 1207 | |
| 1198 | 1208 | /** |
| 1199 | 1209 | * Checks if there are updates available for enabled 3rd-party extensions. |
| 1200 | 1210 | * @param {boolean} force Skip nag check |
| 1201 | 1211 | * @returns {Promise<any>} |
| 1202 | 1212 | */ |
| @@ -1218,6 +1228,11 @@ async function checkForExtensionUpdates(force) { | ||
| 1218 | 1228 | const promises = []; |
| 1219 | 1229 | |
| 1220 | 1230 | for (const [id, manifest] of Object.entries(manifests)) { |
| 1231 | + const isDisabled = extension_settings.disabledExtensions.includes(id); | |
| 1232 | + if (isDisabled) { | |
| 1233 | + console.debug(`Skipping extension: ${manifest.display_name} (${id}) for non-admin user`) | |
| 1234 | + continue; | |
| 1235 | + } | |
| 1221 | 1236 | const isGlobal = getExtensionType(id) === 'global'; |
| 1222 | 1237 | if (isGlobal && !isCurrentUserAdmin) { |
| 1223 | 1238 | console.debug(`Skipping global extension: ${manifest.display_name} (${id}) for non-admin user`); |
| @@ -1247,8 +1262,8 @@ async function checkForExtensionUpdates(force) { | ||
| 1247 | 1262 | } |
| 1248 | 1263 | |
| 1249 | 1264 | /** |
| 1250 | 1265 | * Updates all enabled 3rd-party extensions that have auto-update enabled. |
| 1251 | 1266 | * @param {boolean} forceAll Force update allInclude evendisabled ifand not auto-updating |
| 1252 | 1267 | * @returns {Promise<void>} |
| 1253 | 1268 | */ |
| 1254 | 1269 | async function autoUpdateExtensions(forceAll) { |
| @@ -1260,6 +1275,11 @@ async function autoUpdateExtensions(forceAll) { | ||
| 1260 | 1275 | const isCurrentUserAdmin = isAdmin(); |
| 1261 | 1276 | const promises = []; |
| 1262 | 1277 | for (const [id, manifest] of Object.entries(manifests)) { |
| 1278 | + const isDisabled = extension_settings.disabledExtensions.includes(id); | |
| 1279 | + if (!forceAll && isDisabled) { | |
| 1280 | + console.debug(`Skipping extension: ${manifest.display_name} (${id}) for non-admin user`) | |
| 1281 | + continue; | |
| 1282 | + } | |
| 1263 | 1283 | const isGlobal = getExtensionType(id) === 'global'; |
| 1264 | 1284 | if (isGlobal && !isCurrentUserAdmin) { |
| 1265 | 1285 | console.debug(`Skipping global extension: ${manifest.display_name} (${id}) for non-admin user`); |