Skip to content

Commit

Permalink
FXVPN-333 keep extension visually disabled on non supported OS
Browse files Browse the repository at this point in the history
  • Loading branch information
strseb committed Jan 8, 2025
1 parent 6ffe9c4 commit 76dfce1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/background/toolbarIconHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import { Component } from "./component.js";
import { Utils } from "../shared/utils.js";
import {
ExtensionController,
FirefoxVPNState,
Expand All @@ -23,6 +24,11 @@ export class ToolbarIconHandler extends Component {
super(receiver);
this.extController = extController;
this.vpnController = vpnController;
this.isSupportedPlatform = true;
browser.runtime.getPlatformInfo().then((deviceOs) => {
this.isSupportedPlatform = Utils.isSupportedOs(deviceOs.os);
this.maybeUpdateBrowserActionIcon();
});
}

/** @type {FirefoxVPNState | undefined} */
Expand Down Expand Up @@ -82,6 +88,10 @@ export class ToolbarIconHandler extends Component {

const scheme = darkMode || windowInfo.incognito ? "light" : "dark";

if (!this.isSupportedPlatform) {
return this.setIcon(scheme, "disabled", windowInfo.id);
}

let status = ["Connecting", "Enabled"].includes(this.extState.state)
? "enabled"
: "disabled";
Expand Down

0 comments on commit 76dfce1

Please sign in to comment.