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

TypeError: e.matches is not a function #2000

Closed
yesh0 opened this issue May 24, 2023 · 1 comment
Closed

TypeError: e.matches is not a function #2000

yesh0 opened this issue May 24, 2023 · 1 comment

Comments

@yesh0
Copy link

yesh0 commented May 24, 2023

Prelude

I have searched through the issues and found this PR (#1196). However, I suppose this issue is worth a separate issue since the PR does not seem to address it correctly.

Error details

SurfingKeys: 1.13.0

Browser: Firefox 113.0.2, Arch Linux

URL: http://example.com

The console stack trace shows:

TypeError: e.matches is not a function 20 content.js:3:44208
    isEditable moz-extension://2b8c8e6b-4d91-4aba-9dee-811645fbbfab/content.js:3
    h moz-extension://2b8c8e6b-4d91-4aba-9dee-811645fbbfab/content.js:3
    s moz-extension://2b8c8e6b-4d91-4aba-9dee-811645fbbfab/content.js:3
    e moz-extension://2b8c8e6b-4d91-4aba-9dee-811645fbbfab/content.js:3
    (Async: EventListener.handleEvent)
    addEventListener moz-extension://2b8c8e6b-4d91-4aba-9dee-811645fbbfab/content.js:3
    y moz-extension://2b8c8e6b-4d91-4aba-9dee-811645fbbfab/content.js:3
    T moz-extension://2b8c8e6b-4d91-4aba-9dee-811645fbbfab/content.js:3
    <anonymous> moz-extension://2b8c8e6b-4d91-4aba-9dee-811645fbbfab/content.js:3
    <anonymous> moz-extension://2b8c8e6b-4d91-4aba-9dee-811645fbbfab/content.js:3
    <anonymous> moz-extension://2b8c8e6b-4d91-4aba-9dee-811645fbbfab/content.js:3
    <anonymous> moz-extension://2b8c8e6b-4d91-4aba-9dee-811645fbbfab/content.js:3
    inject resource://gre/modules/ExtensionContent.jsm:593
    AsyncFunctionNext self-hosted:810

Context

Reproducing steps

I was suspecting some focus event causes this since its e.target is document (there is no such document.matches). Driven by this thought I managed to reproduce it quite reliably with the following steps. But I am unsure if any other events are passing invalid arguments to isEditable though.

Way 1

  1. Fresh-install Firefox & SurfingKeys
  2. Go to http://example.com (you might click to first focus on the page)
  3. Open another window (dev console or maybe literally any other window) and use Alt+Tab to switch between the browser window and the other window for a couple of times
  4. Watch to error message show up whenever the browser loses or gain focus

Way 2

Refresh any page (with F5 or by click on the refresh button). Refreshing in the dev console with F5 works fine though, but the error message pops when I focus back into the browser.

@brookhong
Copy link
Owner

Thanks for the detail steps to reproduce.

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

No branches or pull requests

2 participants