Skip to content

Commit 3ac4661

Browse files
fix(compat-table): show message when JavaScript is disabled (#890)
1 parent c4cd526 commit 3ac4661

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

components/compat-table-lazy/element.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Task } from "@lit/task";
22
import { LitElement, html } from "lit";
3+
import { unsafeHTML } from "lit/directives/unsafe-html.js";
34

45
import "../compat-table/element.js";
56
import { L10nMixin } from "../../l10n/mixin.js";
@@ -95,8 +96,11 @@ export class MDNCompatTableLazy extends L10nMixin(LitElement) {
9596
});
9697

9798
render() {
99+
const noScript = unsafeHTML(
100+
`<noscript>${this.l10n("compat-js-required")`Enable JavaScript to view this browser compatibility table.`}</noscript>`,
101+
);
98102
return this._dataTask.render({
99-
initial: () => html`<p>${this.l10n("compat-loading")`Loading…`}</p>`,
103+
initial: () => html`<p>${noScript}</p>`,
100104
pending: () => html`<p>${this.l10n("compat-loading")`Loading…`}</p>`,
101105

102106
complete:

l10n/en-US.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ obs-mdn = The { -brand-name-obs } provides effective security insights, guided b
6161
6262
6363
compat-loading = Loading…
64+
compat-js-required = Enable JavaScript to view this browser compatibility table.
6465
6566
compat-browser-version-date = { $browser } { $version } – Release date: { $date }
6667
compat-browser-version-released = Release date: { $date }

0 commit comments

Comments
 (0)