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

window.phantom being defined breaks several websites #24289

Closed
bsclifton opened this issue Jul 27, 2022 · 5 comments · Fixed by brave/brave-core#14430
Closed

window.phantom being defined breaks several websites #24289

bsclifton opened this issue Jul 27, 2022 · 5 comments · Fixed by brave/brave-core#14430

Comments

@bsclifton
Copy link
Member

bsclifton commented Jul 27, 2022

Description

Trying to login with valid (or invalid) credentials triggers a fatal error on some websites, preventing login.

Works fine in Brave version 1.42 (before 1.42.81), 1.41 and in Chrome. Also works fine in a private window

Steps to Reproduce

  1. Visit https://accountaccess.edwardjones.com/ca-logon/logon.action
  2. Put in username braveuser
  3. Put in password AbbbAAbbcdD11
  4. Click Log In button

Actual result:

Error is shown Due to a system problem, we are unable to log you in at this time. Please try again later. If the problem continues, contact Online Client Support at 800-441-5203.

Expected result:

Should show an error The system did not recognize the user ID and password you entered.

Reproduces how often:

100%

Brave version (brave://version info)

1.43.42 or newer (Nightly)
1.42.81 or newer (Beta)

Version/Channel Information:

  • Can you reproduce this issue with the current release? no
  • Can you reproduce this issue with the beta channel? yes
  • Can you reproduce this issue with the nightly channel? yes

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields? no
  • Does the issue resolve itself when disabling Brave Rewards? no
  • Is the issue reproducible on the latest version of Chrome? no

Miscellaneous Information:

Problem did not exist in 1.43.41. Problem started occurring with 1.43.42.
https://github.com/brave/brave-core/commits/19d8fe92f1887055072d62f1e7e6546053964515

I was able to reproduce from source code (git checkout -b bsc-troubleshooting v1.43.42) and commenting out this line fixed the issue for me (I don't know why):
https://github.com/brave/brave-core/blob/f54f6be60d18d8e9496c72c3a3afc974cbc784d4/components/brave_wallet/renderer/js_solana_provider.cc#L159-L161

@bsclifton bsclifton added webcompat/not-shields-related Sites are breaking because of something other than Shields. OS/Desktop labels Jul 27, 2022
@darkdh
Copy link
Member

darkdh commented Jul 27, 2022

This can also happen if you install and setup Phantom extension using Chrome. The website will give the exactly same error because it sees window.phantom disregarding who inserted it.

@snowbound
Copy link

snowbound commented Aug 1, 2022

Just posted that this wallet issue fixed the bank website issue. I am wondering how many other Brave Beta users are having this problem. Thanks @bsclifton for the heads up changing the wallets to NONE fixed this issue for me. I do not use Brave for crypto or BAT.

@bsclifton bsclifton changed the title Login form broken on edwardjones.com window.phantom being defined breaks several websites Aug 2, 2022
@bsclifton bsclifton self-assigned this Aug 2, 2022
@bsclifton
Copy link
Member Author

bsclifton commented Aug 2, 2022

window.phantom introduced in brave/brave-core#14282 for 1.43 and uplifted to 1.42 with brave/brave-core#14295

Thanks @snowbound for reporting https://online.acu.ca/ breakage; there are likely other websites having the same problem. One more website reported by @ryanbr is https://www.jingpt.com/ which won't render at all when window.phantom is defined.

If I had to guess, I think that some websites are having a special code path for automated tests (ex: using Selenium). If window.phantom is set, the developers may be assuming the site is running under phantomjs. They likely have a workaround for faking or skipping login for the purpose of the automated test. Here's an example of someone recommending that strategy on stackoverflow.com:
https://stackoverflow.com/questions/26186101/how-to-skip-the-code-execution-from-phantomjs-or-grover

@MadhaviSeelam
Copy link

MadhaviSeelam commented Aug 3, 2022

Verification PASSED using

Brave 1.42.86 Chromium: 104.0.5112.81 (Official Build) (64-bit)
Revision 5b7b76419d50f583022568b6764b630f6ddc9208-refs/branch-heads/5112@{#1309}
OS Windows 11 Version 21H2 (Build 22000.795)

Verified using STR #24289 (comment)

###Confirmed correct error message displayed The system did not recognize the user ID and password you entered.

before fix in 1.42.85 fix verified 1.42.86
before before

Verified this site https://online.acu.ca/ as well as per #24347

Confirmed Enter your password page rendered

before

@stephendonner
Copy link

stephendonner commented Aug 3, 2022

Verification PASSED using

Brave 1.42.86 Chromium: 104.0.5112.81 (Official Build) (x86_64)
Revision 5b7b76419d50f583022568b6764b630f6ddc9208-refs/branch-heads/5112@{#1309}
OS macOS Version 11.6.8 (Build 20G730)

Confirmed the fix in 1.42.86, using the steps to reproduce from #24289 (comment); I first reproduced both issues using 1.42.85

Edward Jones, 1.42.85 Edward Jones, 1.42.86
Screen Shot 2022-08-02 at 5 53 03 PM Screen Shot 2022-08-02 at 5 41 31 PM
online.acu.ca, 1.42.85 online.acu.ca, 1.42.86
Screen Shot 2022-08-02 at 5 52 09 PM Screen Shot 2022-08-02 at 5 27 51 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment