diff --git a/ci/vscode.patch b/ci/vscode.patch index ab4f19a9e..c7e58872b 100644 --- a/ci/vscode.patch +++ b/ci/vscode.patch @@ -486,10 +486,10 @@ index eab8591492..26668701f7 100644 options.logService.error(`${logPrefix} socketFactory.connect() failed. Error:`); diff --git a/src/vs/server/browser/client.ts b/src/vs/server/browser/client.ts new file mode 100644 -index 0000000000..95e70869f2 +index 0000000000..3f53907de0 --- /dev/null +++ b/src/vs/server/browser/client.ts -@@ -0,0 +1,224 @@ +@@ -0,0 +1,227 @@ +import { Emitter } from 'vs/base/common/event'; +import { URI } from 'vs/base/common/uri'; +import { localize } from 'vs/nls'; @@ -518,6 +518,9 @@ index 0000000000..95e70869f2 + +const TELEMETRY_SECTION_ID = 'telemetry'; + ++const el = document.getElementById("vscode-disable-telemetry"); ++const disableTelemetry = el && el.getAttribute("data-value") === "true" || false; ++ +Registry.as(Extensions.Configuration).registerConfiguration({ + 'id': TELEMETRY_SECTION_ID, + 'order': 110, @@ -527,7 +530,7 @@ index 0000000000..95e70869f2 + 'telemetry.enableTelemetry': { + 'type': 'boolean', + 'description': localize('telemetry.enableTelemetry', 'Enable usage data and errors to be sent to a Microsoft online service.'), -+ 'default': true, ++ 'default': !disableTelemetry, + 'tags': ['usesOnlineServices'] + } + } diff --git a/src/browser/pages/vscode.html b/src/browser/pages/vscode.html index acead2e4e..aeea05661 100644 --- a/src/browser/pages/vscode.html +++ b/src/browser/pages/vscode.html @@ -23,6 +23,7 @@ + diff --git a/src/node/app/vscode.ts b/src/node/app/vscode.ts index 29e5c48e6..c31785092 100644 --- a/src/node/app/vscode.ts +++ b/src/node/app/vscode.ts @@ -205,6 +205,7 @@ export class VscodeHttpProvider extends HttpProvider { .replace(`"{{PRODUCT_CONFIGURATION}}"`, `'${JSON.stringify(options.productConfiguration)}'`) .replace(`"{{WORKBENCH_WEB_CONFIGURATION}}"`, `'${JSON.stringify(options.workbenchWebConfiguration)}'`) .replace(`"{{NLS_CONFIGURATION}}"`, `'${JSON.stringify(options.nlsConfiguration)}'`) + .replace("{{DISABLE_TELEMETRY}}", this.args["disable-telemetry"] ? "true" : "false") return this.replaceTemplates(route, response) }