提交 f8ad5c52 编写于 作者: B Benjamin Pasero

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

上级 dc226674
...@@ -197,7 +197,11 @@ export class IFrameEditor extends BaseEditor { ...@@ -197,7 +197,11 @@ export class IFrameEditor extends BaseEditor {
'window.document.body.addEventListener("drop", function (e) {', 'window.document.body.addEventListener("drop", function (e) {',
' e.preventDefault();', ' e.preventDefault();',
'});', '});',
'</script>'
// disable navigating to some URL!
'window.onbeforeunload = function () {',
' return false;',
'};'
].join('\n'); ].join('\n');
} }
...@@ -210,7 +214,7 @@ export class IFrameEditor extends BaseEditor { ...@@ -210,7 +214,7 @@ export class IFrameEditor extends BaseEditor {
} }
private clearIFrame(): void { private clearIFrame(): void {
this.iframeBuilder.src('about:blank'); this.setFrameContents(null, '', true);
this.iframeBuilder.removeProperty(IFrameEditor.RESOURCE_PROPERTY); this.iframeBuilder.removeProperty(IFrameEditor.RESOURCE_PROPERTY);
} }
......
...@@ -262,7 +262,12 @@ namespace Integration { ...@@ -262,7 +262,12 @@ namespace Integration {
'});', '});',
'window.document.body.addEventListener("drop", function (e) {', 'window.document.body.addEventListener("drop", function (e) {',
' e.preventDefault();', ' e.preventDefault();',
'});' '});',
// disable navigating to some URL!
'window.onbeforeunload = function () {',
' return false;',
'};'
]; ];
export function defaultHtml() { export function defaultHtml() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册