-
Notifications
You must be signed in to change notification settings - Fork 944
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
Fix debug calls while in a preload script inside Electron #377
Conversation
In `electron` preload scripts `document.documentElement` is null
return (typeof document !== 'undefined' && 'WebkitAppearance' in document.documentElement.style) || | ||
// document.documentElement is null in Electron preload scripts | ||
return (typeof document !== 'undefined' && document.documentElement | ||
'WebkitAppearance' in document.documentElement.style) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wondering if you meant to add an &&
to the end of the null pointer check document.documentElement
? This looks like a syntax error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idek where that &&
went, let's pretend this didn't happen and move on 😆
Pretty sure there is a syntax error here. I added linting to browser.js on master, but I don't think it ran on this PR. |
This is a dupe of #368, no? |
@paulcbetts Hmmm, maybe I got a module before that patch or someone hasn't updated their entire dependency tree. I'll wipe |
Just a heads up: If you want this to not error out in the context of Electron's main process (which it did in earlier versions), you will also need to check for |
@MarshallOfSound conflicts :( |
In the main process we shouldn't ever get to browser.js because we will have been redirected to use the node version, peep #324 |
Resetting yarn cache finally pulled in a good version of this module 👍 @paulcbetts fix works fine |
In
electron
preload scriptsdocument.documentElement
is null, this is quite a simple fix that simply checks for a good value 👍