Skip to content

Commit

Permalink
Remove usage of DOMException.code
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed Jun 21, 2024
1 parent 17d5b8a commit c21c51d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
3 changes: 1 addition & 2 deletions files/en-us/web/api/credentialscontainer/get/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ async function signIn() {
} catch (e) {
// Handle the error in some way, for example provide information
// to help the user succeed in a future sign-in attempt
const code = e.code;
const url = e.url;
console.error(e);
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ checkoutButton.addEventListener("click", () => {
});
})
.catch((error) => {
if (error.code === DOMException.NOT_SUPPORTED_ERR) {
if (error.name === "NotSupportedError") {
window.location.href = "https://bobpay.xyz/#download";
} else {
// Other kinds of errors; cancelled or failed payment. For demo purposes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,7 @@ function storageAvailable(type) {
return true;
} catch (e) {
return (
e instanceof DOMException &&
// everything except Firefox
(e.code === 22 ||
// Firefox
e.code === 1014 ||
// test name field too, because code might not be present
// everything except Firefox
e.name === "QuotaExceededError" ||
// Firefox
e.name === "NS_ERROR_DOM_QUOTA_REACHED") &&
e.name === "QuotaExceededError" &&
// acknowledge QuotaExceededError only if there's something already stored
storage &&
storage.length !== 0
Expand Down

0 comments on commit c21c51d

Please sign in to comment.