Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show error message and troubleshooting steps on contextual identities error #2598

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
15 changes: 15 additions & 0 deletions src/css/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -2395,3 +2395,18 @@ tr:hover > td > .trash-button {
.searchbar input {
inline-size: 100%;
}

/* ----- Error ---------- */

#on-error {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: I think we could use more obvious like containers-pref-error

margin-block: auto;
}

#on-error h2 {
font-weight: bold;
}

#on-error h2,
#on-error p {
text-align: center;
}
9 changes: 8 additions & 1 deletion src/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,19 @@
// Retrieve the list of identities.
const identitiesPromise = this.refreshIdentities();

const errorBlock = document.getElementById("on-error");
const successBlock = document.getElementById("on-success");
try {
await identitiesPromise;
} catch (e) {
throw new Error("Failed to retrieve the identities or variation. We cannot continue. ", e.message);
errorBlock.style.display = "block";
successBlock.style.display = "none";
return;
}

errorBlock.style.display = "none";
successBlock.style.display = "block";

// Routing to the correct panel.
// If localStorage is disabled, we don't show the onboarding.
const onboardingData = await browser.storage.local.get([ONBOARDING_STORAGE_KEY]);
Expand Down Expand Up @@ -827,7 +834,7 @@
const td = document.createElement("td");
const openTabs = identity.numberOfOpenTabs || "" ;

// TODO get UX and content decision on how to message and block clicks to containers with Mozilla VPN proxy configs

Check warning on line 837 in src/js/popup.js

View workflow job for this annotation

GitHub Actions / Run tests

Unexpected 'todo' comment: 'TODO get UX and content decision on how...'
// when Mozilla VPN app is disconnected.

td.innerHTML = Utils.escaped`
Expand Down
Loading
Loading