How to use the @theia/mini-browser/lib/browser/location-mapper-service.MiniBrowserEndpoint function in @theia/mini-browser

To help you get started, we’ve selected a few @theia/mini-browser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eclipse-theia / theia / packages / preview / src / browser / preview-link-normalizer.ts View on Github external
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;
    }
}