Skip to content

Commit

Permalink
Add warning when JS is disabled on dev browser
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Jan 2, 2020
1 parent 11142f6 commit 01f2b18
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/dev-build-html.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,20 @@ export default indexFile =>
return scriptTag;
})
);
const noScriptAlert = document.createElement("noscript");
const removeDialogScript = document.createElement("script");
const dialog = document.createElement("dialog");
dialog.open = true;
dialog.id = "placeholder-dialog";
dialog.append(
document.createElement("progress"),
" Building application..."
" Building application...",
noScriptAlert
);
noScriptAlert.append(
document.createElement("br"),
document.createElement("br"),
"Warning, your browser in on no-script mode!"
);
removeDialogScript.textContent = `import("./${BUNDLE_NAME}")
.then(()=>document.getElementById("${dialog.id}").remove())
Expand Down

0 comments on commit 01f2b18

Please sign in to comment.