Markdown/HTML Preview: I can open links within VS Code (fixes #2362)

This commit is contained in:
Benjamin Pasero 2016-01-27 14:51:04 +01:00
parent dc22667402
commit f8ad5c52ae
2 changed files with 12 additions and 3 deletions

View file

@ -197,7 +197,11 @@ export class IFrameEditor extends BaseEditor {
'window.document.body.addEventListener("drop", function (e) {',
' e.preventDefault();',
'});',
'</script>'
// disable navigating to some URL!
'window.onbeforeunload = function () {',
' return false;',
'};'
].join('\n');
}
@ -210,7 +214,7 @@ export class IFrameEditor extends BaseEditor {
}
private clearIFrame(): void {
this.iframeBuilder.src('about:blank');
this.setFrameContents(null, '', true);
this.iframeBuilder.removeProperty(IFrameEditor.RESOURCE_PROPERTY);
}

View file

@ -262,7 +262,12 @@ namespace Integration {
'});',
'window.document.body.addEventListener("drop", function (e) {',
' e.preventDefault();',
'});'
'});',
// disable navigating to some URL!
'window.onbeforeunload = function () {',
' return false;',
'};'
];
export function defaultHtml() {