karma-runner / karma-runner/karma

Handle blocked pop-up window (when client.useIframe false)

Open
#849 0 comments 0 reactions 0 assignees View on GitHub
help wanted type: backlog type: feature
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

By default, Chrome (and probably all other browsers too) will block the pop-up window. This results in super weird behavior - browser starts execution (it thinks it's executing), but never really starts. Even the user clicks "open the window", Karma won't start executing, the user has to "allow pop-ups" and restart the browser.
1. All the browser launchers should pass `--disable-popup-blocking`.
2. We need a timeout on the client, if `client.useIframe false` (using new window) and the child window does not call `setupContext` we should display a warning to the user "Hey, your browser is probably blocking the pop-up window".
3. `window.open` returns undefined if the window is blocked (https://github.com/karma-runner/karma/blob/master/client/karma.js#L29), we should open directly the "executing url" (rather than "about:blank"), so that when the user opens the window, the execution starts. Then, we need to update the `childWindow` reference inside `setupContext` (so that we have it for future runs).

Contributor guide

Open the contributing guide

Research direction

Start with the browser launcher configuration and client/karma.js, especially the window.open path and setupContext handling. Trace how client.useIframe false starts execution and how browser launchers build their arguments. Done means pop-up blocking is disabled for launchers, blocked windows produce the specified warning, and opening the executing URL allows setupContext to refresh the childWindow reference.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.