feat-ext-unsafe.patch 1.5 KB

1234567891011121314151617181920212223242526272829
  1. diff --git a/src/vs/platform/extensionManagement/common/extensionGalleryService.ts b/src/vs/platform/extensionManagement/common/extensionGalleryService.ts
  2. index a0afbe7..7a4aaa5 100644
  3. --- a/src/vs/platform/extensionManagement/common/extensionGalleryService.ts
  4. +++ b/src/vs/platform/extensionManagement/common/extensionGalleryService.ts
  5. @@ -1764,2 +1764,8 @@ export abstract class AbstractExtensionGalleryService implements IExtensionGalle
  6. + const excludeUnsafes = this.configurationService.getValue('extensions.excludeUnsafes') ?? true;
  7. +
  8. + if (!excludeUnsafes) {
  9. + return { malicious: [], deprecated: {}, search: [] };
  10. + }
  11. +
  12. const context = await this.requestService.request({
  13. diff --git a/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts b/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts
  14. index 34a5326..ee0dd6c 100644
  15. --- a/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts
  16. +++ b/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts
  17. @@ -357,3 +357,10 @@ Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration)
  18. }
  19. - }
  20. + },
  21. + 'extensions.excludeUnsafes': {
  22. + scope: ConfigurationScope.MACHINE,
  23. + type: 'boolean',
  24. + default: true,
  25. + description: localize('extensionsExcludeUnsafes', "When enabled, it will download and cache the list of malicious and deprecated extensions. It's recommended to leave it enabled."),
  26. + tags: ['usesOnlineServices']
  27. + },
  28. }