From da78a9e329e272dedb2400b79a3bdeebff387d47 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:17 -0500 Subject: initial commit --- .../webextensions/user_interface/index.html | 96 +++++++++++++++++++++ .../user_interface/page_actions/index.html | 98 ++++++++++++++++++++++ 2 files changed, 194 insertions(+) create mode 100644 files/ko/mozilla/add-ons/webextensions/user_interface/index.html create mode 100644 files/ko/mozilla/add-ons/webextensions/user_interface/page_actions/index.html (limited to 'files/ko/mozilla/add-ons/webextensions/user_interface') diff --git a/files/ko/mozilla/add-ons/webextensions/user_interface/index.html b/files/ko/mozilla/add-ons/webextensions/user_interface/index.html new file mode 100644 index 0000000000..e9041bc4dc --- /dev/null +++ b/files/ko/mozilla/add-ons/webextensions/user_interface/index.html @@ -0,0 +1,96 @@ +--- +title: User interface +slug: Mozilla/Add-ons/WebExtensions/user_interface +tags: + - Landing + - NeedsTranslation + - TopicStub + - User Interface + - WebExtensions +translation_of: Mozilla/Add-ons/WebExtensions/user_interface +--- +
{{AddonSidebar}}
+ +

Extensions that use WebExtension APIs are provided with several user interface options so that their functionality can be made available to the user. A summary of those options is provided below, with a more detailed introduction to each user interface option in this section.

+ +
+

For advice on using these UI components to create a great user experience in your extension, please see the User experience best practices article.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
UI optionDescriptionExample
Toolbar button (browser action)A button on the browser toolbar that dispatches an event to the extension when clicked. By default, the button is visible in all tabs.Example showing a toolbar button (browser action).
Toolbar button with a popupA popup on a button in the browser toolbar that opens when the button is clicked. The popup is defined in an HTML document that handles the user interaction.Example of the pop-up on a toolbar button
Address bar button (page action)A button on the browser address bar that dispatches an event to the extension when clicked. By default, the button is hidden in all tabs.Example showing an address bar button (page action)
Address bar button with a popupA popup on a button in the browser address bar that opens when the button is clicked. The popup is defined in an HTML document that handles the user interaction.Example of a popup on the address bar button
Context menu itemMenu items, checkboxes, and radio buttons on one or more of the browser's context menus. Also, menus can be structured by adding separators. When menu items are clicked, an event is dispatched to the extension.Example of content menu items added by a WebExtension, from the context-menu-demo example
Sidebar +

An HTML document displayed next to a web page, with the option for unique content per page. The sidebar is opened when the extension is installed, then obeys the user's sidebar visibility selection. User interaction within the sidebar is handled by its HTML document.

+
Example of a sidebar
Options pageA page that enables you to define preferences for your extension that your users can change. The user can access this page from the browser's add-ons manager.Example showing the options page content added in the favorite colors example.
Extension pageUse web pages included in your extension to provide forms, help, or any other content required, within windows or tabs.Example of a simple bundled page displayed as a detached panel.
NotificationTransient notifications displayed to the user through the underlying operating system's notifications mechanism. Dispatches an event to the extension when the user clicks a notification, or when a notification closes (either automatically or at the user's request).Example of an extension triggered system notification
Address bar suggestionOffer custom address bar suggestions when the user enters a keyword.Example showing the result of the firefox_code_search WebExtension's customization of the address bar suggestions.
Developer tools panelA tab with an associated HTML document that displays in the browser's developer tools.Example showing the result of the firefox_code_search WebExtension's customization of the address bar suggestions.
+ +

The following how-to guides provide step-by-step guidance to creating some of these user interface options:

+ + diff --git a/files/ko/mozilla/add-ons/webextensions/user_interface/page_actions/index.html b/files/ko/mozilla/add-ons/webextensions/user_interface/page_actions/index.html new file mode 100644 index 0000000000..568d5feb97 --- /dev/null +++ b/files/ko/mozilla/add-ons/webextensions/user_interface/page_actions/index.html @@ -0,0 +1,98 @@ +--- +title: Address bar button +slug: Mozilla/Add-ons/WebExtensions/user_interface/Page_actions +tags: + - 사용자 인터페이스 + - 웹확장 +translation_of: Mozilla/Add-ons/WebExtensions/user_interface/Page_actions +--- +
{{AddonSidebar}}
+ +

주소줄에 추가되는 버튼으로 사용자가 확장 프로그램과 상호작용하는 일명 페이지 액션을 말한다.

+ +

+ +

페이지 액션과 브라우저 액션

+ +

주소줄 버튼(또는 페이지 액션)은 툴바 버튼(또는 브라우저 액션)과 아주 비슷하다.

+ +

차이점은:

+ + + +

하고자 하는 동작이 현재 페이지에 대한 것이면 페이지 액션을 사용하고, 전체 또는 여러 페이지가 대상이라면 브라우저 액션을 사용한다. 예를 들어:

+ + + + + + + + + + + + + + + + + + + + + + + + +
유형Bookmarks actionContent actionTabs operation
페이지 액션Bookmark this pageReddit enhancementSend tab
브라우저 액션Show all bookmarksEnable ad-blockingSync all open tabs
+ +

 

+ +

페이지 액션 기술하기

+ +

 

+ +

페이지 액션의 속성은 manifest.json의 page_action 항목에서 정의한다:

+ +
"page_action": {
+  "browser_style": true,
+  "default_icon": {
+    "19": "button/geo-19.png",
+    "38": "button/geo-38.png"
+  },
+  "default_title": "Whereami?"
+}
+ +

꼭 있어야 하는 항목은 default_icon이다.

+ +

페이지 액션을 기술하는 길은 두 가지다: 팝업이 있는가. 없는가. 팝업이 없으면, 사용자 클릭은 pageAction.onClicked을 청취하는 확장 프로그램에 이벤트를 전달된다:

+ +
browser.pageAction.onClicked.addListener(handleClick);
+ +

팝업이 있으면, 클릭 이벤트는 없다: 대신, 팝업창이 열린다. 사용자는 팝업으로 일을 하고, 팝업창 바깥을 클릭하면 자동으로 닫힌다. 팝업 글에 팝업을 만들고 관리하는 보다 자세한 내용이 있다.

+ +

주목! 확장 프로그램은 페이지 액션을 하나만 가질 수 있다.

+ +

페이지 액션의 속성은 pageAction API로 프로그램적으로 바꿀 수 있다.

+ +

아이콘

+ +

페이지 액션에서 어떻게 아이콘을 만들고 사용하는지에 대한 자세한 내용은 Photon Design System 문서에서 Iconography을 보라.

+ +

예제

+ +

GitHub webextensions-examples 저장소에 팝업없는 페이지 액션 예제 chill-out가 있다.

-- cgit v1.2.3-54-g00ecf