diff --git a/files/ko/mozilla/add-ons/webextensions/api/menus/create/index.md b/docs/ko/fully_untranslated_files/Mozilla_Add-ons_WebExtensions_API_menus_create.md similarity index 100% rename from files/ko/mozilla/add-ons/webextensions/api/menus/create/index.md rename to docs/ko/fully_untranslated_files/Mozilla_Add-ons_WebExtensions_API_menus_create.md diff --git a/files/ko/_redirects.txt b/files/ko/_redirects.txt index 2b168a613d5546..8083f649a4b51a 100644 --- a/files/ko/_redirects.txt +++ b/files/ko/_redirects.txt @@ -350,49 +350,34 @@ /ko/docs/MathML /ko/docs/Web/MathML /ko/docs/Mozilla/Add-ons/WebExtensions/API/contextMenus /ko/docs/Mozilla/Add-ons/WebExtensions/API/menus /ko/docs/Mozilla/Add-ons/WebExtensions/API/contextMenus/ContextType /ko/docs/Mozilla/Add-ons/WebExtensions/API/menus/ContextType -/ko/docs/Mozilla/Add-ons/WebExtensions/API/contextMenus/create /ko/docs/Mozilla/Add-ons/WebExtensions/API/menus/create /ko/docs/Mozilla/Add-ons/WebExtensions/API/contextMenus/getTargetElement /ko/docs/Mozilla/Add-ons/WebExtensions/API/menus/getTargetElement -/ko/docs/Mozilla/Add-ons/WebExtensions/API/contextMenus/onShown /ko/docs/Mozilla/Add-ons/WebExtensions/API/menus/onShown /ko/docs/Mozilla/Add-ons/WebExtensions/Prerequisites /ko/docs/orphaned/Mozilla/Add-ons/WebExtensions/Prerequisites /ko/docs/Mozilla/애드온들 /ko/docs/Mozilla/Add-ons /ko/docs/Mozilla/애드온들/AMO/Policy/Featured https://extensionworkshop.com/documentation/publish/recommended-extensions/ /ko/docs/Mozilla/애드온들/Listing https://extensionworkshop.com/documentation/develop/create-an-appealing-listing/ /ko/docs/Mozilla/애드온들/WebExtensions /ko/docs/Mozilla/Add-ons/WebExtensions -/ko/docs/Mozilla/애드온들/WebExtensions/API /ko/docs/Mozilla/Add-ons/WebExtensions/API -/ko/docs/Mozilla/애드온들/WebExtensions/API/browsingData /ko/docs/Mozilla/Add-ons/WebExtensions/API/browsingData /ko/docs/Mozilla/애드온들/WebExtensions/API/contentScripts /ko/docs/Mozilla/Add-ons/WebExtensions/API/contentScripts /ko/docs/Mozilla/애드온들/WebExtensions/API/contextMenus /ko/docs/Mozilla/Add-ons/WebExtensions/API/menus /ko/docs/Mozilla/애드온들/WebExtensions/API/contextMenus/ContextType /ko/docs/Mozilla/Add-ons/WebExtensions/API/menus/ContextType -/ko/docs/Mozilla/애드온들/WebExtensions/API/contextMenus/create /ko/docs/Mozilla/Add-ons/WebExtensions/API/menus/create /ko/docs/Mozilla/애드온들/WebExtensions/API/contextMenus/getTargetElement /ko/docs/Mozilla/Add-ons/WebExtensions/API/menus/getTargetElement -/ko/docs/Mozilla/애드온들/WebExtensions/API/contextMenus/onShown /ko/docs/Mozilla/Add-ons/WebExtensions/API/menus/onShown /ko/docs/Mozilla/애드온들/WebExtensions/API/pageAction /ko/docs/Mozilla/Add-ons/WebExtensions/API/pageAction /ko/docs/Mozilla/애드온들/WebExtensions/API/pageAction/show /ko/docs/Mozilla/Add-ons/WebExtensions/API/pageAction/show /ko/docs/Mozilla/애드온들/WebExtensions/API/storage /ko/docs/Mozilla/Add-ons/WebExtensions/API/storage -/ko/docs/Mozilla/애드온들/WebExtensions/API/storage/StorageArea /ko/docs/Mozilla/Add-ons/WebExtensions/API/storage/StorageArea /ko/docs/Mozilla/애드온들/WebExtensions/API/storage/StorageArea/get /ko/docs/Mozilla/Add-ons/WebExtensions/API/storage/StorageArea/get /ko/docs/Mozilla/애드온들/WebExtensions/API/storage/StorageArea/set /ko/docs/Mozilla/Add-ons/WebExtensions/API/storage/StorageArea/set /ko/docs/Mozilla/애드온들/WebExtensions/API/storage/local /ko/docs/Mozilla/Add-ons/WebExtensions/API/storage/local /ko/docs/Mozilla/애드온들/WebExtensions/API/storage/sync /ko/docs/Mozilla/Add-ons/WebExtensions/API/storage/sync -/ko/docs/Mozilla/애드온들/WebExtensions/API/tabs /ko/docs/Mozilla/Add-ons/WebExtensions/API/tabs /ko/docs/Mozilla/애드온들/WebExtensions/API/tabs/create /ko/docs/Mozilla/Add-ons/WebExtensions/API/tabs/create -/ko/docs/Mozilla/애드온들/WebExtensions/API/tabs/insertCSS /ko/docs/Mozilla/Add-ons/WebExtensions/API/tabs/insertCSS -/ko/docs/Mozilla/애드온들/WebExtensions/API/webRequest /ko/docs/Mozilla/Add-ons/WebExtensions/API/webRequest -/ko/docs/Mozilla/애드온들/WebExtensions/API/webRequest/onBeforeRequest /ko/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/onBeforeRequest /ko/docs/Mozilla/애드온들/WebExtensions/Anatomy_of_a_WebExtension /ko/docs/Mozilla/Add-ons/WebExtensions/Anatomy_of_a_WebExtension /ko/docs/Mozilla/애드온들/WebExtensions/Examples /ko/docs/Mozilla/Add-ons/WebExtensions/Examples /ko/docs/Mozilla/애드온들/WebExtensions/Package_your_extension_ https://extensionworkshop.com/documentation/publish/package-your-extension/ /ko/docs/Mozilla/애드온들/WebExtensions/Porting_a_Google_Chrome_extension https://extensionworkshop.com/documentation/develop/porting-a-google-chrome-extension/ /ko/docs/Mozilla/애드온들/WebExtensions/Prerequisites /ko/docs/orphaned/Mozilla/Add-ons/WebExtensions/Prerequisites /ko/docs/Mozilla/애드온들/WebExtensions/Temporary_Installation_in_Firefox https://extensionworkshop.com/documentation/develop/temporary-installation-in-firefox/ -/ko/docs/Mozilla/애드온들/WebExtensions/User_actions /ko/docs/Mozilla/Add-ons/WebExtensions/User_actions /ko/docs/Mozilla/애드온들/WebExtensions/What_are_WebExtensions /ko/docs/Mozilla/Add-ons/WebExtensions/What_are_WebExtensions /ko/docs/Mozilla/애드온들/WebExtensions/Your_first_WebExtension /ko/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension /ko/docs/Mozilla/애드온들/WebExtensions/Your_second_WebExtension /ko/docs/Mozilla/Add-ons/WebExtensions/Your_second_WebExtension /ko/docs/Mozilla/애드온들/WebExtensions/manifest.json /ko/docs/Mozilla/Add-ons/WebExtensions/manifest.json -/ko/docs/Mozilla/애드온들/WebExtensions/manifest.json/content_scripts /ko/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts -/ko/docs/Mozilla/애드온들/WebExtensions/manifest.json/page_action /ko/docs/Mozilla/Add-ons/WebExtensions/manifest.json/page_action -/ko/docs/Mozilla/애드온들/WebExtensions/user_interface /ko/docs/Mozilla/Add-ons/WebExtensions/user_interface /ko/docs/Mozilla/애드온들/WebExtensions/user_interface/Page_actions /ko/docs/Mozilla/Add-ons/WebExtensions/user_interface/Page_actions /ko/docs/Mozilla_Quirks_Mode_Behavior /ko/docs/Web/HTML/Quirks_Mode_and_Standards_Mode /ko/docs/Navigation_timing /ko/docs/Web/API/Performance_API/Navigation_timing diff --git a/files/ko/mozilla/add-ons/webextensions/api/browsingdata/index.md b/files/ko/mozilla/add-ons/webextensions/api/browsingdata/index.md deleted file mode 100644 index 457420096b009a..00000000000000 --- a/files/ko/mozilla/add-ons/webextensions/api/browsingdata/index.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: browsingData -slug: Mozilla/Add-ons/WebExtensions/API/browsingData ---- - -{{AddonSidebar}} - -WebExtensions 을 통해 사용자가 브라우저를 사용하는 동안 축적된 데이터를 삭제할 수 있는 기능을 제공합니다. - -`browsingData` API는 브라우징 데이터를 다음과 같은 타입으로 구분합니다: - -- 브라우저 캐시 -- 쿠키 -- 다운로드 -- 히스토리 -- 플러그인 데이터 -- 저장된 폼 데이터 -- 저장된 비밀번호saved passwords - -You can use the {{WebExtAPIRef("browsingData.remove()")}} function to remove any combination of these types. There are also dedicated functions to remove each particular type of data, such as {{WebExtAPIRef("browsingData.removePasswords()", "removePasswords()")}}, {{WebExtAPIRef("browsingData.removeHistory()", "removeHistory()")}} and so on. - -All the `browsingData.remove[X]()` functions take a {{WebExtAPIRef("browsingData.RemovalOptions")}} object, which you can use to control two further aspects of data removal: - -- how far back in time to remove data -- whether to remove data only from normal web pages, or also from hosted web apps and add-ons. Note that this option is not yet supported in Firefox. - -Finally, this API gives you a {{WebExtAPIRef("browsingData.settings()")}} function that gives you the current value of the settings for the browser's built-in "Clear History" feature. - -To use this API you must have the "browsingData" [API permission](/ko/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions#api_permissions). - -## Types - -- {{WebExtAPIRef("browsingData.DataTypeSet")}} - - : Object used to specify the type of data to remove: for example, history, downloads, passwords, and so on. -- {{WebExtAPIRef("browsingData.RemovalOptions")}} - - : Object used to specify how far back in time to remove data, and whether to remove data added through normal web browsing, by hosted apps, or by add-ons. - -## Methods - -- {{WebExtAPIRef("browsingData.remove()")}} - - : Removes browsing data for the data types specified. -- {{WebExtAPIRef("browsingData.removeCache()")}} - - : Clears the browser's cache. -- {{WebExtAPIRef("browsingData.removeCookies()")}} - - : Removes cookies. -- {{WebExtAPIRef("browsingData.removeDownloads()")}} - - : Removes the list of downloaded files. -- {{WebExtAPIRef("browsingData.removeFormData()")}} - - : Clears saved form data. -- {{WebExtAPIRef("browsingData.removeHistory()")}} - - : Clears the browser's history. -- {{WebExtAPIRef("browsingData.removeLocalStorage()")}} - - : Clears any [local storage](/ko/docs/Web/API/Window/localStorage) created by websites. -- {{WebExtAPIRef("browsingData.removePasswords()")}} - - : Clears saved passwords. -- {{WebExtAPIRef("browsingData.removePluginData()")}} - - : Clears data associated with plugins. -- {{WebExtAPIRef("browsingData.settings()")}} - - : Gets the current value of settings in the browser's "Clear History" feature. - -## 브라우저 호환성 - -{{Compat}} - -{{WebExtExamples("h2")}} - -> **Note:** This API is based on Chromium's [`chrome.browsingData`](https://developer.chrome.com/docs/extensions/reference/browsingData/) API. -> -> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License. - -``` -// 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. -``` diff --git a/files/ko/mozilla/add-ons/webextensions/api/index.md b/files/ko/mozilla/add-ons/webextensions/api/index.md deleted file mode 100644 index 6593c6517b2443..00000000000000 --- a/files/ko/mozilla/add-ons/webextensions/api/index.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: JavaScript APIs -slug: Mozilla/Add-ons/WebExtensions/API ---- - -{{AddonSidebar}} - -The WebExtension JavaScript APIs can be used inside the add-on's [background scripts](/en-US/Add-ons/WebExtensions/Anatomy_of_a_WebExtension#Background_scripts) and in any other documents bundled with the add-on, including [browser action](/ko/docs/Mozilla/Add-ons/WebExtensions/Browser_action) or [page action](/ko/docs/Mozilla/Add-ons/WebExtensions/Page_actions) popups, [sidebars](/ko/docs/Mozilla/Add-ons/WebExtensions/Sidebars), [options pages](/ko/docs/Mozilla/Add-ons/WebExtensions/Options_pages), or [new tab pages](/en-US/Add-ons/WebExtensions/manifest.json/chrome_url_overrides). A few of these APIs can also be accessed by an add-on's [content scripts](/en-US/Add-ons/WebExtensions/Anatomy_of_a_WebExtension#Content_scripts) (see the [list in the content script guide](/en-US/Add-ons/WebExtensions/Content_scripts#WebExtension_APIs)). - -To use the more powerful APIs you need to [request permission](/en-US/Add-ons/WebExtensions/manifest.json/permissions) in your add-on's manifest.json. - -You can access the APIs using the `browser` namespace: - -```js -function logTabs(tabs) { - console.log(tabs); -} - -browser.tabs.query({ currentWindow: true }, logTabs); -``` - -Many of the APIs are asynchronous, returning a [`Promise`](/ko/docs/Web/JavaScript/Reference/Global_Objects/Promise): - -```js -function logCookie(c) { - console.log(c); -} - -function logError(e) { - console.error(e); -} - -var setCookie = browser.cookies.set({ url: "https://developer.mozilla.org/" }); -setCookie.then(logCookie, logError); -``` - -Note that this is different from Google Chrome's extension system, which uses the `chrome` namespace instead of `browser`, and which uses callbacks instead of promises for asynchronous functions. As a porting aid, the Firefox implementation of WebExtensions supports `chrome` and callbacks as well as `browser` and promises. Mozilla has also written a polyfill which enables code that uses `browser` and promises to work unchanged in Chrome: . - -Microsoft Edge uses the `browser` namespace, but doesn't yet support promise-based asynchronous APIs. In Edge, for the time being, asynchronous APIs must use callbacks. - -Not all browsers support all the APIs: for the details, see [Browser support for JavaScript APIs](/ko/docs/Mozilla/Add-ons/WebExtensions/Browser_support_for_JavaScript_APIs). - -{{SubpagesWithSummaries}} diff --git a/files/ko/mozilla/add-ons/webextensions/api/menus/onshown/index.md b/files/ko/mozilla/add-ons/webextensions/api/menus/onshown/index.md deleted file mode 100644 index f9cb183081cd9e..00000000000000 --- a/files/ko/mozilla/add-ons/webextensions/api/menus/onshown/index.md +++ /dev/null @@ -1,122 +0,0 @@ ---- -title: menus.onShown -slug: Mozilla/Add-ons/WebExtensions/API/menus/onShown ---- - -{{AddonSidebar()}} - -Fired when the browser has shown a menu. - -An extension can use this event to update its menu items using information that's only available once the menu is shown. Typically an extension will figure out the update in its `onShown` handler and then call {{WebExtAPIRef("menus.refresh()")}} to update the menu itself. - -The handler can add, remove, or update menu items. - -For example, the [menu-labelled-open](https://github.com/mdn/webextensions-examples/tree/master/menu-labelled-open) example extension adds a menu item that's shown when the user clicks a link, and that, when clicked, just opens the link. It uses `onShown` and `refresh()` to annotate the menu item with the hostname for the link, so the user can easily see where they will go before they click. - -Note that an extension should not take too much time before calling `refresh()`, or the update will be noticeable to the user. - -The handler is passed some information about the menu and its contents, and some information from the page (such as the link and/or selection text). To get access to the information from the page, your extension must have the [host permission](/en-US/Add-ons/WebExtensions/manifest.json/permissions#Host_permissions) for it. - -If the `onShown` handler calls any asynchronous APIs, then it's possible that the menu has been closed again before the handler resumes execution. Because of this, if a handler calls any asynchronous APIs, it should check that the menu is still being displayed before it updates the menu. For example: - -```js -var lastMenuInstanceId = 0; -var nextMenuInstanceId = 1; - -browser.menus.onShown.addListener(async function(info, tab) { - var menuInstanceId = nextMenuInstanceId++; - lastMenuInstanceId = menuInstanceId; - - // Call an async function - await .... ; - - // After completing the async operation, check whether the menu is still shown. - if (menuInstanceId !== lastMenuInstanceId) { - return; // Menu was closed and shown again. - } - // Now use menus.create/update + menus.refresh. -}); - -browser.menus.onHidden.addListener(function() { - lastMenuInstanceId = 0; -}); -``` - -Note that it is possible to call menus API functions synchronously, and in this case you don't have to perform this check: - -```js -browser.menus.onShown.addListener(async function(info, tab) { - browser.menus.update(menuId, ...); - // Note: Not waiting for returned promise. - browser.menus.refresh(); -}); -``` - -However, if you call these APIs asynchronously, then you do have to perform the check: - -```js -browser.menus.onShown.addListener(async function(info, tab) { - var menuInstanceId = nextMenuInstanceId++; - lastMenuInstanceId = menuInstanceId; - - await browser.menus.update(menuId, ...); - // must now perform the check - if (menuInstanceId !== lastMenuInstanceId) { - return; - } - browser.menus.refresh(); -}); -``` - -Firefox makes this event available via the `contextMenus` namespace as well as the `menus` namespace. - -## 문법 - -
browser.menus.onShown.addListener(listener)
-browser.menus.onShown.removeListener(listener)
-browser.menus.onShown.hasListener(listener)
-
- -Events have three functions: - -- `addListener(listener)` - - : Adds a listener to this event. -- `removeListener(listener)` - - : Stop listening to this event. The `listener` argument is the listener to remove. -- `hasListener(listener)` - - : Check whether `listener` is registered for this event. Returns `true` if it is listening, `false` otherwise. - -## addListener syntax - -### 매개변수 - -- `callback` - - : Function that will be called when this event occurs. The function will be passed the following arguments:
info

Object. This is just like the {{WebExtAPIRef('menus.OnClickData')}} object, except it contains two extra properties:

  • contexts: an array of all the {{WebExtAPIRef("menus.ContextType", "contexts")}} that are applicable to this menu.
  • menuIds: an array of IDs of all menu items belonging to this extension that are being shown in this menu.

Compared with menus.OnClickData, the info object also omits the menuItemId and modifiers properties, because of course these are not available until a menu item has been selected.

The contexts, menuIds, frameId, and editable properties are always provided. All the other properties in info are only provided if the extension has the host permission for the page.

tab
{{WebExtAPIRef('tabs.Tab')}}. The details of the tab where the click took place. If the click did not take place in or on a tab, this parameter will be missing.
- -## 브라우저 호환성 - -{{Compat}} - -## 예제 - -This example listens for the context menu to be shown over a link, then updates the `openLabelledId` menu item with the link's hostname: - -```js -function updateMenuItem(linkHostname) { - browser.menus.update(openLabelledId, { - title: `Open (${linkHostname})`, - }); - browser.menus.refresh(); -} - -browser.menus.onShown.addListener((info) => { - if (!info.linkUrl) { - return; - } - let linkElement = document.createElement("a"); - linkElement.href = info.linkUrl; - updateMenuItem(linkElement.hostname); -}); -``` - -{{WebExtExamples}} diff --git a/files/ko/mozilla/add-ons/webextensions/api/storage/storagearea/index.md b/files/ko/mozilla/add-ons/webextensions/api/storage/storagearea/index.md deleted file mode 100644 index 284512297ec09b..00000000000000 --- a/files/ko/mozilla/add-ons/webextensions/api/storage/storagearea/index.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: storage.StorageArea -slug: Mozilla/Add-ons/WebExtensions/API/storage/StorageArea ---- - -{{AddonSidebar()}} - -StorageArea is an object representing a storage area. - -## Type - -Values of this type are objects. - -## Methods - -- {{WebExtAPIRef("storage.StorageArea.get()")}} - - : Retrieves one or more items from the storage area. -- {{WebExtAPIRef("storage.StorageArea.getBytesInUse()")}} - - : Gets the amount of storage space (in bytes) used one or more items being stored in the storage area. -- {{WebExtAPIRef("storage.StorageArea.set()")}} - - : Stores one or more items in the storage area. If an item already exists, its value will be updated. -- {{WebExtAPIRef("storage.StorageArea.remove()")}} - - : Removes one or more items from the storage area. -- {{WebExtAPIRef("storage.StorageArea.clear()")}} - - : Removes all items from the storage area. - -## 브라우저 호환성 - -{{Compat}} - -{{WebExtExamples}} - -> **참고:** **Acknowledgements**This API is based on Chromium's [`chrome.storage`](https://developer.chrome.com/extensions/storage#type-StorageArea) API. This documentation is derived from [`storage.json`](https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/storage.json) in the Chromium code.Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License. - - diff --git a/files/ko/mozilla/add-ons/webextensions/api/tabs/index.md b/files/ko/mozilla/add-ons/webextensions/api/tabs/index.md deleted file mode 100644 index 39dbfd2948e802..00000000000000 --- a/files/ko/mozilla/add-ons/webextensions/api/tabs/index.md +++ /dev/null @@ -1,198 +0,0 @@ ---- -title: tabs -slug: Mozilla/Add-ons/WebExtensions/API/tabs ---- - -{{AddonSidebar}} - -Interact with the browser's tab system. - -브라우저의 탭 시스템과의 상호작용. - -You can use this API to get a list of opened tabs, filtered by various criteria, and to open, update, move, reload, and remove tabs. You can't directly access the content hosted by tabs using this API, but you can insert JavaScript and CSS into tabs using the {{WebExtAPIRef("tabs.executeScript()")}} or {{WebExtAPIRef("tabs.insertCSS()")}} APIs. - -이 API는 열려있는 탭의 목록을 얻는데, 다양한 기준으로 걸러내는데, 그리고 탭을 열고, 고치고, 옮기고, 다시 싣고, 없애는데 사용할 수 있다. 이 API로 탭에 열린 콘텐트를 직접 다룰 수는 없지만, {{WebExtAPIRef("tabs.executeScript()")}}나 {{WebExtAPIRef("tabs.insertCSS()")}} API로 탭에 자바스크립트와 CSS를 끼워 넣을 수는 있다. - -You can use most of this API without any special permission. However: - -특별한 권한없이 이 API의 대부분을 사용할 수 있지만: - -- to access `Tab.url`, `Tab.title`, and `Tab.favIconUrl`, you need to have the "tabs" [permission](/ko/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions). In Firefox this also means you need "tabs" to {{WebExtAPIRef("tabs.query", "query")}} by URL. -- to use {{WebExtAPIRef("tabs.executeScript()")}} or {{WebExtAPIRef("tabs.insertCSS()")}} you must have the [host permission](/en-US/Add-ons/WebExtensions/manifest.json/permissions#Host_permissions) for the tab - -- `Tab.url`, `Tab.title`, and `Tab.favIconUrl`에 접근하려면 "tabs" [권한](/ko/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions)을 가져야 한다. 파이어폭스에서 이 말은 URL로 {{WebExtAPIRef("tabs.query", "query")}} 하는데도 "tabs"가 필요하다는 뜻이다. -- {{WebExtAPIRef("tabs.executeScript()")}}나 {{WebExtAPIRef("tabs.insertCSS()")}}를 사용하려면 탭에 대한 [host 권한](/en-US/Add-ons/WebExtensions/manifest.json/permissions#Host_permissions)을 가져야 한다. - -또는 이런 권한을 일시적으로 얻는 방법도 있다. 현재 활성 탭이거나 명시적인 사용자 동작의 응답이라면 ["activeTab" 권한](/en-US/Add-ons/WebExtensions/manifest.json/permissions#activeTab_permission)을 요청하면 된다. - -많은 탭 작업은 탭 ID를 사용한다. 탭 ID는 브라우저 세션 내에서 탭마다 고유하도록 보장된다. 브라우저가 다시 시작되면, 탭 ID를 재사용할 수 있고 그럴 것이다. 다시 시작하는 브라우저에 걸쳐서 탭에 정보를 연관시키려면 {{WebExtAPIRef("sessions.setTabValue()")}}를 사용해라. - -## Types - -- {{WebExtAPIRef("tabs.MutedInfoReason")}} - - : Specifies the reason a tab was muted or unmuted. -- {{WebExtAPIRef("tabs.MutedInfo")}} - - : This object contains a boolean indicating whether the tab is muted, and the reason for the last state change. -- {{WebExtAPIRef("tabs.PageSettings")}} - - : Used to control how a tab is rendered as a PDF by the [`tabs.saveAsPDF()`](/ko/docs/Mozilla/Add-ons/WebExtensions/API/tabs/saveAsPDF) method. -- {{WebExtAPIRef("tabs.Tab")}} - - : This type contains information about a tab. -- {{WebExtAPIRef("tabs.TabStatus")}} - - : Indicates whether the tab has finished loading. -- {{WebExtAPIRef("tabs.WindowType")}} - - : The type of window that hosts this tab. -- {{WebExtAPIRef("tabs.ZoomSettingsMode")}} - - : Defines whether zoom changes are handled by the browser, by the extension, or are disabled. -- {{WebExtAPIRef("tabs.ZoomSettingsScope")}} - - : Defines whether zoom changes will persist for the page's origin, or only take effect in this tab. -- {{WebExtAPIRef("tabs.ZoomSettings")}} - - : Defines zoom settings {{WebExtAPIRef("tabs.ZoomSettingsMode", "mode")}}, {{WebExtAPIRef("tabs.ZoomSettingsScope", "scope")}}, and default zoom factor. - -## Properties - -- {{WebExtAPIRef("tabs.TAB_ID_NONE")}} - - : A special ID value given to tabs that are not browser tabs (for example, tabs in devtools windows). - -## Functions - -- {{WebExtAPIRef("tabs.captureTab()")}} - - : Creates a data URL encoding an image of the visible area of the given tab. -- {{WebExtAPIRef("tabs.captureVisibleTab()")}} - - : Creates a data URL encoding an image of the visible area of the currently active tab in the specified window. -- {{WebExtAPIRef("tabs.connect()")}} - - : Sets up a messaging connection between the extension's background scripts (or other privileged scripts, such as popup scripts or options page scripts) and any [content scripts](/ko/docs/Mozilla/Add-ons/WebExtensions/Content_scripts) running in the specified tab. -- {{WebExtAPIRef("tabs.create()")}} - - : Creates a new tab. -- {{WebExtAPIRef("tabs.detectLanguage()")}} - - : Detects the primary language of the content in a tab. -- {{WebExtAPIRef("tabs.discard()")}} - - : Discards one or more tabs. -- {{WebExtAPIRef("tabs.duplicate()")}} - - : Duplicates a tab. -- {{WebExtAPIRef("tabs.executeScript()")}} (Manifest V2 only) - - : Injects JavaScript code into a page. -- {{WebExtAPIRef("tabs.get()")}} - - : Retrieves details about the specified tab. -- {{WebExtAPIRef("tabs.getAllInWindow()")}} {{deprecated_inline}} - - : Gets details about all tabs in the specified window. -- {{WebExtAPIRef("tabs.getCurrent()")}} - - : Gets information about the tab that this script is running in, as a [`tabs.Tab`](/ko/docs/Mozilla/Add-ons/WebExtensions/API/tabs/Tab) object. -- {{WebExtAPIRef("tabs.getSelected()")}} {{deprecated_inline}} - - : Gets the tab that is selected in the specified window. **Deprecated: use [`tabs.query({active: true})`](/ko/docs/Mozilla/Add-ons/WebExtensions/API/tabs/query) instead.** -- {{WebExtAPIRef("tabs.getZoom()")}} - - : Gets the current zoom factor of the specified tab. -- {{WebExtAPIRef("tabs.getZoomSettings()")}} - - : Gets the current zoom settings for the specified tab. -- {{WebExtAPIRef("tabs.goForward()")}} - - : Go forward to the next page, if one is available. -- {{WebExtAPIRef("tabs.goBack()")}} - - : Go back to the previous page, if one is available. -- {{WebExtAPIRef("tabs.hide()")}} {{experimental_inline}} - - : Hides one or more tabs. -- {{WebExtAPIRef("tabs.highlight()")}} - - : Highlights one or more tabs. -- {{WebExtAPIRef("tabs.insertCSS()")}} (Manifest V2 only) - - : Injects CSS into a page. -- {{WebExtAPIRef("tabs.move()")}} - - : Moves one or more tabs to a new position in the same window or to a different window. -- {{WebExtApiRef("tabs.moveInSuccession()")}} - - : Modifies the succession relationship for a group of tabs. -- {{WebExtAPIRef("tabs.print()")}} - - : Prints the contents of the active tab. -- {{WebExtAPIRef("tabs.printPreview()")}} - - : Opens print preview for the active tab. -- {{WebExtAPIRef("tabs.query()")}} - - : Gets all tabs that have the specified properties, or all tabs if no properties are specified. -- {{WebExtAPIRef("tabs.reload()")}} - - : Reload a tab, optionally bypassing the local web cache. -- {{WebExtAPIRef("tabs.remove()")}} - - : Closes one or more tabs. -- {{WebExtAPIRef("tabs.removeCSS()")}} (Manifest V2 only) - - : Removes from a page CSS which was previously injected by calling {{WebExtAPIRef("tabs.insertCSS()")}}. -- {{WebExtAPIRef("tabs.saveAsPDF()")}} - - : Saves the current page as a PDF. -- {{WebExtAPIRef("tabs.sendMessage()")}} - - : Sends a single message to the content script(s) in the specified tab. -- {{WebExtAPIRef("tabs.sendRequest()")}} {{deprecated_inline}} - - : Sends a single request to the content script(s) in the specified tab. **Deprecated**: use {{WebExtAPIRef("tabs.sendMessage()")}} instead. -- {{WebExtAPIRef("tabs.setZoom()")}} - - : Zooms the specified tab. -- {{WebExtAPIRef("tabs.setZoomSettings()")}} - - : Sets the zoom settings for the specified tab. -- {{WebExtAPIRef("tabs.show()")}} {{experimental_inline}} - - : Shows one or more tabs that have been {{WebExtAPIRef("tabs.hide()", "hidden")}}. -- {{WebExtAPIRef("tabs.toggleReaderMode()")}} - - : Toggles Reader mode for the specified tab. -- {{WebExtAPIRef("tabs.update()")}} - - : Navigate the tab to a new URL, or modify other properties of the tab. -- {{WebExtAPIRef("tabs.warmup()")}} - - : Prepare the tab to make a potential following switch faster. - -## Events - -- {{WebExtAPIRef("tabs.onActivated")}} - - : Fires when the active tab in a window changes. Note that the tab's URL may not be set at the time this event fired. -- {{WebExtAPIRef("tabs.onActiveChanged")}} {{deprecated_inline}} - - : Fires when the selected tab in a window changes. **Deprecated:** use {{WebExtAPIRef("tabs.onActivated")}} instead. -- {{WebExtAPIRef("tabs.onAttached")}} - - : Fired when a tab is attached to a window, for example because it was moved between windows. -- {{WebExtAPIRef("tabs.onCreated")}} - - : Fired when a tab is created. Note that the tab's URL may not be set at the time this event fired. -- {{WebExtAPIRef("tabs.onDetached")}} - - : Fired when a tab is detached from a window, for example because it is being moved between windows. -- {{WebExtAPIRef("tabs.onHighlightChanged")}} {{deprecated_inline}} - - : Fired when the highlighted or selected tabs in a window change. **Deprecated:** use {{WebExtAPIRef("tabs.onHighlighted")}} instead. -- {{WebExtAPIRef("tabs.onHighlighted")}} - - : Fired when the highlighted or selected tabs in a window change. -- {{WebExtAPIRef("tabs.onMoved")}} - - : Fired when a tab is moved within a window. -- {{WebExtAPIRef("tabs.onRemoved")}} - - : Fired when a tab is closed. -- {{WebExtAPIRef("tabs.onReplaced")}} - - : Fired when a tab is replaced with another tab due to prerendering. -- {{WebExtAPIRef("tabs.onSelectionChanged")}} {{deprecated_inline}} - - : Fires when the selected tab in a window changes. **Deprecated:** use {{WebExtAPIRef("tabs.onActivated")}} instead. -- {{WebExtAPIRef("tabs.onUpdated")}} - - : Fired when a tab is updated. -- {{WebExtAPIRef("tabs.onZoomChange")}} - - : Fired when a tab is zoomed. - -## 브라우저 호환성 - -{{Compat}} - -{{WebExtExamples("h2")}} - -> **참고:** This API is based on Chromium's [`chrome.tabs`](https://developer.chrome.com/docs/extensions/reference/tabs/) API. This documentation is derived from [`tabs.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/tabs.json) in the Chromium code. -> -> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License. - - diff --git a/files/ko/mozilla/add-ons/webextensions/api/tabs/insertcss/index.md b/files/ko/mozilla/add-ons/webextensions/api/tabs/insertcss/index.md deleted file mode 100644 index 9733d9e25a688f..00000000000000 --- a/files/ko/mozilla/add-ons/webextensions/api/tabs/insertcss/index.md +++ /dev/null @@ -1,131 +0,0 @@ ---- -title: tabs.insertCSS() -slug: Mozilla/Add-ons/WebExtensions/API/tabs/insertCSS ---- - -{{AddonSidebar()}} - -페이지에 CSS 삽입하기 - -> **Note:** When using Manifest V3 or higher, use {{WebExtAPIRef("scripting.insertCSS()")}} and {{WebExtAPIRef("scripting.removeCSS()")}} to insert and remove CSS. - -이 API를 사용하기 위해 여러분은 해당 페이지 URL에 대한 허가가 필요합니다. 이 허가에 대한 요청은 [호스트 허가](/en-US/Add-ons/WebExtensions/manifest.json/permissions#Host_permissions)를 통하거나 [활성화 된 탭 허가](/en-US/Add-ons/WebExtensions/manifest.json/permissions#activeTab_permission)을 사용할 수도 있습니다. - -You can only inject CSS into pages whose URL can be expressed using a [match pattern](/ko/docs/Mozilla/Add-ons/WebExtensions/Match_patterns): meaning, its scheme must be one of "http", "https", or "file". This means that you can't inject CSS into any of the browser's built-in pages, such as about:debugging, about:addons, or the page that opens when you open a new empty tab. - -> **Note:** Firefox resolves URLs in injected CSS files relative to the CSS file itself, rather than to the page it's injected into. - -The inserted CSS may be removed again by calling {{WebExtAPIRef("tabs.removeCSS()")}}. - -This is an asynchronous function that returns a [`Promise`](/ko/docs/Web/JavaScript/Reference/Global_Objects/Promise) (on Firefox only). - -## Syntax - -```js -let inserting = browser.tabs.insertCSS( - tabId, // optional integer - details, // object -); -``` - -### Parameters - -- `tabId` {{optional_inline}} - - : `integer`. The ID of the tab in which to insert the CSS. Defaults to the active tab of the current window. -- `details` - - - : An object describing the CSS to insert. It contains the following properties: - - - `allFrames` {{optional_inline}} - - : `boolean`. If `true`, the CSS will be injected into all frames of the current page. If it is `false`, CSS is only injected into the top frame. Defaults to `false`. - - `code` {{optional_inline}} - - : `string`. Code to inject, as a text string. - - `cssOrigin` {{optional_inline}} - - - : `string`. This can take one of two values: "user", to add the CSS as a user stylesheet or "author" to add it as an author stylesheet. If this option is omitted, the CSS is added as an author stylesheet. - - - "user" enables you to prevent websites from overriding the CSS you insert: see [Cascading order](/ko/docs/Web/CSS/Cascade#cascading_order). - - "author" stylesheets behave as if they appear after all author rules specified by the web page. This behavior includes any author stylesheets added dynamically by the page's scripts, even if that addition happens after the `insertCSS` call completes. - - - `file` {{optional_inline}} - - : `string`. Path to a file containing the code to inject. In Firefox, relative URLs are resolved relative to the current page URL. In Chrome, these URLs are resolved relative to the extension's base URL. To work cross-browser, you can specify the path as an absolute URL, starting at the extension's root, like this: `"/path/to/stylesheet.css"`. - - `frameId` {{optional_inline}} - - : `integer`. The frame where the CSS should be injected. Defaults to `0` (the top-level frame). - - `matchAboutBlank` {{optional_inline}} - - : `boolean`. If `true`, the code will be injected into embedded "about:blank" and "about:srcdoc" frames if your extension has access to their parent document. The code cannot be inserted in top-level about: frames. Defaults to `false`. - - `runAt` {{optional_inline}} - - : {{WebExtAPIRef('extensionTypes.RunAt')}}. The soonest that the code will be injected into the tab. Defaults to "document_idle". - -### Return value - -A [`Promise`](/ko/docs/Web/JavaScript/Reference/Global_Objects/Promise) that will be fulfilled with no arguments when all the CSS has been inserted. If any error occurs, the promise will be rejected with an error message. - -## Examples - -This example inserts into the currently active tab CSS which is taken from a string. - -```js -let css = "body { border: 20px dotted pink; }"; - -browser.browserAction.onClicked.addListener(() => { - function onError(error) { - console.log(`Error: ${error}`); - } - - let insertingCSS = browser.tabs.insertCSS({ code: css }); - insertingCSS.then(null, onError); -}); -``` - -This example inserts CSS which is loaded from a file packaged with the extension. The CSS is inserted into the tab whose ID is 2: - -```js -browser.browserAction.onClicked.addListener(() => { - function onError(error) { - console.log(`Error: ${error}`); - } - - let insertingCSS = browser.tabs.insertCSS(2, { file: "content-style.css" }); - insertingCSS.then(null, onError); -}); -``` - -{{WebExtExamples}} - -## 브라우저 호환성 - -{{Compat}} - -> **Note:** This API is based on Chromium's [`chrome.tabs`](https://developer.chrome.com/docs/extensions/reference/tabs/#method-insertCSS) API. This documentation is derived from [`tabs.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/tabs.json) in the Chromium code. -> -> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License. - - diff --git a/files/ko/mozilla/add-ons/webextensions/api/webrequest/index.md b/files/ko/mozilla/add-ons/webextensions/api/webrequest/index.md deleted file mode 100644 index c3d6b82e07c692..00000000000000 --- a/files/ko/mozilla/add-ons/webextensions/api/webrequest/index.md +++ /dev/null @@ -1,161 +0,0 @@ ---- -title: webRequest -slug: Mozilla/Add-ons/WebExtensions/API/webRequest ---- - -{{AddonSidebar}} - -Add event listeners for the various stages of making an HTTP request. The event listener receives detailed information about the request and can modify or cancel the request. - -Each event is fired at a particular stage of the request. The typical sequence of events is like this: - -![](webrequest-flow.png) - -{{WebExtAPIRef("webRequest.onErrorOccurred", "onErrorOccurred")}} can be fired at any time during the request. Also, note that sometimes the sequence of events may differ from this: for example, in Firefox, on an [HSTS](/ko/docs/Web/HTTP/Headers/Strict-Transport-Security) upgrade, the `onBeforeRedirect` event will be triggered immediately after `onBeforeRequest`. - -All the events, except `onErrorOccurred`, can take three arguments to `addListener()`: - -- the listener itself -- a {{WebExtAPIRef("webRequest.RequestFilter", "filter")}} object, so you can only be notified for requests made to particular URLs or for particular types of resource -- an optional `extraInfoSpec` object. You can use this to pass additional event-specific instructions. - -리스너는 요청 정보가 담긴 `details` 객체를 받는다. This includes a request ID, which is provided to enable an add-on to correlate events associated with a single request. It is unique within a browser session and the add-on's context. It stays the same throughout a request, even across redirections and authentication exchanges. - -webRequest API를 사용하려면 확장 프로그램은 "webRequest" [API 권한](/en-US/Add-ons/WebExtensions/manifest.json/permissions#API_permissions)을 가져야 하고, 대상 호스트에 대해서도 [호스트 권한](/en-US/Add-ons/WebExtensions/manifest.json/permissions#Host_permissions)을 가져야 한다. "blocking" 기능을 사용하려면 추가로 "webRequestBlocking" API 권한도 가져야 한다. - -To intercept resources loaded by a page (such as images, scripts, or stylesheets), the extension must have the host permission for the resource as well as for the main page requesting the resource. For example, if a page at "https\://developer.mozilla.org" loads an image from "https\://mdn.mozillademos.org", then an extension must have both host permissions if it is to intercept the image request. - -## Modifying requests - -On some of these events, you can modify the request. Specifically, you can: - -- cancel the request in: - - - {{WebExtAPIRef("webRequest.onBeforeRequest", "onBeforeRequest")}} - - {{WebExtAPIRef("webRequest.onBeforeSendHeaders", "onBeforeSendHeaders")}} - - {{WebExtAPIRef("webRequest.onAuthRequired", "onAuthRequired")}} - -- redirect the request in: - - - {{WebExtAPIRef("webRequest.onBeforeRequest", "onBeforeRequest")}} - - {{WebExtAPIRef("webRequest.onHeadersReceived", "onHeadersReceived")}} - -- modify request headers in: - - - {{WebExtAPIRef("webRequest.onBeforeSendHeaders", "onBeforeSendHeaders")}} - -- modify response headers in: - - - {{WebExtAPIRef("webRequest.onHeadersReceived", "onHeadersReceived")}} - -- supply authentication credentials in: - - - {{WebExtAPIRef("webRequest.onAuthRequired", "onAuthRequired")}} - -To do this, you need to pass an option with the value "blocking" in the `extraInfoSpec` argument to the event's `addListener()`. This makes the listener synchronous. In the listener, you can then return a {{WebExtAPIRef("webRequest.BlockingResponse", "BlockingResponse")}} object, which indicates the modification you need to make: for example, the modified request header you want to send. - -## Accessing security information - -In the {{WebExtAPIRef("webRequest.onHeadersReceived", "onHeadersReceived")}} listener you can access the [TLS](/ko/docs/Glossary/TLS) properties of a request by calling {{WebExtAPIRef("webRequest.getSecurityInfo()", "getSecurityInfo()")}}. To do this you must also pass "blocking" in the `extraInfoSpec` argument to the event's `addListener()`. - -You can read details of the TLS handshake, but can't modify them or override the browser's trust decisions. - -## Modifying responses - -To modify the HTTP response bodies for a request, call {{WebExtAPIRef("webRequest.filterResponseData")}}, passing it the ID of the request. This returns a {{WebExtAPIRef("webRequest.StreamFilter")}} object that you can use to examine and modify the data as it is received by the browser. - -To do this, you must have the "webRequestBlocking" API permission as well as the "webRequest" [API permission](/en-US/Add-ons/WebExtensions/manifest.json/permissions#API_permissions) and the [host permission](/en-US/Add-ons/WebExtensions/manifest.json/permissions#Host_permissions) for the relevant host. - -## Types - -- {{WebExtAPIRef("webRequest.BlockingResponse")}} - - : An object of this type is returned by event listeners that have set `"blocking"` in their `extraInfoSpec` argument. By setting particular properties in `BlockingResponse`, the listener can modify network requests. -- {{WebExtAPIRef("webRequest.CertificateInfo")}} - - : An object describing a single X.509 certificate. -- {{WebExtAPIRef("webRequest.HttpHeaders")}} - - : An array of HTTP headers. Each header is represented as an object with two properties: `name` and either `value` or `binaryValue`. -- {{WebExtAPIRef("webRequest.RequestFilter")}} - - : An object describing filters to apply to webRequest events. -- {{WebExtAPIRef("webRequest.ResourceType")}} - - : Represents a particular kind of resource fetched in a web request. -- {{WebExtAPIRef("webRequest.SecurityInfo")}} - - : An object describing the security properties of a particular web request. -- {{WebExtAPIRef("webRequest.StreamFilter")}} - - : An object that can be used to monitor and modify HTTP responses while they are being received. -- {{WebExtAPIRef("webRequest.UploadData")}} - - : Contains data uploaded in a URL request. - -## Properties - -- {{WebExtAPIRef("webRequest.MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES", "webRequest.MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES")}} - - : The maximum number of times that handlerBehaviorChanged() can be called in a 10 minute period. - -## Methods - -- {{WebExtAPIRef("webRequest.handlerBehaviorChanged()")}} - - : This method can be used to ensure that event listeners are applied correctly when pages are in the browser's in-memory cache. -- {{WebExtAPIRef("webRequest.filterResponseData()")}} - - : Returns a {{WebExtAPIRef("webRequest.StreamFilter")}} object for a given request. -- {{WebExtAPIRef("webRequest.getSecurityInfo()")}} - - : Gets detailed information about the [TLS](/ko/docs/Glossary/TLS) connection associated with a given request. - -## Events - -- {{WebExtAPIRef("webRequest.onBeforeRequest")}} - - : Fired when a request is about to be made, and before headers are available. This is a good place to listen if you want to cancel or redirect the request. -- {{WebExtAPIRef("webRequest.onBeforeSendHeaders")}} - - : Fired before sending any HTTP data, but after HTTP headers are available. This is a good place to listen if you want to modify HTTP request headers. -- {{WebExtAPIRef("webRequest.onSendHeaders")}} - - : Fired just before sending headers. If your add-on or some other add-on modified headers in `{{WebExtAPIRef("webRequest.onBeforeSendHeaders", "onBeforeSendHeaders")}}`, you'll see the modified version here. -- {{WebExtAPIRef("webRequest.onHeadersReceived")}} - - : Fired when the HTTP response headers associated with a request have been received. You can use this event to modify HTTP response headers. -- {{WebExtAPIRef("webRequest.onAuthRequired")}} - - : Fired when the server asks the client to provide authentication credentials. The listener can do nothing, cancel the request, or supply authentication credentials. -- {{WebExtAPIRef("webRequest.onResponseStarted")}} - - : Fired when the first byte of the response body is received. For HTTP requests, this means that the status line and response headers are available. -- {{WebExtAPIRef("webRequest.onBeforeRedirect")}} - - : Fired when a server-initiated redirect is about to occur. -- {{WebExtAPIRef("webRequest.onCompleted")}} - - : Fired when a request is completed. -- {{WebExtAPIRef("webRequest.onErrorOccurred")}} - - : Fired when an error occurs. - -## 브라우저 호환성 - -{{Compat}} - -[Extra notes on Chrome incompatibilities](/ko/docs/Mozilla/Add-ons/WebExtensions/Chrome_incompatibilities#webRequest_incompatibilities). - -{{WebExtExamples("h2")}} - -> **참고:** **Acknowledgments**This API is based on Chromium's [`chrome.webRequest`](https://developer.chrome.com/extensions/webRequest) API. This documentation is derived from [`web_request.json`](https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/web_request.json) in the Chromium code.Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License. - - diff --git a/files/ko/mozilla/add-ons/webextensions/api/webrequest/onbeforerequest/index.md b/files/ko/mozilla/add-ons/webextensions/api/webrequest/onbeforerequest/index.md deleted file mode 100644 index 4ca0f65824c820..00000000000000 --- a/files/ko/mozilla/add-ons/webextensions/api/webrequest/onbeforerequest/index.md +++ /dev/null @@ -1,353 +0,0 @@ ---- -title: webRequest.onBeforeRequest -slug: Mozilla/Add-ons/WebExtensions/API/webRequest/onBeforeRequest ---- - -{{AddonSidebar()}} - -This event is triggered when a request is about to be made, and before headers are available. This is a good place to listen if you want to cancel or redirect the request. - -To cancel or redirect the request, first include `"blocking"` in the `extraInfoSpec` array argument to `addListener()`. Then, in the listener function, return a {{WebExtAPIRef("webRequest.BlockingResponse", "BlockingResponse")}} object, setting the appropriate property: - -- to cancel the request, include a property `cancel` with the value `true`. -- to redirect the request, include a property `redirectUrl` with the value set to the URL to which you want to redirect. - -If an extension wants to redirect a public (e.g. HTTPS) URL to an [extension page](/ko/docs/Mozilla/Add-ons/WebExtensions/user_interface/Extension_pages), the extension's manifest.json file must contain a [web_accessible_resources](/ko/docs/Mozilla/Add-ons/WebExtensions/manifest.json/web_accessible_resources) key that lists the URL for the extension page. - -When multiple blocking handlers modify a request, only one set of modifications take effect. Redirects and cancellations have the same precedence. So if you canceled a request, you might see another request with the same `requestId` again if another blocking handler redirected the request. - -From Firefox 52 onwards, instead of returning `BlockingResponse`, the listener can return a [`Promise`](/ko/docs/Web/JavaScript/Reference/Global_Objects/Promise) which is resolved with a `BlockingResponse`. This enables the listener to process the request asynchronously. - -If you use `"blocking"`, you must have the ["webRequestBlocking" API permission](/ko/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions#api_permissions) in your manifest.json. - -## Syntax - -```js -browser.webRequest.onBeforeRequest.addListener( - listener, // function - filter, // object - extraInfoSpec, // optional array of strings -); -browser.webRequest.onBeforeRequest.removeListener(listener); -browser.webRequest.onBeforeRequest.hasListener(listener); -``` - -Events have three functions: - -- `addListener(callback, filter, extraInfoSpec)` - - : Adds a listener to this event. -- `removeListener(listener)` - - : Stop listening to this event. The `listener` argument is the listener to remove. -- `hasListener(listener)` - - : Check whether `listener` is registered for this event. Returns `true` if it is listening, `false` otherwise. - -## addListener syntax - -### Parameters - -- `callback` - - - : Function that will be called when this event occurs. The function will be passed the following arguments: - - - `details` - - : [`object`](#details). Details about the request. See [`details`](#details_2) below. - - Returns: {{WebExtAPIRef('webRequest.BlockingResponse')}}. If `"blocking"` is specified in the `extraInfoSpec` parameter, the event listener should return a `BlockingResponse` object, and can set either its `cancel` or its `redirectUrl` properties. From Firefox 52 onwards, instead of returning `BlockingResponse`, the listener can return a [`Promise`](/ko/docs/Web/JavaScript/Reference/Global_Objects/Promise) which is resolved with a `BlockingResponse`. This enables the listener to process the request asynchronously. - -- `filter` - - : {{WebExtAPIRef('webRequest.RequestFilter')}}. A filter that restricts the events that will be sent to this listener. -- `extraInfoSpec` {{optional_inline}} - - - : `array` of `string`. Extra options for the event. You can pass any of the following values: - - - `"blocking"`: make the request synchronous, so you can cancel or redirect the request - - `"requestBody"`: include `requestBody` in the `details` object passed to the listener - -## Additional objects - -### details - -- `cookieStoreId` - - : `string`. If the request is from a tab open in a contextual identity, the cookie store ID of the contextual identity. -- `documentUrl` - - : `string`. URL of the document in which the resource will be loaded. For example, if the web page at "https\://example.com" contains an image or an iframe, then the `documentUrl` for the image or iframe will be "https\://example.com". For a top-level document, `documentUrl` is undefined. -- `frameAncestors` - - - : `array`. Contains information for each document in the frame hierarchy up to the top-level document. The first element in the array contains information about the immediate parent of the document being requested, and the last element contains information about the top-level document. If the load is actually for the top-level document, then this array is empty. - - - `url` - - : `string`. The URL that the document was loaded from. - - `frameId` - - : `integer`. The `frameId` of the document. `details.frameAncestors[0].frameId` is the same as `details.parentFrameId`. - -- `frameId` - - : `integer`. Zero if the request happens in the main frame; a positive value is the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (`type` is `main_frame` or `sub_frame`), `frameId` indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. -- `incognito` - - : `boolean`. Whether the request is from a private browsing window. -- `method` - - : `string`. Standard HTTP method: for example, "GET" or "POST". -- `originUrl` - - - : `string`. URL of the resource which triggered the request. For example, if "https\://example.com" contains a link, and the user clicks the link, then the `originUrl` for the resulting request is "https\://example.com". - - The `originUrl` is often but not always the same as the `documentUrl`. For example, if a page contains an iframe, and the iframe contains a link that loads a new document into the iframe, then the `documentUrl` for the resulting request will be the iframe's parent document, but the `originUrl` will be the URL of the document in the iframe that contained the link. - -- `parentFrameId` - - : `integer`. ID of the frame that contains the frame which sent the request. Set to -1 if no parent frame exists. -- `proxyInfo` - - - : `object`. This property is present only if the request is being proxied. It contains the following properties: - - - `host` - - : `string`. The hostname of the proxy server. - - `port` - - : `integer`. The port number of the proxy server. - - `type` - - - : `string`. The type of proxy server. One of: - - - "http": HTTP proxy (or SSL CONNECT for HTTPS) - - "https": HTTP proxying over TLS connection to proxy - - "socks": SOCKS v5 proxy - - "socks4": SOCKS v4 proxy - - "direct": no proxy - - "unknown": unknown proxy - - - `username` - - : `string`. Username for the proxy service. - - `proxyDNS` - - : `boolean`. True if the proxy will perform domain name resolution based on the hostname supplied, meaning that the client should not do its own DNS lookup. - - `failoverTimeout` - - : `integer`. Failover timeout in seconds. If the proxy connection fails, the proxy will not be used again for this period. - -- `requestBody` {{optional_inline}} - - - : `object`. Contains the HTTP request body data. Only provided if `extraInfoSpec` contains `"requestBody"`. - - - `error` {{optional_inline}} - - : `string`. This is set if any errors were encountered when obtaining request body data. - - `formData` {{optional_inline}} - - - : `object`. This object is present if the request method is POST and the body is a sequence of key-value pairs encoded in UTF-8 as either "multipart/form-data" or "application/x-www-form-urlencoded". - - It is a dictionary in which each key contains the list of all values for that key. For example: `{'key': ['value1', 'value2']}`. If the data is of another media type, or if it is malformed, the object is not present. - - - `raw` {{optional_inline}} - - : `array` of `{{WebExtAPIRef('webRequest.UploadData')}}`. If the request method is PUT or POST, and the body is not already parsed in `formData`, then this array contains the unparsed request body elements. - -- `requestId` - - : `string`. The ID of the request. Request IDs are unique within a browser session, so you can use them to relate different events associated with the same request. -- `tabId` - - : `integer`. ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. -- `thirdParty` - - : `boolean`. Indicates whether the request and its content window hierarchy are third party. -- `timeStamp` - - : `number`. The time when this event fired, in [milliseconds since the epoch](https://en.wikipedia.org/wiki/Unix_time). -- `type` - - : {{WebExtAPIRef('webRequest.ResourceType')}}. The type of resource being requested: for example, "image", "script", "stylesheet". -- `url` - - : `string`. Target of the request. -- `urlClassification` - - - : `object`. The type of tracking associated with the request, if with the request has been classified by [Firefox Tracking Protection](https://support.mozilla.org/en-US/kb/enhanced-tracking-protection-firefox-desktop). This is an object with the following properties: - - - `firstParty` - - : `array` of `strings`. Classification flags for the request's first party. - - `thirdParty` - - : `array` of `strings`. Classification flags for the request or its window hierarchy's third parties. - - The classification flags include: - - - `fingerprinting` and `fingerprinting_content`: indicates the request is involved in fingerprinting. `fingerprinting_content` indicates the request is loaded from an origin that has been found to fingerprint but is not considered to participate in tracking, such as a payment provider. - - `cryptomining` and `cryptomining_content`: similar to the fingerprinting category but for cryptomining resources. - - `tracking`, `tracking_ad`, `tracking_analytics`, `tracking_social`, and `tracking_content`: indicates the request is involved in tracking. `tracking` is any generic tracking request, the `ad`, `analytics`, `social`, and `content` suffixes identify the type of tracker. - - `any_basic_tracking`: a meta flag that combines any tracking and fingerprinting flags, excluding `tracking_content` and `fingerprinting_content`. - - `any_strict_tracking`: a meta flag that combines any tracking and fingerprinting flags, including `tracking_content` and `fingerprinting_content`. - - `any_social_tracking`: a meta flag that combines any social tracking flags. - -## 브라우저 호환성 - -{{Compat}} - -### DNS resolution ordering when BlockingResponse is used - -Regarding DNS resolution when BlockingResponse is used with OnBeforeRequest: In HTTP Channel, onBeforeRequest with blocking response does happen prior to DNS resolution and also prior to speculative connect. For other channels, speculative connect may cause DNS requests to happen before onBeforeRequest. This ordering is not something an extension developer ought to rely on as it may vary across browsers, and from one browser version to another, let alone one request channel to another. Refer [BugZilla issue clarification provided by Mozilla developers on DNS resolution ordering](https://bugzilla.mozilla.org/show_bug.cgi?id=1466099) - -## Examples - -This code logs the URL for every resource requested which matches the [\](/ko/docs/Mozilla/Add-ons/WebExtensions/Match_patterns#all_urls) pattern: - -```js -function logURL(requestDetails) { - console.log(`Loading: ${requestDetails.url}`); -} - -browser.webRequest.onBeforeRequest.addListener(logURL, { - urls: [""], -}); -``` - -This code cancels requests for images that are made to URLs under "https\://mdn.mozillademos.org/" (to see the effect, visit any page on MDN that contains images, such as [webRequest](/ko/docs/Mozilla/Add-ons/WebExtensions/API/webRequest)): - -```js -// match pattern for the URLs to redirect -let pattern = "https://mdn.mozillademos.org/*"; - -// cancel function returns an object -// which contains a property `cancel` set to `true` -function cancel(requestDetails) { - console.log(`Canceling: ${requestDetails.url}`); - return { cancel: true }; -} - -// add the listener, -// passing the filter argument and "blocking" -browser.webRequest.onBeforeRequest.addListener( - cancel, - { urls: [pattern], types: ["image"] }, - ["blocking"], -); -``` - -This code replaces, by redirection, all network requests for images that are made to URLs under "https\://mdn.mozillademos.org/" (to see the effect, visit any page on MDN that contains images, such as [webRequest](/ko/docs/Mozilla/Add-ons/WebExtensions/API/webRequest)): - -```js -// match pattern for the URLs to redirect -let pattern = "https://mdn.mozillademos.org/*"; - -// redirect function -// returns an object with a property `redirectURL` -// set to the new URL -function redirect(requestDetails) { - console.log(`Redirecting: ${requestDetails.url}`); - return { - redirectUrl: - "https://38.media.tumblr.com/tumblr_ldbj01lZiP1qe0eclo1_500.gif", - }; -} - -// add the listener, -// passing the filter argument and "blocking" -browser.webRequest.onBeforeRequest.addListener( - redirect, - { urls: [pattern], types: ["image"] }, - ["blocking"], -); -``` - -This code is exactly like the previous example, except that the listener handles the request asynchronously. It returns a [`Promise`](/ko/docs/Web/JavaScript/Reference/Global_Objects/Promise) that sets a timer, and resolves with the redirect URL when the timer expires: - -```js -// match pattern for the URLs to redirect -let pattern = "https://mdn.mozillademos.org/*"; - -// URL we will redirect to -let redirectUrl = - "https://38.media.tumblr.com/tumblr_ldbj01lZiP1qe0eclo1_500.gif"; - -// redirect function returns a Promise -// which is resolved with the redirect URL when a timer expires -function redirectAsync(requestDetails) { - console.log(`Redirecting async: ${requestDetails.url}`); - return new Promise((resolve, reject) => { - setTimeout(() => { - resolve({ redirectUrl }); - }, 2000); - }); -} - -// add the listener, -// passing the filter argument and "blocking" -browser.webRequest.onBeforeRequest.addListener( - redirectAsync, - { urls: [pattern], types: ["image"] }, - ["blocking"], -); -``` - -Another example, that redirects all images to a data URL: - -```js -let pattern = "https://mdn.mozillademos.org/*"; - -let image = ` - - - Blocked - -`; - -function listener(details) { - const redirectUrl = `data:image/svg+xml,${encodeURIComponent(image)}`; - return { redirectUrl }; -} - -browser.webRequest.onBeforeRequest.addListener( - listener, - { urls: [pattern], types: ["image"] }, - ["blocking"], -); -``` - -Here's another version: - -```js -function randomColor() { - return `#${Math.floor(Math.random() * 16777215).toString(16)}`; -} - -const pattern = "https://mdn.mozillademos.org/*"; - -let image = ` - - - -`; - -function listener(details) { - const redirectUrl = `data:image/svg+xml,${encodeURIComponent(image)}`; - return { redirectUrl }; -} - -browser.webRequest.onBeforeRequest.addListener( - listener, - { urls: [pattern], types: ["image"] }, - ["blocking"], -); -``` - -{{WebExtExamples}} - -> **Note:** This API is based on Chromium's [`chrome.webRequest`](https://developer.chrome.com/docs/extensions/reference/webRequest/#event-onBeforeRequest) API. This documentation is derived from [`web_request.json`](https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/web_request.json) in the Chromium code. -> -> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License. - - diff --git a/files/ko/mozilla/add-ons/webextensions/manifest.json/content_scripts/index.md b/files/ko/mozilla/add-ons/webextensions/manifest.json/content_scripts/index.md deleted file mode 100644 index 1657843111cd9a..00000000000000 --- a/files/ko/mozilla/add-ons/webextensions/manifest.json/content_scripts/index.md +++ /dev/null @@ -1,353 +0,0 @@ ---- -title: content_scripts -slug: Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts ---- - -{{AddonSidebar}} - - - - - - - - - - - - - - - - - - - - -
TypeArray
MandatoryNo
Manifest version2 or higher
Example -
-"content_scripts": [
-  {
-    "matches": ["*://*.mozilla.org/*"],
-    "js": ["borderify.js"]
-  }
-]
-
- -Instructs the browser to load [content scripts](/ko/docs/Mozilla/Add-ons/WebExtensions/Content_scripts) into web pages whose URL matches a given pattern. - -This key is an array. Each item is an object which: - -- **must** contain a key named **`matches`**, which specifies the URL patterns to be matched in order for the scripts to be loaded; -- **may** contain keys named **`js`** and **`css`**, which list scripts and/or stylesheets to be loaded into matching pages; and -- **may** contain a number of other properties that control finer aspects of how and when content scripts are loaded. - -Details of all the keys you can include are given in the table below. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
- all_frames - Boolean -
-
true
-
-

- Inject the scripts specified in - js and - css into all frames matching the - specified URL requirements, even if the frame is not the topmost - frame in a tab. This does not inject into child frames where only - their parent matches the URL requirements and the child frame does - not match the URL requirements. The URL requirements are checked - for each frame independently. -

-
-

- Note: This also applies to any tracker or ad - that uses iframes, which means that enabling this could make - your content script get called dozens of times on some pages. -

-
-
-
false
-
- Inject only into frames matching the URL requirements which are the - topmost frame in a tab. -
-
-

Defaults to false.

-
- css - Array -

- An array of paths, relative to manifest.json, referencing - CSS files that will be injected into matching pages. -

-

- Files are injected in the order given, and at the time specified by - run_at. -

-
-

- Note: Firefox resolves URLs in injected CSS files - relative to the CSS file itself, rather than to the page it's - injected into. -

-
-
- exclude_globs - Array - An array of strings containing wildcards. See - Matching URL patterns below. -
- exclude_matches - Array - An array of - match patterns. See Matching URL patterns below. -
- include_globs - Array - An array of strings containing wildcards. See - Matching URL patterns below. -
- js - Array -

- An array of paths, relative to manifest.json, referencing - JavaScript files that will be injected into matching pages. -

-

- Files are injected in the order given. This means that, for example, - if you include jQuery here followed by another content script, like - this: -

-
-"js": ["jquery.js", "my-content-script.js"]
-

Then, "my-content-script.js" can use jQuery.

-

- The files are injected after any files in - css, and at the time specified by - run_at. -

-
- match_about_blank - Boolean -

- Insert the content scripts into pages whose URL is - "about:blank" or "about:srcdoc", if the URL - of the page that opened or created this page - matches the patterns specified in - the rest of the content_scripts key. -

-

- This is especially useful to run scripts in empty iframes , whose URL - is "about:blank". To do this you should also set the - all_frames key. -

-

- For example, suppose you have a content_scripts key like - this: -

-
-  "content_scripts": [
-    {
-      "js": ["my-script.js"],
-      "matches": ["https://example.org/"],
-      "match_about_blank": true,
-      "all_frames": true
-    }
-  ]
-

- If the user loads https://example.org/, and this page - embeds an empty iframe, then "my-script.js" will be - loaded into the iframe. -

-
-

- Note: match_about_blank is supported - in Firefox from version 52. -

-

- Note that in Firefox, content scripts won't be injected into empty - iframes at "document_start", even if you specify that - value in run_at . -

-
-
- matches - Array -

- An array of - match patterns. See - Matching URL patterns below. -

-

This is the only mandatory key.

-
- run_at - String -

- This option determines when the files specified in - css and - js are injected. You can supply one of - three strings here, each of which identifies a state in the process of - loading a document. The states directly correspond to - {{domxref("Document/readyState", "Document.readyState")}}: -

-
-
"document_start"
-
- Corresponds to loading. The DOM is still loading. -
-
"document_end"
-
- Corresponds to interactive. The DOM has finished - loading, but resources such as scripts and images may still be - loading. -
-
"document_idle"
-
- Corresponds to complete. The document and all its - resources have finished loading. -
-
-

The default value is "document_idle".

-

- In all cases, files in js are injected - after files in css. -

-
- -## Matching URL patterns - -The `"content_scripts"` key attaches content scripts to documents based on URL matching: if the document's URL matches the specification in the key, then the script will be attached. There are four properties inside `"content_scripts"` that you can use for this specification: - -- `matches` - - : an array of [match patterns](/ko/docs/Mozilla/Add-ons/WebExtensions/Match_patterns) -- `exclude_matches` - - : an array of [match patterns](/ko/docs/Mozilla/Add-ons/WebExtensions/Match_patterns) -- `include_globs` - - : an array of [globs](#globs) -- `exclude_globs` - - : an array of [globs](#globs) - -To match one of these properties, a URL must match at least one of the items in its array. For example, given a property like: - -```json -"matches": ["*://*.example.org/*", "*://*.example.com/*"] -``` - -Both `http://example.org/` and `http://example.com/` will match. - -Since `matches` is the only mandatory key, the other three keys are used to limit further the URLs that match. To match the key as a whole, a URL must: - -- match the `matches` property -- AND match the `include_globs` property, if present -- AND NOT match the `exclude_matches` property, if present -- AND NOT match the `exclude_globs` property, if present - -### globs - -A _glob_ is just a string that may contain wildcards. - -There are two types of wildcard, and you can combine them in the same glob: - -1. `*` matches zero or more characters -2. `?` matches exactly one character. - -For example: `"*na?i"` would match `"illuminati"` and `"annunaki"`, but not `"sagnarelli"`. - -## Example - -```json -"content_scripts": [ - { - "matches": ["*://*.mozilla.org/*"], - "js": ["borderify.js"] - } -] -``` - -This injects a single content script `borderify.js` into all pages under `mozilla.org` or any of its subdomains, whether served over HTTP or HTTPS. - -```json - "content_scripts": [ - { - "exclude_matches": ["*://developer.mozilla.org/*"], - "matches": ["*://*.mozilla.org/*"], - "js": ["jquery.js", "borderify.js"] - } - ] -``` - -This injects two content scripts into all pages under `mozilla.org` or any of its subdomains except `developer.mozilla.org`, whether served over HTTP or HTTPS. - -The content scripts see the same view of the DOM and are injected in the order they appear in the array, so `borderify.js` can see global variables added by `jquery.js`. - -## 브라우저 호환성 - -{{Compat}} diff --git a/files/ko/mozilla/add-ons/webextensions/manifest.json/page_action/index.md b/files/ko/mozilla/add-ons/webextensions/manifest.json/page_action/index.md deleted file mode 100644 index 14042dbea2ee40..00000000000000 --- a/files/ko/mozilla/add-ons/webextensions/manifest.json/page_action/index.md +++ /dev/null @@ -1,105 +0,0 @@ ---- -title: page_action -slug: Mozilla/Add-ons/WebExtensions/manifest.json/page_action ---- - -{{AddonSidebar}} - - - - - - - - - - - - - - - - - - - - -
TypeObject
MandatoryNo
Manifest version2 or higher
Example -
-"page_action": {
-  "browser_style": true,
-  "default_icon": {
-    "19": "button/geo-19.png",
-    "38": "button/geo-38.png"
-  },
-  "default_title": "Whereami?",
-  "default_popup": "popup/geo.html"
-}
-
- -페이지 액션은 브라우저의 URL 바 안에 추가되는 아이콘이다. - -필요하면 HTML, CSS, 그리고 자바스크립트를 사용하는 팝업을 띄울 수 있다. - -팝업이 있으면, 아이콘을 클릭할 때 팝업이 열리고, 팝업 안의 자바스크립트가 사용자와의 상호작업을 처리할 수 있다. 팝업이 없으면, 아이콘을 클릭할 때 확장의 [background 스크립트](/en-US/Add-ons/WebExtensions/Anatomy_of_a_WebExtension#Background_pages)에 click 이벤트가 전달된다. - -[pageAction API](/en-US/Add-ons/WebExtensions/API/pageAction)을 사용하면 프로그램적으로 페이지 액션을 만들고 관리할 수 있다. - -페이지 액션은 브라우저 액션과 비슷하다. 단지 브라우저 전체가 아니라 특정 웹페이지와만 연관된다는 점이 다르다. 액션의 대상 페이지가 분명하다면 그 페이지에서만 표시되는 페이지 액션을 사용해야 한다. 액션이 모든 페이지를 대상으로 하거나 브라우저 그 자체가 대상이라면 브라우저 액션을 사용하라. - -브라우저 액션은 기본이 표시되는 것이지만 페이지 액션은 기본적으로 숨겨진다. 탭에 [`pageAction.show()`](/en-US/Add-ons/WebExtensions/API/pageAction/show)를 호출하거나, `show_matches` 속성을 줘야 표시할 수 있다. - -## 문법 - -`page_action`은 세 가지 속성들 중에 몇 가지를 가지는 객체다(역주: 파이어폭스 외의 브라우저에서도 지원되는 속성은 세가지 뿐이다). 모두 선택사항이다: - -| Name | Type | Description | -| --------------------------------------------------------------------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [`browser_style`](/ko/docs/Mozilla/Add-ons/WebExtensions/user_interface/Browser_styles) | `Boolean` | 선택, 기본값은 `false`.사용하면, 팝업과 브라우저의 UI와 `browser_style`을 사용하는 다른 확장의 모습이 일관되게 보이게 하는 스타일시트를 포함한다. 기본값은 `false`지만 팝업이 브라우저의 다른 UI와 일관되게 하려면, 스타일시트가 포함될 수 있도록 `true`로 하는 것이 권장한다.파이어폭스에서, 이 스타일시트는 chrome://browser/content/extension.css에서 볼 수 있다. OS X에서는 chrome://browser/content/extension-mac.css다.[파이어폭스 스타일 가이드](https://firefoxux.github.io/StyleGuide/#/controls)는 팝업의 요소가 특정 스타일을 갖게하는 클래스들에 대해 설명한다.[최종-다운로드](https://github.com/mdn/webextensions-examples/tree/master/latest-download) 예제 확장 프로그램은 팝업에 `browser_style`을 사용한다. | -| `default_icon` | `Object` or `String` | 액션이 사용하는 아이콘.권장은 19x19 픽셀과 38x38 픽셀 두 종류가 제공되는 것이다. 아래처럼 각각 "19" 와 "38"이라는 속성 이름을 사용한다: |
"page_action": {"browser_style": true,"default_icon": {"19": "button/geo-19.png","38": "button/geo-38.png"},"default_title": "Whereami?","default_popup": "popup/geo.html"}
이렇게 하면 화면 해상도에 따라 적절한 크기를 사용하게 된다.아래처럼 하나의 문자열로 할 수도 있다:
"default_icon": "geo.png"
이렇게 하면 툴바에 맞게 크기가 조정될 것이다. 흐릿해질 수 있다. | -| `default_popup` | `String` | 팝업으로 띄울 HTML 파일의 경로.HTML 파일은 일반 웹 페이지처럼 [``](/ko/docs/Web/HTML/Element/link)와 [`