Skip to content

Commit 66114e2

Browse files
committed
Show a message that JS is required when disabled for BCD
1 parent c215501 commit 66114e2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

components/compat-table-lazy/element.js

Lines changed: 6 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";
@@ -96,7 +97,11 @@ export class MDNCompatTableLazy extends L10nMixin(LitElement) {
9697

9798
render() {
9899
return this._dataTask.render({
99-
initial: () => html`<p>${this.l10n("compat-loading")`Loading…`}</p>`,
100+
initial: () =>
101+
html`<p>${this.l10n("compat-loading")`Loading…`}</p>
102+
${unsafeHTML(
103+
`<noscript><style>p:first-of-type { display: none !important; }</style><div>${this.l10n("compat-js-required")`Browser compatibility tables only load in the browser with JavaScript enabled.`}</div></noscript>`,
104+
)}`,
100105
pending: () => html`<p>${this.l10n("compat-loading")`Loading…`}</p>`,
101106

102107
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 = Browser compatibility tables only load in the browser with JavaScript enabled.
6465
6566
compat-browser-version-date = { $browser } { $version } – Release date: { $date }
6667
compat-browser-version-released = Release date: { $date }

0 commit comments

Comments
 (0)