karma-runner/karma

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

Open

#849 opened on Dec 7, 2013

View on GitHub
 (0 comments) (0 reactions) (0 assignees)JavaScript (11,918 stars) (1,703 forks)batch import
help wantedtype: backlogtype: feature

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