|
4 | 4 | <div class="section-wrapper">
|
5 | 5 | <h1>
|
6 | 6 | <svg class="section-icon"><use xlink:href="assets/img/icons.svg#icon-windows"></use></svg>
|
7 |
| - Handling Window Crashes and Hangs |
| 7 | + ハングとクラッシュのハンドリング |
8 | 8 | </h1>
|
9 |
| - <h3>The <code>BrowserWindow</code> module will emit events when the renderer process crashes or hangs. You can listen for these events and give users the chance to reload, wait or close that window.</h3> |
| 9 | + <h3> |
| 10 | + <code>BrowserWindow</code>モジュールは、レンダラープロセスがクラッシュまたはハングしたときにイベントを発行します。<br> |
| 11 | + これらのイベントリスナーを使うことで、ユーザーに再読み込み、待機、またはウィンドウを閉じる選択肢が与えることができます。 |
| 12 | + </h3> |
10 | 13 |
|
11 |
| - <p>Open the <a href="http://electron.atom.io/docs/api/browser-window">full API documentation<span class="u-visible-to-screen-reader">(opens in new window)</span></a> in your browser.</p> |
| 14 | + <p>ブラウザで<a href="http://electron.atom.io/docs/api/browser-window">APIドキュメント<span class="u-visible-to-screen-reader">(新しいウィンドウが開きます。)</span></a>を開きます。</p> |
12 | 15 | </div>
|
13 | 16 | </header>
|
14 | 17 |
|
15 | 18 | <div class="demo">
|
16 | 19 | <div class="demo-wrapper">
|
17 |
| - <button id="new-window-crashes-demo-toggle" class="js-container-target demo-toggle-button">Relaunch window after the process crashes |
| 20 | + <button id="new-window-crashes-demo-toggle" class="js-container-target demo-toggle-button">プロセスがクラッシュした後にウィンドウを再起動する |
18 | 21 | <div class="demo-meta u-avoid-clicks">Supports: Win, macOS, Linux <span class="demo-meta-divider">|</span> Process: Main</div>
|
19 | 22 | </button>
|
20 | 23 | <div class="demo-box">
|
21 | 24 | <div class="demo-controls">
|
22 | 25 | <button class="demo-button" id="process-crash">View Demo</button>
|
23 | 26 | </div>
|
24 |
| - <p>In this demo we create a new window (via the <code>remote</code> module) and provide a link that will force a crash using <code>process.crash()</code>.</p> |
25 |
| - <p>The window is listening for the crash event and when the event occurs it prompts the user with two options: reload or close.</p> |
| 27 | + <p>このデモでは、(<code>remote</code>モジュールを介して)新しいウィンドウを作成し、<code>process.crash()</code>を使って強制的にクラッシュさせます。</p> |
| 28 | + <p>ウィンドウのクラッシュイベントリスナーを使って、イベントが発生した時、リロードまたは閉じるという2つのオプションでプロンプトを表示します。</p> |
26 | 29 |
|
27 |
| - <h5>Renderer Process</h5> |
| 30 | + <h5>レンダラープロセス</h5> |
28 | 31 | <pre><code data-path="renderer-process/windows/process-crash.js"></code></pre>
|
29 | 32 | </div>
|
30 | 33 | </div>
|
31 | 34 | </div>
|
32 | 35 |
|
33 | 36 | <div class="demo">
|
34 | 37 | <div class="demo-wrapper">
|
35 |
| - <button id="new-window-hangs-demo-toggle" class="js-container-target demo-toggle-button">Relaunch window after the process hangs |
| 38 | + <button id="new-window-hangs-demo-toggle" class="js-container-target demo-toggle-button">プロセスがハングした後にウィンドウを再起動する |
36 | 39 | <div class="demo-meta u-avoid-clicks">Supports: Win, macOS, Linux <span class="demo-meta-divider">|</span> Process: Main</div>
|
37 | 40 | </button>
|
38 | 41 | <div class="demo-box">
|
39 | 42 | <div class="demo-controls">
|
40 | 43 | <button class="demo-button" id="process-hang">View Demo</button>
|
41 | 44 | </div>
|
42 |
| - <p>In this demo we create a new window (via the <code>remote</code> module) and provide a link that will force the process to hang using <code>process.hang()</code>.</p> |
43 |
| - <p>The window is listening for the process to become officially unresponsive (this can take up to 30 seconds). When this event occurs it prompts the user with two options: reload or close.</p> |
| 45 | + <p>このデモでは、(<code>remote</code>モジュールを介して)新しいウィンドウを作成し、<code>process.hang()</code>を使って強制的にハングさせます。</p> |
| 46 | + <p> |
| 47 | + ウィンドウは、プロセスが正式に応答しなくなるまでを待機します。(これには最大30秒かかる場合があります)<br> |
| 48 | + イベントが発生すると、リロードまたは閉じるという2つのオプションでプロンプトを表示します。 |
| 49 | + </p> |
44 | 50 |
|
45 |
| - <h5>Renderer Process</h5> |
| 51 | + <h5>レンダラープロセス</h5> |
46 | 52 | <pre><code data-path="renderer-process/windows/process-hang.js"></code></pre>
|
47 | 53 |
|
48 | 54 | <div class="demo-protip">
|
49 | 55 | <h2>ProTip</h2>
|
50 |
| - <strong>Wait for the process to become responsive again.</strong> |
51 |
| - <p>A third option in the case of a process that is hanging is to wait and see if the problem resolves, allowing the process to become responsive again. To do this, use the <code>BrowserWindow</code> event 'responsive' as shown below.</p> |
| 56 | + <strong>プロセスが再び応答するまで待つ</strong> |
| 57 | + <p> |
| 58 | + プロセスがハングしている場合の第3のオプションは、待機して問題が解決するかどうかを確認し、再度プロセスが応答可能になるようにすることです。<br> |
| 59 | + オプションを使うためには、以下のように<code>BrowserWindow</code>イベントの'responsive'を使用します。 |
| 60 | + </p> |
52 | 61 | <pre><code class="language-js">win.on('responsive', function () {
|
53 |
| - // Do something when the window is responsive again |
| 62 | + // ウィンドウが再び反応したときの処理 |
54 | 63 | })</code></pre>
|
55 | 64 | </div>
|
56 | 65 | </div>
|
|
0 commit comments