mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
chore: Upgrade to electron 7.x (#83796)
* chore: bump electron@7.0.0 * chore: update api * chore: Bump electron@7.0.1 * chore: bump electron@7.1.0 * chore: Bump electron@7.1.1 * chore: Bump electron@7.1.2 * FIXME: Skip webview tests that have improper shutdown path * chore: Bump electron@7.1.3 * bump electron@7.1.5 * debug test failures * chore: bump electron@7.1.7 * skip test for https://github.com/microsoft/vscode/issues/87330 Co-authored-by: Benjamin Pasero <benjamin.pasero@gmail.com>
This commit is contained in:
@@ -347,9 +347,9 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
});
|
||||
|
||||
this._win.webContents.session.webRequest.onHeadersReceived(null!, (details, callback) => {
|
||||
const responseHeaders = details.responseHeaders as { [key: string]: string[] };
|
||||
const responseHeaders = details.responseHeaders as Record<string, (string) | (string[])>;
|
||||
|
||||
const contentType: string[] = (responseHeaders['content-type'] || responseHeaders['Content-Type']);
|
||||
const contentType = (responseHeaders['content-type'] || responseHeaders['Content-Type']);
|
||||
if (contentType && Array.isArray(contentType) && contentType.some(x => x.toLowerCase().indexOf('image/svg') >= 0)) {
|
||||
return callback({ cancel: true });
|
||||
}
|
||||
@@ -441,7 +441,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
// Inject headers when requests are incoming
|
||||
const urls = ['https://marketplace.visualstudio.com/*', 'https://*.vsassets.io/*'];
|
||||
this._win.webContents.session.webRequest.onBeforeSendHeaders({ urls }, (details, cb) =>
|
||||
this.marketplaceHeadersPromise.then(headers => cb({ cancel: false, requestHeaders: objects.assign(details.requestHeaders, headers) as { [key: string]: string | undefined } })));
|
||||
this.marketplaceHeadersPromise.then(headers => cb({ cancel: false, requestHeaders: objects.assign(details.requestHeaders, headers) as Record<string, string> })));
|
||||
}
|
||||
|
||||
private onWindowError(error: WindowError): void {
|
||||
|
||||
Reference in New Issue
Block a user