Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ To visit specific articles, just change the directory to end with '?' + article

| Chrome | Firefox | Edge | Safari | Opera | Mobile |
| ------ | ------- | ---- | ------ | ----- | ------ |
| ✔ | ✔ | ✔ | ? | ✔ | ✔ |
| ✔ | ✔ | ✔ | ? | ✔ | ✔ |

## Known issues

Expand Down
13 changes: 12 additions & 1 deletion cypress/e2e/landing.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,18 @@ describe("Landing Page", () => {

it("should show error when article is missing", () => {
// Simulate navigating to a missing article
cy.visit("http://localhost:3000/index.html?NonExistentArticle");
cy.visit("http://localhost:3000/index.html?NonExistentArticle", {
onBeforeLoad(win) {
// Simulate service worker registration throwing a disallowed redirect error
Object.defineProperty(win.navigator, "serviceWorker", {
value: {
register: () => Promise.reject(new Error("disallowed redirect")),
},
writable: true,
});
},
});

cy.get("#articleBody").should("contain", "Error retrieving article");
cy.get("#articleBody").should("be.visible");
});
Expand Down
8 changes: 0 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,6 @@
<link rel="stylesheet preload" href="./src/scripts/libraries/bootstrap/css/bootstrap.min.css" as="style" />
<script rel="preload" as="script" src="./src/scripts/libraries/bootstrap/js/bootstrap.bundle.min.js"></script>
<script rel="preload" as="script" src="./src/scripts/libraries/showdown/showdown.min.js"></script>
<script>
// Add service workers
if (typeof navigator !== "undefined" && "serviceWorker" in navigator) {
window.addEventListener("load", () => {
navigator.serviceWorker.register("./src/serviceWorker/sw.js");
});
}
</script>
<script rel="preload" as="script" src="./src/scripts/index.min.js"></script>
<!-- Sentry -->
<script
Expand Down
Loading
Loading