Comments (12)
I've confirmed that this is a bug by running:
npm run test-karma-continuous -- --browsers VisibleElectron
and toggling show: true/false
in the karma.conf.js
Though, it's strange because there's 1 less window when we do true/false, so it makes me think something is working -- just unsure what has changed ._.
I'm pretty busy so I can't guarantee an immediate turnaround time, maybe by the end of next week? (probably will be a lot sooner, I don't like known bugs sticking around too long)
from karma-electron.
Trying to tackle this, though kind of tired. We'll see how far I get
from karma-electron.
So far:
- I've upgraded to [email protected] to verify that's not the issue
- Still seeing windows show up
- When I change the target URL from Karma's location to
https://google.com/
, the browser window no longer shows up- So it's probably something Karma is doing (e.g.
window.open
or similar)
- So it's probably something Karma is doing (e.g.
from karma-electron.
- Throwing an error to find out what page Karma is launching to (because
console.log
from the Electron launcher doesn't pass through =/ - Verifying we're loading
karma/static/client.html
- Commenting out lines in that code to see what causes/stops causing the issue (looks like
karma.js
)
from karma-electron.
Yep, this is window.open
misbehaving in Electron:
- Iterated on
karma/static/karma.js
, saw it receivewindow.open
asopener
, disabled theiropener(url)
, and swapped in an identifiable one (i.e.opener('https://google.com/')
) - Verified child window is visible both when
show: true
andshow: false
(despite parent window not being)
from karma-electron.
Behavior still persists on electron@15
. Seems like this is a bug in Electron so will see if there's anything existing to watch
from karma-electron.
Ah, it seems there's a windowOpenHandler
we can configure so going to do that
from karma-electron.
Well that did remedy the issue, but now the tests are failing so it might have overdone it -- and I'm noticing a nativeWindowOpen
a few lines up that I'd like to understand. But I'm out of energy for tonight =/ Will resume another day
karma-electron/lib/electron-launcher.js
Lines 95 to 102 in bc60482
from karma-electron.
Resuming the journey on this
from karma-electron.
So it looks like the only piece of the tests that are failing right now is a Node.js parity one (i.e. module.parent
is undefined
as expected but that's not an actually defined attribute (i.e. no hasOwnProperty
), which is inconsistent =/
That being said, the nativeWindowOpen: true
a few lines up that I'd noticed was introduced in 7.0.0
as part of supporting electron@12
so that's prob fine
from karma-electron.
Ah, the module.parent
property was moved to module.__proto__
. But that also seems to just be an electron@12
-> electron@15
change so we're fine =P
I think the patch setWindowOpenHandler
will work fine. Going to create a clean branch, test it, and
from karma-electron.
This has been patched with setWindowOpenHandler
, tested, and released in 7.1.0
. Thanks again for the bug report! =D
from karma-electron.
Related Issues (20)
- How to use with karma-babel? HOT 27
- `electron` did show not nothing happen then HOT 1
- Can't import nodejs modules in an angular-cli project (Typescript) HOT 1
- Errors without stack traces coming from karma-electron? HOT 5
- running with ndb for debugging? HOT 2
- Unable to open Electron window using --show HOT 3
- Electron 5 nodeIntegration HOT 12
- Custom launcher `require` mechanism doesn't work HOT 4
- Module paths are messed up HOT 5
- Error: Karma plugin is meant to be used from within Angular CLI and will not work correctly outside of it HOT 1
- How to configure NODE_PATH for the Electron instance? HOT 24
- [feature] option like 'require', but for renderer processes. HOT 1
- Karma times out when using Electron 9 and client.useIframe = false HOT 20
- Non-context aware native modules in renderer will cause specs to error HOT 3
- [questions] Is Electron 12 supported? HOT 16
- electron V12.0.4---------require is not defined HOT 3
- ES Modules HOT 2
- "require is not defined" after update to karma-electron 7 / electron 12 HOT 12
- sqlite3 stalls with nodeIntegration true contextIsolation false HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from karma-electron.