karma-runner/karma

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

Open

#849 建立於 2013年12月7日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)JavaScript (11,918 star) (1,703 fork)batch import
help wantedtype: backlogtype: feature

描述

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

貢獻者指南

Handle blocked pop-up window (when client.useIframe false) · karma-runner/karma#849 | Good First Issue