Skip to content

Commit

Permalink
Merge pull request #3685 from brave/francois-whitelist-password-manag…
Browse files Browse the repository at this point in the history
…ers-6309

Exempt password managers from the Uphold content script restrictions
  • Loading branch information
fmarier authored Oct 17, 2019
2 parents f6cc268 + a6f3c37 commit 7fa87d1
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions chromium_src/extensions/common/permissions/permissions_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,28 @@

namespace extensions {

const char k1PasswordId[] = "aomjjhallfgjeglblehebfpbcfeobpgk";
const char k1PasswordXId[] = "aeblfdkhhhdcdjpifhhbdiojplfjncoa";
const char kBitWardenId[] = "nngceckbapebfimnlniiiahkandclblb";
const char kDashlaneId[] = "fdjamakpfbbddfjaooikfcpapjohcfmg";
const char kEnPassId[] = "kmcfomidfpdkfieipokbalgegidffkal";
const char kKeePassXCId[] = "oboonakemofpalcgghocfoadofidjkkk";
const char kKeeperId[] = "bfogiafebfohielmmehodmfbbebbbpei";
const char kLastPassId[] = "hdokiejnpimakedhajhdlcegeplioahd";
const char kPainFreePasswordsId[] = "hplhaekjfmjfnfdllkpjpeenlbclffgh";
const char kRoboFormId[] = "pnlccmojcmeohlpggmfnbbiapkmbliob";
const char kSafeInCloudId[] = "lchdigjbcmdgcfeijpfkpadacbijihjl";

bool IsKnownPasswordManagerExtension(
const extensions::ExtensionId& extension_id) {
return (extension_id == k1PasswordId) || (extension_id == k1PasswordXId) ||
(extension_id == kBitWardenId) || (extension_id == kDashlaneId) ||
(extension_id == kEnPassId) || (extension_id == kKeePassXCId) ||
(extension_id == kKeeperId) || (extension_id == kLastPassId) ||
(extension_id == kPainFreePasswordsId) ||
(extension_id == kRoboFormId) || (extension_id == kSafeInCloudId);
}

bool IsBraveProtectedUrl(const GURL& url) {
const url::Origin origin = url::Origin::Create(url);
const base::StringPiece path = url.path_piece();
Expand Down Expand Up @@ -39,6 +61,10 @@ bool IsBraveRestrictedUrl(const GURL& document_url,
return false;
}

if (extensions::IsKnownPasswordManagerExtension(extension_id)) {
return false;
}

if (extensions::IsBraveProtectedUrl(document_url)) {
if (error) {
*error = kCannotScriptWalletLinking;
Expand Down

0 comments on commit 7fa87d1

Please sign in to comment.