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

Allow disabling the onboarding panel from enterprise policies #2631

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/_locales
22 changes: 21 additions & 1 deletion src/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,34 @@
}

// Routing to the correct panel.
// If localStorage is disabled, we don't show the onboarding.
//
// We do not show the onboarding panel when:
// 1. localStorage is disabled
// 2. `disableOnboarding` is set to `true` in the enterprise policies
const onboardingData = await browser.storage.local.get([ONBOARDING_STORAGE_KEY]);
let onboarded = onboardingData[ONBOARDING_STORAGE_KEY];
if (!onboarded) {
onboarded = 9;
this.setOnboardingStage(onboarded);
}

// If a polices file or a key in it do not exists, an error is raised.
// As a workaround, we catch and ignore the error if there is one. See
// https://bugzilla.mozilla.org/show_bug.cgi?id=1868153
let disableOnboarding = false;
try {
const managedStorage =
await browser.storage.managed.get("disableOnboarding");
disableOnboarding = managedStorage.disableOnboarding;
} catch(e) {
// ignore error
}

if (disableOnboarding) {
onboarded = 8;
this.setOnboardingStage(onboarded);
}

switch (onboarded) {
case 8:
this.showAchievementOrContainersListPanel();
Expand Down Expand Up @@ -818,7 +838,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 841 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