From 30b8565e2d32265276814bdf78796dd4fcf06963 Mon Sep 17 00:00:00 2001 From: John McCambridge Date: Tue, 23 Apr 2019 19:14:52 -0500 Subject: [PATCH] Fix markdown preview focus (#546) * Fix hash * Remove whitespace --- scripts/vscode.patch | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/vscode.patch b/scripts/vscode.patch index 967c3d14..8e89e69e 100644 --- a/scripts/vscode.patch +++ b/scripts/vscode.patch @@ -827,7 +827,7 @@ index 780147c..2e8c9af 100644 - if (platform.isMacintosh) { + if (browser.isMacintosh) { diff --git a/src/vs/workbench/contrib/webview/electron-browser/webview-pre.js b/src/vs/workbench/contrib/webview/electron-browser/webview-pre.js -index 74fc798..03728d0 100644 +index 74fc798..0b6b5eb 100644 --- a/src/vs/workbench/contrib/webview/electron-browser/webview-pre.js +++ b/src/vs/workbench/contrib/webview/electron-browser/webview-pre.js @@ -10 +10,19 @@ @@ -866,6 +866,11 @@ index 74fc798..03728d0 100644 + // supportFetchAPI: true, + // corsEnabled: true + // }); +@@ -328 +346,3 @@ +- newFrame.contentWindow.focus(); ++ if (document.hasFocus()) { ++ newFrame.contentWindow.focus(); ++ } diff --git a/src/vs/workbench/contrib/webview/electron-browser/webview.contribution.ts b/src/vs/workbench/contrib/webview/electron-browser/webview.contribution.ts index 484ff86..f3f57cb 100644 --- a/src/vs/workbench/contrib/webview/electron-browser/webview.contribution.ts