aboutsummaryrefslogtreecommitdiff
path: root/files/pl/web/api/window/content/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/pl/web/api/window/content/index.html')
-rw-r--r--files/pl/web/api/window/content/index.html43
1 files changed, 43 insertions, 0 deletions
diff --git a/files/pl/web/api/window/content/index.html b/files/pl/web/api/window/content/index.html
new file mode 100644
index 0000000000..66eed370a9
--- /dev/null
+++ b/files/pl/web/api/window/content/index.html
@@ -0,0 +1,43 @@
+---
+title: window.content
+slug: Web/API/Window/content
+tags:
+ - DOM
+ - Dokumentacja_Gecko_DOM
+ - Gecko
+ - Strony_wymagające_dopracowania
+ - Wszystkie_kategorie
+translation_of: Web/API/Window/content
+---
+<p>{{ ApiRef() }}</p>
+
+<h3 id="Podsumowanie" name="Podsumowanie">Podsumowanie</h3>
+
+<p>Zwraca obiekt <a href="pl/DOM/window">Window</a> dla zawartości głównego okna. This is useful in XUL windows that have a <code>&lt;browser&gt;</code> (or <code>tabbrowser</code> or <code>&lt;iframe&gt;</code>) with <code>type="content-primary"</code> attribute on it - the most famous example is Firefox main window, <code>browser.xul</code>. In such cases, <code>content</code> returns a reference to the <code>Window</code> object for the document currently displayed in the browser. It is a shortcut for <code><var>browserRef</var>.contentWindow</code>.</p>
+
+<p>In unprivileged content (webpages), <code>content</code> is normally equivalent to <a href="pl/DOM/window.top">top</a> (except in the case of a webpage loaded in a sidebar, <code>content</code> still refers to the <code>Window</code> of the currently selected tab).</p>
+
+<p>Some examples use <code>_content</code> instead of <code>content</code>. The former has been deprecated for a long time, and you should use <code>content</code> in the new code.</p>
+
+<h3 id="Sk.C5.82adnia" name="Sk.C5.82adnia">Składnia</h3>
+
+<pre class="eval">var <var>windowObject</var> = window.content;
+</pre>
+
+<h3 id="Przyk.C5.82ad" name="Przyk.C5.82ad">Przykład</h3>
+
+<p>Executing the following code in a chrome XUL window with a <code>&lt;browser type="content-primary"/&gt;</code> element in it draws a red border around the first div on the page currently displayed in the browser:</p>
+
+<pre class="eval">content.document.getElementsByTagName("div")[0].style.border = "solid red 1px";
+</pre>
+
+<h3 id="Specyfikacja" name="Specyfikacja">Specyfikacja</h3>
+
+<p>Nie jest częścią żadnej specyfikacji.</p>
+
+<h3 id="Zobacz_tak.C5.BCe" name="Zobacz_tak.C5.BCe">Zobacz także</h3>
+
+<ul>
+ <li><a href="pl/Praca_z_oknami_w_kodzie_chrome">Praca z oknami w kodzie chrome</a></li>
+ <li>When accessing content documents from privileged code, be aware of <a href="pl/XPCNativeWrapper">XPCNativeWrappers</a>.</li>
+</ul>