product.json文件中没有releaseNotesUrl时,命令面板不注册显示releaseNote命令.

This commit is contained in:
chriswang521 2023-09-28 15:19:24 +08:00
parent 0a3b6a331d
commit dd544b1ebb
2 changed files with 8 additions and 6 deletions

View File

@ -110,7 +110,7 @@ export class ReleaseNotesManager {
}
const versionLabel = match[1].replace(/\./g, '_');
const baseUrl = 'https://code.visualstudio.com/raw';
const baseUrl = 'https://0.0.0.0/raw';
const url = `${baseUrl}/v${versionLabel}.md`;
const unassigned = nls.localize('unassigned', "unassigned");
@ -199,7 +199,7 @@ export class ReleaseNotesManager {
private async addGAParameters(uri: URI, origin: string, experiment = '1'): Promise<URI> {
if (supportsTelemetry(this._productService, this._environmentService) && getTelemetryLevel(this._configurationService) === TelemetryLevel.USAGE) {
if (uri.scheme === 'https' && uri.authority === 'code.visualstudio.com') {
if (uri.scheme === 'https' && uri.authority === '0.0.0.0') {
return uri.with({ query: `${uri.query ? uri.query + '&' : ''}utm_source=VsCode&utm_medium=${encodeURIComponent(origin)}&utm_content=${encodeURIComponent(experiment)}` });
}
}
@ -214,9 +214,9 @@ export class ReleaseNotesManager {
return `<!DOCTYPE html>
<html>
<head>
<base href="https://code.visualstudio.com/raw/">
<base href="https://0.0.0.0/raw/">
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src https: data:; media-src https:; style-src 'nonce-${nonce}' https://code.visualstudio.com;">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src https: data:; media-src https:; style-src 'nonce-${nonce}' https://0.0.0.0;">
<style nonce="${nonce}">
${DEFAULT_MARKDOWN_STYLES}
${css}

View File

@ -25,8 +25,6 @@ workbench.registerWorkbenchContribution(SwitchProductQualityContribution, Lifecy
const actionRegistry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
// Editor
actionRegistry
.registerWorkbenchAction(SyncActionDescriptor.from(ShowCurrentReleaseNotesAction), `${product.nameShort}: Show Release Notes`, product.nameShort);
actionRegistry
.registerWorkbenchAction(SyncActionDescriptor.from(CheckForVSCodeUpdateAction), `${product.nameShort}: Check for Update`, product.nameShort, CONTEXT_UPDATE_STATE.isEqualTo(StateType.Idle));
@ -85,6 +83,10 @@ registerAction2(RestartToUpdateAction);
// Menu
if (ShowCurrentReleaseNotesAction.AVAILABE) {
actionRegistry
.registerWorkbenchAction(SyncActionDescriptor.from(ShowCurrentReleaseNotesAction), `${product.nameShort}: Show Release Notes`, product.nameShort);
MenuRegistry.appendMenuItem(MenuId.MenubarHelpMenu, {
group: '1_welcome',
command: {