No updates for disabled extensions, unless you insist.

976d4f39e6452f2c1f26575eb0fdf2fb872504d5

Gness Erquint <gness.na@gmail.com>

1 files changed, +24 -4Ignore whitespace
public/scripts/extensions.js+24 -4
@@ -794,6 +794,16 @@ async function showExtensionsDetails() {
794 };794 };
795795
796 /** @type {import('./popup.js').CustomPopupButton} */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 const sortOrderButton = {807 const sortOrderButton = {
798 text: sortByName ? t`Sort: Display Name` : t`Sort: Loading Order`,808 text: sortByName ? t`Sort: Display Name` : t`Sort: Loading Order`,
799 action: async () => {809 action: async () => {
@@ -809,7 +819,7 @@ async function showExtensionsDetails() {
809 okButton: t`Close`,819 okButton: t`Close`,
810 wide: true,820 wide: true,
811 large: true,821 large: true,
812 customButtons: [sortOrderButton, updateAllButton],822 customButtons: [sortOrderButton, updateEnabledOnlyButton, updateAllButton],
813 allowVerticalScrolling: true,823 allowVerticalScrolling: true,
814 onClosing: async () => {824 onClosing: async () => {
815 if (waitingForSave) {825 if (waitingForSave) {
@@ -1196,7 +1206,7 @@ async function checkForUpdatesManual(sortFn, abortSignal) {
1196}1206}
11971207
1198/**1208/**
1199 * Checks if there are updates available for 3rd-party extensions.1209 * Checks if there are updates available for enabled 3rd-party extensions.
1200 * @param {boolean} force Skip nag check1210 * @param {boolean} force Skip nag check
1201 * @returns {Promise<any>}1211 * @returns {Promise<any>}
1202 */1212 */
@@ -1218,6 +1228,11 @@ async function checkForExtensionUpdates(force) {
1218 const promises = [];1228 const promises = [];
12191229
1220 for (const [id, manifest] of Object.entries(manifests)) {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 const isGlobal = getExtensionType(id) === 'global';1236 const isGlobal = getExtensionType(id) === 'global';
1222 if (isGlobal && !isCurrentUserAdmin) {1237 if (isGlobal && !isCurrentUserAdmin) {
1223 console.debug(`Skipping global extension: ${manifest.display_name} (${id}) for non-admin user`);1238 console.debug(`Skipping global extension: ${manifest.display_name} (${id}) for non-admin user`);
@@ -1247,8 +1262,8 @@ async function checkForExtensionUpdates(force) {
1247}1262}
12481263
1249/**1264/**
1250 * Updates all 3rd-party extensions that have auto-update enabled.1265 * Updates all enabled 3rd-party extensions that have auto-update enabled.
1251 * @param {boolean} forceAll Force update all even if not auto-updating1266 * @param {boolean} forceAll Include disabled and not auto-updating
1252 * @returns {Promise<void>}1267 * @returns {Promise<void>}
1253 */1268 */
1254async function autoUpdateExtensions(forceAll) {1269async function autoUpdateExtensions(forceAll) {
@@ -1260,6 +1275,11 @@ async function autoUpdateExtensions(forceAll) {
1260 const isCurrentUserAdmin = isAdmin();1275 const isCurrentUserAdmin = isAdmin();
1261 const promises = [];1276 const promises = [];
1262 for (const [id, manifest] of Object.entries(manifests)) {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 const isGlobal = getExtensionType(id) === 'global';1283 const isGlobal = getExtensionType(id) === 'global';
1264 if (isGlobal && !isCurrentUserAdmin) {1284 if (isGlobal && !isCurrentUserAdmin) {
1265 console.debug(`Skipping global extension: ${manifest.display_name} (${id}) for non-admin user`);1285 console.debug(`Skipping global extension: ${manifest.display_name} (${id}) for non-admin user`);