Fix debug calls while in a preload script inside Electron#377
Fix debug calls while in a preload script inside Electron#377MarshallOfSound wants to merge 2 commits intodebug-js:masterfrom
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.
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.
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
electronpreload scriptsdocument.documentElementis null, this is quite a simple fix that simply checks for a good value 👍