diff options
Diffstat (limited to 'files/id/mozilla/add-ons/webextensions/api')
5 files changed, 0 insertions, 368 deletions
diff --git a/files/id/mozilla/add-ons/webextensions/api/browsersettings/index.html b/files/id/mozilla/add-ons/webextensions/api/browsersettings/index.html deleted file mode 100644 index 2372f738e0..0000000000 --- a/files/id/mozilla/add-ons/webextensions/api/browsersettings/index.html +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: browserSettings -slug: Mozilla/Add-ons/WebExtensions/API/browserSettings -translation_of: Mozilla/Add-ons/WebExtensions/API/browserSettings ---- -<div>{{AddonSidebar}}</div> - -<div>Enables an extension to modify certain global browser settings. Each property of this API is a {{WebExtAPIRef("types.BrowserSetting", "BrowserSetting")}} object, providing the ability to modify a particular setting.</div> - -<div></div> - -<div>Because these are global settings, it's possible for extensions to conflict. See the documentation for <code><a href="/en-US/Add-ons/WebExtensions/API/types/BrowserSetting/set">BrowserSetting.set()</a></code> for details of how conflicts are handled.</div> - -<div></div> - -<div> -<p>To use this API you need to have the "browserSettings" <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions">permission</a>.</p> -</div> - -<h2 id="Properties">Properties</h2> - -<dl> - <dt>{{WebExtAPIRef("browserSettings.allowPopupsForUserEvents")}}</dt> - <dd>Determines whether code running in web pages can display popups in response to user events.</dd> - <dt>{{WebExtAPIRef("browserSettings.cacheEnabled")}}</dt> - <dd>Determines whether the browser cache is enabled or not.</dd> - <dt>{{WebExtAPIRef("browserSettings.closeTabsByDoubleClick")}}</dt> - <dd>Determines whether the selected tab can be closed with a double click.</dd> - <dt>{{WebExtAPIRef("browserSettings.contextMenuShowEvent")}}</dt> - <dd>Determines the mouse event that triggers a context menu popup.</dd> - <dt>{{WebExtAPIRef("browserSettings.ftpProtocolEnabled")}}</dt> - <dd>Determines whether the FTP protocol is enabled.</dd> - <dt>{{WebExtAPIRef("browserSettings.homepageOverride")}}</dt> - <dd>Read the value of the browser's home page.</dd> - <dt>{{WebExtAPIRef("browserSettings.imageAnimationBehavior")}}</dt> - <dd>Determines how the browser treats animated images.</dd> - <dt>{{WebExtAPIRef("browserSettings.newTabPageOverride")}}</dt> - <dd>Reads the value of the browser's new tab page.</dd> - <dt>{{WebExtAPIRef("browserSettings.newTabPosition")}}</dt> - <dd>Controls the position of newly opened tabs relative to already open tabs.</dd> - <dt>{{WebExtAPIRef("browserSettings.openBookmarksInNewTabs")}}</dt> - <dd>Determines whether bookmarks are opened in the current tab or a new tab.</dd> - <dt>{{WebExtAPIRef("browserSettings.openSearchResultsInNewTabs")}}</dt> - <dd>Determines whether search results are opened in the current tab or a new tab.</dd> - <dt>{{WebExtAPIRef("browserSettings.openUrlbarResultsInNewTabs")}}</dt> - <dd>Determines whether address bar autocomplete suggestions are opened in the current tab or a new tab.</dd> - <dt>{{WebExtAPIRef("browserSettings.overrideDocumentColors")}}</dt> - <dd>Controls whether the user-chosen colors override the page's colors.</dd> - <dt>{{WebExtAPIRef("browserSettings.useDocumentFonts")}}</dt> - <dd>Controls whether the browser will use the fonts specified by a web page or use only built-in fonts.</dd> - <dt>{{WebExtAPIRef("browserSettings.webNotificationsDisabled")}}</dt> - <dd>Prevents websites from showing notifications using the <code><a href="/en-US/docs/Web/API/notification">Notification</a></code> Web API.</dd> - <dt>{{WebExtAPIRef("browserSettings.zoomFullPage")}}</dt> - <dd>Controls whether zoom is applied to the entire page or to text only.</dd> - <dt>{{WebExtAPIRef("browserSettings.zoomSiteSpecific")}}</dt> - <dd>Controls whether page zoom is applied on a per-site or per-tab basis. If {{WebExtAPIRef("privacy.websites")}}<code>.resistFingerprinting</code> is true, this setting has no effect and zoom is applied on a per-tab basis.</dd> -</dl> - -<h2 id="Browser_compatibility">Browser compatibility</h2> - -<p>{{Compat("webextensions.api.browserSettings")}}</p> - -<p>{{WebExtExamples("h2")}}</p> diff --git a/files/id/mozilla/add-ons/webextensions/api/index.html b/files/id/mozilla/add-ons/webextensions/api/index.html deleted file mode 100644 index 9b63bd59e8..0000000000 --- a/files/id/mozilla/add-ons/webextensions/api/index.html +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: JavaScript APIs -slug: Mozilla/Add-ons/WebExtensions/API -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Add-ons/WebExtensions/API ---- -<div>{{AddonSidebar}}</div> - -<div> -<p>The WebExtension JavaScript APIs can be used inside the add-on's <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Anatomy_of_a_WebExtension#Background_scripts">background scripts</a> and in any <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/User_interface_components#Browser_actions">browser action</a> or <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/User_interface_components#Page_actions">page action</a> popups that the add-on defines. A few of these APIs can also be accessed by an add-on's <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Anatomy_of_a_WebExtension#Content_scripts">content scripts</a> (see the <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Content_scripts#WebExtension_APIs">list in the content script guide</a>).</p> - -<p>To use the more powerful APIs you need to <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/permissions">request permission</a> in your add-on's manifest.json.</p> - -<p>You can access the APIs using the <code>browser</code> namespace:</p> - -<pre class="brush: js line-numbers language-js"><code class="language-js"><span class="keyword token">function</span> <span class="function token">logTabs</span><span class="punctuation token">(</span>tabs<span class="punctuation token">)</span> <span class="punctuation token">{</span> - console<span class="punctuation token">.</span><span class="function token">log</span><span class="punctuation token">(</span>tabs<span class="punctuation token">)</span><span class="punctuation token">;</span> -<span class="punctuation token">}</span> - -browser<span class="punctuation token">.</span>tabs<span class="punctuation token">.</span><span class="function token">query</span><span class="punctuation token">(</span><span class="punctuation token">{</span>currentWindow<span class="punctuation token">:</span> <span class="keyword token">true</span><span class="punctuation token">}</span><span class="punctuation token">,</span> logTabs<span class="punctuation token">)</span><span class="punctuation token">;</span></code></pre> -</div> - -<div> -<p>Many of the APIs are asynchronous, returning a <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:</p> - -<pre class="brush: js line-numbers language-js"><code class="language-js"><span class="keyword token">function</span> <span class="function token">logCookie</span><span class="punctuation token">(</span>c<span class="punctuation token">)</span> <span class="punctuation token">{</span> - console<span class="punctuation token">.</span><span class="function token">log</span><span class="punctuation token">(</span>c<span class="punctuation token">)</span><span class="punctuation token">;</span> -<span class="punctuation token">}</span> - -<span class="keyword token">function</span> <span class="function token">logError</span><span class="punctuation token">(</span>e<span class="punctuation token">)</span> <span class="punctuation token">{</span> - console<span class="punctuation token">.</span><span class="function token">error</span><span class="punctuation token">(</span>e<span class="punctuation token">)</span><span class="punctuation token">;</span> -<span class="punctuation token">}</span> - -<span class="keyword token">var</span> setCookie <span class="operator token">=</span> browser<span class="punctuation token">.</span>cookies<span class="punctuation token">.</span><span class="keyword token">set</span><span class="punctuation token">(</span> - <span class="punctuation token">{</span>url<span class="punctuation token">:</span> <span class="string token">"https://developer.mozilla.org/"</span><span class="punctuation token">}</span> -<span class="punctuation token">)</span><span class="punctuation token">;</span> -setCookie<span class="punctuation token">.</span><span class="function token">then</span><span class="punctuation token">(</span>logCookie<span class="punctuation token">,</span> logError<span class="punctuation token">)</span><span class="punctuation token">;</span></code></pre> -</div> - -<div> -<p>Note that this is different from Google Chrome's extension system, which uses the <code>chrome</code> namespace instead of <code>browser</code>, and which uses callbacks instead of promises for asynchronous functions. As a porting aid, the Firefox implementation of WebExtensions supports <code>chrome</code> and callbacks as well as <code>browser</code> and promises. Mozilla has also written a polyfill which enables code that uses <code>browser</code> and promises to work unchanged in Chrome: <a class="external external-icon" href="https://github.com/mozilla/webextension-polyfill">https://github.com/mozilla/webextension-polyfill</a>.</p> - -<p>Microsoft Edge uses the <code>browser</code> namespace, but doesn't yet support promise-based asynchronous APIs. In Edge, for the time being, asynchronous APIs must use callbacks.</p> - -<p>Not all browsers support all the APIs: for the details, see <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Browser_support_for_JavaScript_APIs">Browser support for JavaScript APIs</a>.</p> -</div> - -<div>{{SubpagesWithSummaries}}</div> diff --git a/files/id/mozilla/add-ons/webextensions/api/notifications/index.html b/files/id/mozilla/add-ons/webextensions/api/notifications/index.html deleted file mode 100644 index 76b0e1cfe0..0000000000 --- a/files/id/mozilla/add-ons/webextensions/api/notifications/index.html +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: notifikasi -slug: Mozilla/Add-ons/WebExtensions/API/notifications -tags: - - API - - Add-ons - - Ekstensi - - Notifikasi - - WebExtensions -translation_of: Mozilla/Add-ons/WebExtensions/API/notifications -original_slug: Mozilla/Add-ons/WebExtensions/API/notifikasi ---- -<div>{{AddonSidebar}}</div> - -<p>Tampilkan pemberitahuan kepada pengguna, menggunakan mekanisme pemberitahuan sistem operasi yang mendasarinya. Karena API ini menggunakan mekanisme pemberitahuan sistem operasi, detail tentang bagaimana pemberitahuan muncul dan berperilaku mungkin berbeda sesuai dengan sistem operasi dan pengaturan pengguna.</p> - -<p>Untuk menggunakan API ini Anda harus memiliki izin "notifikasi"</p> - -<h2 id="Tipe">Tipe</h2> - -<dl> - <dt>{{WebExtAPIRef("notifications.NotificationOptions")}}</dt> - <dd>Menentukan isi pemberitahuan.</dd> - <dt>{{WebExtAPIRef("notifications.TemplateType")}}</dt> - <dd>Jenis pemberitahuan. Misalnya, ini menentukan apakah pemberitahuan dapat memuat gambar.</dd> -</dl> - -<h2 id="Fungsi">Fungsi</h2> - -<dl> - <dt>{{WebExtAPIRef("notifications.clear()")}}</dt> - <dd>Hapus pemberitahuan khusus, berikan ID-nya.</dd> - <dt>{{WebExtAPIRef("notifications.create()")}}</dt> - <dd>Buat dan tampilkan pemberitahuan baru.</dd> - <dt>{{WebExtAPIRef("notifications.getAll()")}}</dt> - <dd>Dapatkan semua notifikasi.</dd> - <dt>{{WebExtAPIRef("notifications.update()")}}</dt> - <dd>Perbarui notifikasi</dd> -</dl> - -<h2 id="Events">Events</h2> - -<dl> - <dt>{{WebExtAPIRef("notifications.onButtonClicked")}}</dt> - <dd>Dipecat ketika pengguna mengklik tombol di notifikasi.</dd> - <dt>{{WebExtAPIRef("notifications.onClicked")}}</dt> - <dd>Dipecat ketika pengguna mengklik pemberitahuan, tetapi tidak pada tombol.</dd> - <dt>{{WebExtAPIRef("notifications.onClosed")}}</dt> - <dd>Dipecat ketika pemberitahuan ditutup, baik oleh sistem atau karena pengguna memecatnya.</dd> - <dt>{{WebExtAPIRef("notifications.onShown")}}</dt> - <dd>Dipecat segera setelah pemberitahuan telah ditampilkan.</dd> -</dl> - -<h2 id="Kompatibilitas_peramban">Kompatibilitas peramban</h2> - -<p>{{Compat("webextensions.api.notifications")}}</p> - -<p>{{WebExtExamples("h2")}}</p> - -<div class="note"><strong>Ucapan terima kasih</strong> - -<p>API ini berdasarkan pada API Chromium <a href="https://developer.chrome.com/extensions/notifications"><code>chrome.notifications</code></a>.</p> -</div> diff --git a/files/id/mozilla/add-ons/webextensions/api/windows/createtype/index.html b/files/id/mozilla/add-ons/webextensions/api/windows/createtype/index.html deleted file mode 100644 index 569dbc0b97..0000000000 --- a/files/id/mozilla/add-ons/webextensions/api/windows/createtype/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: windows.CreateType -slug: Mozilla/Add-ons/WebExtensions/API/windows/CreateType -translation_of: Mozilla/Add-ons/WebExtensions/API/windows/CreateType ---- -<div>{{AddonSidebar()}}</div> - -<p>Menentukan jenis browser window yang akan dibuat.</p> - -<h2 id="Tipe">Tipe</h2> - -<p>Nilai dari tipe ini adalah <code>strings</code>. Nilai yang tersedia adalah:</p> - -<ul> - <li><code>"normal"</code></li> - <li><code>"popup"</code></li> - <li><code>"panel"</code></li> - <li><code>"detached_panel"</code></li> -</ul> - -<h2 id="Browser_compatibility">Browser compatibility</h2> - -<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> - -<p>{{Compat("webextensions.api.windows.CreateType")}}</p> - -<p>{{WebExtExamples}}</p> - -<div class="note"><strong>Acknowledgements</strong> - -<p>This API is based on Chromium's <a href="https://developer.chrome.com/extensions/windows#type-CreateType"><code>chrome.windows</code></a> API. This documentation is derived from <a href="https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/windows.json"><code>windows.json</code></a> in the Chromium code.</p> - -<p>Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.</p> -</div> - -<div class="hidden"> -<pre>// Copyright 2015 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -</pre> -</div> diff --git a/files/id/mozilla/add-ons/webextensions/api/windows/index.html b/files/id/mozilla/add-ons/webextensions/api/windows/index.html deleted file mode 100644 index d0611824cd..0000000000 --- a/files/id/mozilla/add-ons/webextensions/api/windows/index.html +++ /dev/null @@ -1,127 +0,0 @@ ---- -title: windows -slug: Mozilla/Add-ons/WebExtensions/API/windows -tags: - - API - - Add-ons - - Extensions - - Interface - - NeedsTranslation - - Non-standard - - Reference - - TopicStub - - WebExtensions - - Windows -translation_of: Mozilla/Add-ons/WebExtensions/API/windows ---- -<div>{{AddonSidebar}}</div> - -<p>Interact with browser windows. You can use this API to get information about open windows and to open, modify, and close windows. You can also listen for window open, close, and activate events.</p> - -<h2 id="Types">Types</h2> - -<dl> - <dt>{{WebExtAPIRef("windows.WindowType")}}</dt> - <dd>The type of browser window this is.</dd> - <dt>{{WebExtAPIRef("windows.WindowState")}}</dt> - <dd>The state of this browser window.</dd> - <dt>{{WebExtAPIRef("windows.Window")}}</dt> - <dd>Contains information about a browser window.</dd> - <dt>{{WebExtAPIRef("windows.CreateType")}}</dt> - <dd>Specifies the type of browser window to create.</dd> -</dl> - -<h2 id="Properties">Properties</h2> - -<dl> - <dt>{{WebExtAPIRef("windows.WINDOW_ID_NONE")}}</dt> - <dd>The <code>windowId</code> value that represents the absence of a browser window.</dd> - <dt>{{WebExtAPIRef("windows.WINDOW_ID_CURRENT")}}</dt> - <dd>The <code>windowId</code> value that represents the current window.</dd> -</dl> - -<h2 id="Functions">Functions</h2> - -<dl> - <dt>{{WebExtAPIRef("windows.get()")}}</dt> - <dd>Gets details about a window, given its ID.</dd> - <dt>{{WebExtAPIRef("windows.getCurrent()")}}</dt> - <dd>Gets the current window.</dd> - <dt>{{WebExtAPIRef("windows.getLastFocused()")}}</dt> - <dd>Gets the window that was most recently focused — typically the window 'on top'.</dd> - <dt>{{WebExtAPIRef("windows.getAll()")}}</dt> - <dd>Gets all windows.</dd> - <dt>{{WebExtAPIRef("windows.create()")}}</dt> - <dd> - <p>Creates a new window.</p> - </dd> - <dt>{{WebExtAPIRef("windows.update()")}}</dt> - <dd>Updates the properties of a window. Use this to move, resize, and (un)focus a window, etc.</dd> - <dt>{{WebExtAPIRef("windows.remove()")}}</dt> - <dd>Closes a window, and all its tabs.</dd> -</dl> - -<h2 id="Events">Events</h2> - -<dl> - <dt>{{WebExtAPIRef("windows.onCreated")}}</dt> - <dd>Fired when a window is created.</dd> - <dt>{{WebExtAPIRef("windows.onRemoved")}}</dt> - <dd>Fired when a window is closed.</dd> - <dt>{{WebExtAPIRef("windows.onFocusChanged")}}</dt> - <dd>Fired when the currently focused window changes.</dd> -</dl> - -<h2 id="Browser_compatibility">Browser compatibility</h2> - -<p>{{Compat("webextensions.api.windows")}}</p> - -<div class="hidden note"> -<p>The "Chrome incompatibilities" section is included from <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Chrome_incompatibilities"> https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Chrome_incompatibilities</a> using the <a href="/en-US/docs/Template:WebExtChromeCompat">WebExtChromeCompat</a> macro.</p> - -<p>If you need to update this content, edit <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Chrome_incompatibilities">https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Chrome_incompatibilities</a>, then shift-refresh this page to see your changes.</p> -</div> - -<h3 id="Edge_incompatibilities">Edge incompatibilities</h3> - -<p>Promises are not supported in Edge. Use callbacks instead.</p> - -<p>{{WebExtExamples("h2")}}</p> - -<div class="note"><strong>Acknowledgements</strong> - -<p>This API is based on Chromium's <a href="https://developer.chrome.com/extensions/windows"><code>chrome.windows</code></a> API. This documentation is derived from <a href="https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/windows.json"><code>windows.json</code></a> in the Chromium code.</p> - -<p>Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.</p> -</div> - -<div class="hidden"> -<pre>// Copyright 2015 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -</pre> -</div> |