aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/api/networkinformation/connection/index.html
blob: 1afa39d9c14814f30cae0fa8996a03eb7f6cab1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
title: window.navigator.connection
slug: Web/API/NetworkInformation/connection
translation_of: Web/API/Navigator/connection
---
<p>{{ Apiref() }}</p>
<p>{{ SeeCompatTable() }}</p>
<h2 id="요약">요약</h2>
<p><a href="/ko/docs/WebAPI/Network_Information" title="/en-US/docs/WebAPI/Network_Information">네트워크 정보 API</a>는 사용자 기기의 현재 대역폭이나 연결이 과금되는 지와 같은 정보를 알려줍니다. 이를 이용해서 사용자의 연결에 기반해서 높은 품질의 콘텐츠를 제공할지 낮은 품질의 콘텐츠를 제공할지 선택할 수 있습니다.</p>
<h2 id="속성">속성</h2>
<dl>
 <dt>
  {{domxref("window.navigator.connection.bandwidth", "connection.bandwidth")}} {{ReadOnlyInline}}</dt>
 <dd>
  현재 연결에 대한 다운로드 대역폭을 MB/s 단위의 double 형태로 알려줍니다. 사용자가 오프라인일 경우는 <code>0</code>이고 알 수 없을 경우에는 <code>infinity</code>로 나옵니다.</dd>
 <dt>
  {{domxref("window.navigator.connection.metered", "connection.metered")}} {{ReadOnlyInline}}</dt>
 <dd>
  연결이 과금이 되는 경우(예를 들어 pay-per-use) <code><a href="/ko/JavaScript/Reference/Global_Objects/Boolean" title="ko/JavaScript/Reference/Global_Objects/Boolean">Boolean</a></code> 형의 <code>true</code>가 반환됩니다.</dd>
</dl>
<h3 id="이벤트_핸들러">이벤트 핸들러</h3>
<dl>
 <dt>
  {{domxref("window.navigator.connection.onchange", "connection.onchange")}}</dt>
 <dd>
  {{event("change")}} 이벤트에 대한 이벤트 핸들러 속성입니다. 연결 정보가 변경될 때 이벤트가 발생합니다.</dd>
</dl>
<div class="note">
 <p><strong>주의:</strong> <code>connection</code> 객체는 이벤트를 다루기 위한 {{domxref("EventTarget.addEventListener","addEventListener")}} 메서드를 사용할 수 있는 {{domxref("EventTarget")}}을 상속받습니다.</p>
</div>
<h2 id="Specifications" name="Specifications">명세</h2>
<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{ SpecName('Network Information', '', 'Network Information API') }}</td>
   <td>{{ Spec2('Network Information') }}</td>
   <td>Initial specification</td>
  </tr>
 </tbody>
</table>
<h2 id="브라우저_호환성">브라우저 호환성</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Chrome</th>
    <th>Firefox (Gecko)</th>
    <th>Internet Explorer</th>
    <th>Opera</th>
    <th>Safari</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>20? {{ property_prefix("webkit") }}</td>
    <td>12.0 {{ property_prefix("moz") }} (see notes)</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatNo() }}</td>
   </tr>
  </tbody>
 </table>
</div>
<div id="compat-mobile">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Android</th>
    <th>Firefox Mobile (Gecko)</th>
    <th>IE Mobile</th>
    <th>Opera Mobile</th>
    <th>Safari Mobile</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>{{ CompatNo() }}</td>
    <td>12.0 {{ property_prefix("moz") }} (see notes)</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatNo() }}</td>
   </tr>
  </tbody>
 </table>
</div>
<h3 id="Gecko_관련_내용">Gecko 관련 내용</h3>
<ul>
 <li>네트워크 API는 <code>dom.network.enabled</code> 설정을 통해 비활성화 할 수 있습니다.</li>
 <li><code>metered</code> 속성은 기본값이 <code>false</code>이고 <code>dom.network.metered</code> 설정을 통해 설정할 수 있습니다(로밍시에 과금 상태로 설정하는 방법은 {{ bug("716943") }}를 참고하세요).</li>
 <li>Gecko 12.0부터는 네트워크 API가 안드로이드 시스템에서만 사용할 수 있게 구현되어 있습니다. 리눅스({{ bug("712442") }})와 윈도우({{ bug("721306") }})에 대한 지원은 진행중입니다.</li>
 <li>Gecko 14.0이전에는 <code>navigator.mozConnection</code>{{domxref("EventTarget")}}의 인스턴스가 아니어서 <code>addEventListener()</code>를 사용할 수 없었습니다. 이 문제는 해결되었습니다.</li>
</ul>
<h2 id="관련_내용">관련 내용</h2>
<ul>
 <li><a href="/ko/docs/WebAPI/Network_Information" title="/en-US/docs/WebAPI/Network_Information">Network Information API</a></li>
 <li><a href="/ko/Online_and_offline_events" title="en/Online_and_offline_events">Online and offline events</a></li>
</ul>