Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mini-browser] support '.xhtml' file for preview #6969

Merged
merged 1 commit into from
Feb 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,12 @@ export class MiniBrowserOpenHandler extends NavigatableWidgetOpenHandler<MiniBro

protected resetBackground(uri: URI): MaybePromise<boolean> {
const { scheme } = uri;
return scheme === 'http' || scheme === 'https' || (scheme === 'file' && uri.toString().endsWith('.html'));
const uriStr = uri.toString();
return scheme === 'http'
|| scheme === 'https'
|| (scheme === 'file'
&& (uriStr.endsWith('html') || uriStr.endsWith('.htm'))
);
}

protected async defaultOptions(): Promise<MiniBrowserOpenerOptions & { widgetOptions: ApplicationShell.WidgetOptions }> {
Expand Down
4 changes: 2 additions & 2 deletions packages/mini-browser/src/node/mini-browser-endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ const CODE_EDITOR_PRIORITY = 100;
@injectable()
export class HtmlHandler implements MiniBrowserEndpointHandler {

supportedExtensions(): string {
return 'html';
supportedExtensions(): string[] {
return ['html', 'xhtml', 'htm'];
}

priority(): number {
Expand Down