Skip to content

Commit

Permalink
Move webview loaded event to fix extensions using previewHTML
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed Mar 2, 2017
1 parent 49129d1 commit 439b3e6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/vs/workbench/parts/html/browser/webview-pre.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,6 @@ document.addEventListener("DOMContentLoaded", function (event) {

// write new content onto iframe
newFrame.contentDocument.open('text/html', 'replace');
// set DOCTYPE for newDocument explicitly as DOMParser.parseFromString strips it off
// and DOCTYPE is needed in the iframe to ensure that the user agent stylesheet is correctly overridden
newFrame.contentDocument.write('<!DOCTYPE html>');
newFrame.contentDocument.write(newDocument.documentElement.innerHTML);
newFrame.contentDocument.close();

// workaround for https://github.com/Microsoft/vscode/issues/12865
// check new scrollTop and reset if neccessary
Expand All @@ -143,6 +138,12 @@ document.addEventListener("DOMContentLoaded", function (event) {
newFrame.style.display = 'block';
});

// set DOCTYPE for newDocument explicitly as DOMParser.parseFromString strips it off
// and DOCTYPE is needed in the iframe to ensure that the user agent stylesheet is correctly overridden
newFrame.contentDocument.write('<!DOCTYPE html>');
newFrame.contentDocument.write(newDocument.documentElement.innerHTML);
newFrame.contentDocument.close();

ipcRenderer.sendToHost('did-set-content', stats);
});

Expand Down

0 comments on commit 439b3e6

Please sign in to comment.