Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

regression - Clicking inside Extension Popup Dismisses Popup #10029

Closed
jonathansampson opened this issue Jul 18, 2017 · 22 comments
Closed

regression - Clicking inside Extension Popup Dismisses Popup #10029

jonathansampson opened this issue Jul 18, 2017 · 22 comments

Comments

@jonathansampson
Copy link
Collaborator

  • Did you search for similar issues before submitting this one?
    Yes

  • Describe the issue you encountered:
    Extension popup windows are closing unexpectedly.

  • Platform (Win7, 8, 10? macOS? Linux distro?):
    Windows 10 / Desktop

  • Brave Version (revision SHA):
    dbc3c4d

  • Steps to reproduce:

    1. Enable LastPass
    2. Click the browserAction icon
    3. Attempt to focus/click anything in the window
  • Actual result:
    The popup window closes

  • Expected result:
    Focus is given to the input field.

  • Will the steps above reproduce in a fresh profile? If not what other info can be added?
    N/A

  • Is this an issue in the currently released version?
    No

  • Can this issue be consistently reproduced?
    Yes

  • Screenshot if needed:

lastpass-closing

@srirambv
Copy link
Collaborator

Also happens when you enable the extension for the first time and try to login.

@srirambv
Copy link
Collaborator

Same issue for Dashlane on Windows. 1Password works fine

@bsclifton bsclifton modified the milestones: 0.18.x (Release Channel), 0.17.17 (Release Channel) Jul 19, 2017
@srirambv
Copy link
Collaborator

@jonathansampson
Copy link
Collaborator Author

@eljuno
Copy link
Contributor

eljuno commented Jul 21, 2017

+3 from community

@i7u
Copy link

i7u commented Jul 22, 2017

Seeing this as well on a fresh install on Win10 x64. Please let me know if there's any useful debugging information I can add.

@jonathansampson
Copy link
Collaborator Author

This does not repro for me on the master branch.

@jordan31bit
Copy link

+1 happening to me as well.

Brave: 0.17.19
rev: 4e46480
Muon: 4.1.9
libchromiumcontent: 59.0.3071.115
V8: 5.9.211.38
Node.js: 7.9.0
Update Channel: dev
os.platform: linux
os.release: 4.11.0-1-amd64
os.arch: x64 // debian testing

@jonathansampson
Copy link
Collaborator Author

This issue was introduced after 17.16 2d2ee2f

@jabowery
Copy link

Workaround until fixed: CTRL-ALT-h brings up the LastPass Vault

@jonathansampson
Copy link
Collaborator Author

The bug repros in our release build (left), but not when I checkout the same commit (right).

local-vs-release

@mistertempy
Copy link

I have the same problem. Any ETA on a fix? I will have to use a different browser until this is fixed, since I rely on Lastpass for all of my logins.

@bsclifton bsclifton marked this as a duplicate of #10114 Jul 24, 2017
@asdfractal
Copy link

Also had this problem after updating. For me I can still use my passwords because it autofills, but I cannot access any of the menu and I think it is not always saving new passwords. A massive hassle for anyone who uses LastPass exclusively for password management. Hope a fix is implemented ASAP!

@DivineOmega
Copy link

DivineOmega commented Jul 24, 2017

It's worth noting once you are automatically logged out of LastPass (as has just happened to me), this bug also prevents use of the login form in the popup, making it impossible to login and thus use LastPass at all.

@jordan31bit
Copy link

Some posts up someone suggested crtl alt h to load last pass vault. It works been my only workaround today. You can login that way

@DivineOmega
Copy link

@Trumpy Thanks, but unfortunately this does not seem to work on Linux. Perhaps because the ALT key is used by the desktop environment for window movement.

However, I have noticed if you click a LastPass autocomplete icon on a website, while logged out, it will open a LastPass login form in a new tab. This didn't seem to log me in correctly, however that might just be my mistake.

@bsclifton
Copy link
Member

bsclifton commented Jul 25, 2017

This is really unusual... when I go and do packaged builds (on Windows), this commit works:
2d2ee2f

While this commit (the very next commit) fails:
ce7e897

All I'm doing to package the builds is run:

git reset --hard <SHA HERE>
rm -rf node_modules
npm install
CHANNEL=dev npm run build-package

This drops the executable at Brave-win32-x64/Brave.exe which I am then running.

@bsclifton bsclifton self-assigned this Jul 25, 2017
@bsclifton
Copy link
Member

bsclifton commented Jul 25, 2017

Disregard my last post- after testing again, it doesn't work in either case.

Is it a problem with the extension itself? Unfortunately, unable to debug using:
chrome-extension://hdokiejnpimakedhajhdlcegeplioahd/_generated_background_page.html

@bsclifton bsclifton marked this as a duplicate of #10129 Jul 25, 2017
@bsclifton bsclifton changed the title Extension Popup Closes Unexpectedly regression - LastPass menu choices aren't working Jul 25, 2017
@jonathansampson
Copy link
Collaborator Author

Because LastPass ships their own background page, the proper debugging URL is: chrome-extension://hdokiejnpimakedhajhdlcegeplioahd/background.html

I also don't think this is a LastPass issue, since #10029 (comment) suggests Dashlane too. 1Password wouldn't be affected since they open their own Native Window over the top of Brave.

@jonathansampson jonathansampson changed the title regression - LastPass menu choices aren't working regression - Clicking inside Extension Popup Dismisses Popup Jul 25, 2017
@jonathansampson
Copy link
Collaborator Author

This issue is not limited to LastPass. It applies to all extensions using standard popups, as far as I can tell. Here's a GIF of the moarTLS extension doing the same thing:

moartls

@jonathansampson
Copy link
Collaborator Author

jonathansampson commented Jul 25, 2017

After speaking with @kevinlawler, we came upon some rather key information. The core bit of logic in question is found here:

  onMouseDown (e) {
    // TODO(bsclifton): update this to use eventUtil.eventElHasAncestorWithClasses
    let node = e.target
    while (node) {
      if (node.classList &&
          (node.matches('[class^="popupWindow"]') ||
            node.classList.contains('contextMenu') ||
            node.matches('[class*="extensionButton_"]') ||
            node.classList.contains('menubarItem') ||
            node.classList.contains('bookmarkHanger'))) {
        // Middle click (on context menu) needs to fire the click event.
        // We need to prevent the default "Auto-Scrolling" behavior.
        if (node.classList.contains('contextMenu') && e.button === 1) {
          e.preventDefault()
        }
        // Click event is handled downstream
        return
      }
      node = node.parentNode
    }

    // Hide context menus, popup menus, and menu selections
    windowActions.resetMenuState()
  }

At times. e.target is a <webview> that houses the extension popup. This element has no classes, and therefore doesn't allow us to fall into the return path. Other times, e.target is the <div> that holds the webview, which has a className that starts with "popupWindow". This takes us down the return path.

On the Release build of Brave, the popupWindow suffix is not being added. The resulting DIV looks like this:

<div class="_yfkq6x-o_O-_142fl4c" style="height: 459px; top: 42px; width: 352px; right: 1em;">
    <webview tabindex="-1" src="chrome-extension://hdokiejnpimakedhajhdlcegeplioahd/extensionLogin.html" style="height: 457px; width: 350px;"></webview>
</div>

This suggests to me that it may be something to do with Aphrodite; perhaps an optimization to cut-down on generated markup. @cezaraugusto @bsclifton?

@jonathansampson
Copy link
Collaborator Author

I think we're minifying classNames for release. https://github.com/Khan/aphrodite#minify-class-names

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests