Skip to content

Fix markdown preview focus #546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion scripts/vscode.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@
Expand Down Expand Up @@ -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
Expand Down