aboutsummaryrefslogtreecommitdiff
path: root/files/ko/archive/add-ons/code_snippets/windows/index.html
blob: 00e4febdb15afebeab99766f86888f455864ea3f (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
---
title: Windows
slug: Archive/Add-ons/Code_snippets/Windows
tags:
  - Add-ons
  - Extensions
translation_of: Archive/Add-ons/Code_snippets/Windows
---
<p> </p>
<h3 id=".EC.83.88_.EB.B8.8C.EB.9D.BC.EC.9A.B0.EC.A0.80_.EC.B0.BD_.EC.97.B4.EA.B8.B0" name=".EC.83.88_.EB.B8.8C.EB.9D.BC.EC.9A.B0.EC.A0.80_.EC.B0.BD_.EC.97.B4.EA.B8.B0">새 브라우저 창 열기</h3>
<p>브라우저 창을 새로 열려면 간단히 <code>window.open()</code>을 쓸 수 있습니다. 그러나 <code>window.open()</code>은 브라우저 창 자체가 아닌 내용의 <code>Window</code> 객체를 반환합니다. 그래서 먼저 크롬 <code>Window</code>를 구해야 합니다. 가장 간단한 방법은 <a href="ko/NsIWindowMediator">nsIWindowMediator</a>를 쓰는 것입니다.</p>
<h4 id=".EC.98.88.EC.A0.9C" name=".EC.98.88.EC.A0.9C">예제</h4>
<p> </p>
<pre class="eval">window.open();
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
                   .getService(Components.interfaces.nsIWindowMediator);
var newWindow = wm.getMostRecentWindow("navigator:browser");
var b = newWindow.getBrowser();
// why did we do this? we never do anything with |b|
</pre>
<h3 id=".EB.8B.A4.EB.A5.B8_.EB.AC.B8.EC.84.9C" name=".EB.8B.A4.EB.A5.B8_.EB.AC.B8.EC.84.9C">다른 문서</h3>
<ul>
 <li><a href="ko/Working_with_windows_in_chrome_code">크롬 코드에서 창 다루기</a></li>
</ul>
<p>{{ languages( { "en": "en/Code_snippets/Windows", "fr": "fr/Extraits_de_code/Onglets_de_navigation" } ) }}</p>