Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
normalizeLink(documentUri: URI, link: string): string {
try {
if (!this.urlScheme.test(link)) {
const location = documentUri.parent.resolve(link).path.toString();
return new MiniBrowserEndpoint().getRestUrl().resolve(location).toString();
}
} catch {
// ignore
}
return link;
}
}
protected init(): void {
this.node.tabIndex = 0;
this.id = WebviewWidget.FACTORY_ID + ':' + this.identifier.id;
this.title.closable = true;
this.addClass(WebviewWidget.Styles.WEBVIEW);
this.toDispose.push(this.onMessageEmitter);
this.transparentOverlay = document.createElement('div');
this.transparentOverlay.classList.add(MiniBrowserContentStyle.TRANSPARENT_OVERLAY);
this.transparentOverlay.style.display = 'none';
this.node.appendChild(this.transparentOverlay);
this.toDispose.push(this.mouseTracker.onMousedown(() => {
if (this.element.style.display !== 'none') {
this.transparentOverlay.style.display = 'block';
}
}));
this.toDispose.push(this.mouseTracker.onMouseup(() => {
if (this.element.style.display !== 'none') {
this.transparentOverlay.style.display = 'none';
}
}));
const element = document.createElement('iframe');
element.className = 'webview';