karma-runner/karma

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

Open

#849 ouverte le 7 déc. 2013

Voir sur GitHub
 (0 commentaires) (0 réactions) (0 assignés)JavaScript (1 703 forks)batch import
help wantedtype: backlogtype: feature

Métriques du dépôt

Stars
 (11 918 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

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).

Guide contributeur