Skip to content

Commit

Permalink
Bug 1726808 - Un-hardcode the snap name to check against in nsToolkit…
Browse files Browse the repository at this point in the history
…ProfileService::IsSnapEnvironment(). r=stransky,mossop

Differential Revision: https://phabricator.services.mozilla.com/D123239
  • Loading branch information
oSoMoN committed Aug 27, 2021
1 parent 6008d35 commit 27a83cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions toolkit/profile/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ LOCAL_INCLUDES += [

FINAL_LIBRARY = "xul"

DEFINES["MOZ_APP_NAME"] = '"%s"' % CONFIG["MOZ_APP_NAME"]

JAR_MANIFESTS += ["jar.mn"]

with Files("**"):
Expand Down
5 changes: 3 additions & 2 deletions toolkit/profile/nsToolkitProfileService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2053,8 +2053,9 @@ bool nsToolkitProfileService::IsSnapEnvironment() {
return false;
}

// snapName as defined on https://snapcraft.io/firefox
return (strcmp(snapName, "firefox") == 0);
// snapName as defined on e.g.
// https://snapcraft.io/firefox or https://snapcraft.io/thunderbird
return (strcmp(snapName, MOZ_APP_NAME) == 0);
}

/**
Expand Down

0 comments on commit 27a83cc

Please sign in to comment.