From 1109132f09d75da9a28b649c7677bb6ce07c40c0 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:45 -0500 Subject: initial commit --- .../extensions/bootstrapped_extensions/index.html | 226 +++++++++++++++++++++ files/es/extensions/community/index.html | 19 ++ files/es/extensions/index.html | 107 ++++++++++ .../es/extensions/m\303\263vil_clone/index.html" | 86 ++++++++ 4 files changed, 438 insertions(+) create mode 100644 files/es/extensions/bootstrapped_extensions/index.html create mode 100644 files/es/extensions/community/index.html create mode 100644 files/es/extensions/index.html create mode 100644 "files/es/extensions/m\303\263vil_clone/index.html" (limited to 'files/es/extensions') diff --git a/files/es/extensions/bootstrapped_extensions/index.html b/files/es/extensions/bootstrapped_extensions/index.html new file mode 100644 index 0000000000..da7cdec4db --- /dev/null +++ b/files/es/extensions/bootstrapped_extensions/index.html @@ -0,0 +1,226 @@ +--- +title: Bootstrapped extensions +slug: Extensions/Bootstrapped_extensions +translation_of: Archive/Add-ons/Bootstrapped_extensions +--- +

{{ gecko_minversion_header("2.0") }}

+

Habitualmente los complementos incluyen overlays, en donde la aplicación puede montar el XUL del paquete del complemento y automaticamente aplicarlo en la interfaz de usuario. Mientras creas complementos puedes agregarlos a la interfaz de usuario facilmente, esto se refiere a la actualizaciones, instalaciones, o a deshabilitar el complemento que requiere de un reinicio.

+

Gecko 2.0 {{ geckoRelease("2.0") }} introduce bootstrapped extensions. These are special extensions that, instead of using overlays to apply their user interface to the application, programmatically insert themselves into the application. This is done using a special script file that's included in the extension that contains functions the browser calls to command the extension to install, uninstall, start up, and shut down.

+

All the application does is call into this script file; the extension is responsible for adding and removing its user interface and handling any other setup and shutdown tasks it requires.

+

This article discusses how bootstrapped extensions work.

+

As an aside, all extensions created using the Add-on SDK or Add-on Builder are bootstrapped; however, because all the bootstrapping code is generated for you, you don't really need to think about it.

+

The startup and shutdown process

+

A key feature of bootstrapped extensions is that they must be able to be started up and shut down on demand by the application. When the extension's startup() function is called, it must manually inject its user interface and other behavior into the application. Similarly, when its shutdown() function is called, it must remove anything it's added to the application, as well as all references to any of its objects.

+

There are several scenarios in which the startup() function may be called; for example:

+ +

Some examples of when the shutdown() function may be called:

+ +

Notes on modifying the application user interface

+

chrome.manifest in bootstrapped add-ons

+

You can use a chrome.manifest file in bootstrapped add-ons to:

+
    +
  1. make your add-on's content available via a chrome:// URL (using the content, locale, and skin instructions in the manifest);
  2. +
  3. replace existing chrome:// URIs with your content (using the override instruction).
  4. +
+

Not all chrome.manifest instructions are supported in bootstrapped add-ons, for example you still cannot register XUL Overlays from a bootstrapped add-on. See the chrome.manifest documentation for details.

+

In Firefox 10 and later the chrome.manifest file located in the root of the add-on's XPI (i.e. a sibling of the install.rdf) is loaded automatically. In Firefox 8 and 9 you had to load/unload the manifest manually using {{ ifmethod("nsIComponentManager", "addBootstrappedManifestLocation") }} and {{ ifmethod("nsIComponentManager", "removeBootstrappedManifestLocation") }}. This feature was unavailable in Firefox versions before 8.

+

Adding user interface manually

+

If you decide to go ahead and try to develop a bootstrapped extension that modifies the application's user interface, here are a few suggestions to get you started.

+

You need to look up the relevant application UI elements by their ID by calling {{ domxref("document.getElementById()") }}, then manipulate them to inject your UI. For example, you can get access to the menu bar in Firefox with document.getElementById("main-menubar").

+

Be sure that at shutdown time, you remove any user interface you've added.

+

Creating a bootstrapped extension

+

To mark an extension as bootstrappable, you need to add the following element to its install manifest:

+
<em:bootstrap>true</em:bootstrap>
+

Then you need to add a bootstrap.js file that contains the required functions; this should be alongside the install.rdf file in the extension's package.

+

Backward compatibility

+

Because older versions of Firefox don't know about the bootstrap property or bootstrap.js file, it's not overly difficult to create an XPI that will work on both as a bootstrappable extension and as a traditional extension. Create your extension as a bootstrappable extension, then add the traditional overlays as well. Newer versions of Firefox will use the bootstrap.js script, ignoring the components and overlays, while older versions will use the overlays.

+

Bootstrap entry points

+

The bootstrap.js script should contain several specific functions, which are called by the browser to manage the extension. The script gets executed in a privileged sandbox, which is cached until the extension is shut down.

+

startup

+

Called when the extension needs to start itself up. This happens at application launch time or when the extension is enabled after being disabled (or after it has been shut down in order to install an update. As such, this can be called many times during the lifetime of the application.

+

This is when your add-on should inject its UI, start up any tasks it may need running, and so forth.

+
void startup(
+  data,
+  reason
+);
+
+
Parameters
+
+
+ data
+
+ A bootstrap data structure.
+
+ reason
+
+ One of the reason constants, indicating why the extension is being started up. This will be one of APP_STARTUP, ADDON_ENABLE, ADDON_INSTALL, ADDON_UPGRADE, or ADDON_DOWNGRADE.
+
+

shutdown

+

Called when the extension needs to shut itself down, such as when the application is quitting or when the extension is about to be upgraded or disabled. Any user interface that has been injected must be removed, tasks shut down, and objects disposed of.

+
void shutdown(
+  data,
+  reason
+);
+
+
Parameters
+
+
+ data
+
+ A bootstrap data structure.
+
+ reason
+
+ One of the reason constants, indicating why the extension is being shut down. This will be one of APP_SHUTDOWN, ADDON_DISABLE, ADDON_UNINSTALL, ADDON_UPGRADE, or ADDON_DOWNGRADE.
+
+

install

+

Your bootstrap script must include an install() function, which the application calls before the first call to startup() after the extension is installed, upgraded, or downgraded.

+
+ Note: This method is never called if the extension has never been started; for example, if an extension is installed but isn't compatible with the current version of the application, install() never gets called if it is uninstalled before becoming compatible. However, if the extension gets upgraded to a version that's compatible with the application, its install() function will be called at that time, before the first startup() call.
+
void install(
+  data,
+  reason
+);
+
+
Parameters
+
+
+ data
+
+ A bootstrap data structure.
+
+ reason
+
+ One of the reason constants, indicating why the extension is being installed. This will be one of ADDON_INSTALL, ADDON_UPGRADE, or ADDON_DOWNGRADE.
+
+

uninstall

+

This function is called after the last call to shutdown() before a particular version of an extension is uninstalled. This will not be called if install() was never called.

+
+ Note: It's important to keep in mind that uninstall() can be called even on extensions that are currently disabled, or are not compatible with the current application. Because of this, it's crucial that the function be implemented to gracefully handle APIs that may not be present in the application. This function will also not be called if a third-party application removes the extension while Firefox isn't running.
+
void uninstall(
+  data,
+  reason
+);
+
+
Parameters
+
+
+ data
+
+ A bootstrap data structure.
+
+ reason
+
+ One of the reason constants, indicating why the extension is being uninstalled. This will be one of ADDON_UNINSTALL, ADDON_UPGRADE, or ADDON_DOWNGRADE.
+
+

Reason constants

+

The bootstrap functions accept a reason parameter, which explains to the extension why it's being called. The reason constants are:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ConstantValueDescription
APP_STARTUP1The application is starting up.
APP_SHUTDOWN2The application is shutting down.
ADDON_ENABLE3The add-on is being enabled.
ADDON_DISABLE4The add-on is being disabled. (Also sent during uninstallation)
ADDON_INSTALL5The add-on is being installed.
ADDON_UNINSTALL6The add-on is being uninstalled.
ADDON_UPGRADE7The add-on is being upgraded.
ADDON_DOWNGRADE8The add-on is being downgraded.
+

Bootstrap data

+

Each of the entry points is passed a simple data structure containing some useful information about the add-on being bootstrapped. More information about the add-on can be obtained by calling AddonManager.getAddonByID(). The data is a simple JavaScript object with the following properties:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyTypeDescription
idstringThe ID of the add-on being bootstrapped.
versionstringThe version of the add-on being bootstrapped.
installPathnsIFileThe installation location of the add-on being bootstrapped. This may be a directory or an XPI file depending on whether the add-on is installed unpacked or not.
resourceURInsIURIA URI pointing at the root of the add-ons files, this may be a jar: or file: URI depending on whether the add-on is installed unpacked or not. {{ gecko_minversion_inline("7.0") }}
oldVersionstringThe previously installed version, if the reason is ADDON_UPGRADE or ADDON_DOWNGRADE, and the method is install or startup. {{ gecko_minversion_inline("22.0") }}
newVersionstringThe version to be installed, if the reason is ADDON_UPGRADE or ADDON_DOWNGRADE, and the method is shutdown or uninstall. {{ gecko_minversion_inline("22.0") }}
+
+

Note: An add-on may be upgraded/downgraded at application startup, in this case the startup method reason is APP_STARTUP, and the oldVersion property is not set. Also be aware that in some circumstances an add-on upgrade/downgrade may occur without the uninstall method being called.

+
+

Further reading

+ diff --git a/files/es/extensions/community/index.html b/files/es/extensions/community/index.html new file mode 100644 index 0000000000..699927cb7a --- /dev/null +++ b/files/es/extensions/community/index.html @@ -0,0 +1,19 @@ +--- +title: Community +slug: Extensions/Community +translation_of: Extensions/Community +--- +
+
Si usted sabe de listas de correo, grupos de noticias útiles, foros u otras comunidades relacionadas con el desarrollo de extensión, por favor enlace a ellos aquí.
+
+ + diff --git a/files/es/extensions/index.html b/files/es/extensions/index.html new file mode 100644 index 0000000000..40e31c78b3 --- /dev/null +++ b/files/es/extensions/index.html @@ -0,0 +1,107 @@ +--- +title: Extensiones +slug: Extensions +tags: + - Complementos + - Todas_las_Categorías + - extensiones + - para_revisar +translation_of: Mozilla/Add-ons +--- +
+ Construir una extensión
+ Explica paso a paso cómo crear una extensión para Firefox.
+
+ Las Extensiones son pequeños add-ons (complementos, agregados) que añaden nuevas funcionalidades a las aplicaciones Mozilla, tales como Firefox y Thunderbird. Las extensiones permiten añadir a dichas aplicaciones cualquier cosa, desde un botón para una barra de herramientas hasta características totalmente nuevas. Permiten personalizar completamente la aplicación para ajustarla a las necesidades de cada usuario, sin aumentar de forma significativa el tamaño de la misma.
+

Las extensiones son distintas de los Plugins, que ayudan al navegador a mostrar contenidos específicos como la reproducción de archivos multimedia. Las extensiones también son diferentes de los plugins de búsqueda, que añaden buscadores adicionales a la barra de búsquedas.

+ + + + + + + +
+

Documentación

+
General (aplicable para todas las aplicaciones Mozilla)
+
+
+ Creando una extensión
+
+ Este tutorial indica los pasos necesarios para desarrollar una extensión muy básica, la cual añadirá un texto que diga "Hello, World!" en el panel de la barra de estado de Firefox.
+
+
+
+ Preguntas frecuentes sobre Extensiones
+
+ Esta es una recopilación de respuestas breves a los problemas más frecuentes en el desarrollo de extensiones.
+
+
+
+ Construye tu propia extensión
+
+ Pequeño tutorial de introducción a XUL y a la creación de una extensión para Firefox en el wiki de Mundogeek.
+
+
+
+ Empaquetado de extensiones
+
+ Las extensiones son una forma de paquete instalable que pueden descargarse e instalarse por el usuario, o proporcionarse pre-empaquetadas con una aplicación o por un programa externo.
+
+
+
+ Crear un panel lateral en Firefox
+
+ Este artículo es un punto de partida para la creación de nuevos paneles laterales para Firefox. El objetivo es la creación de un panel lateral vacío que pueda ser utilizado como inicio para nuevas aplicaciones que se ubiquen en dichos paneles laterales.
+
+
+
+ Crear una extensión en la barra de estado
+
+ Éste es el primero de una serie de artículos que demostrarán cómo crear progresivamente extensiones cada vez más complejas para el navegador Firefox.
+
+
+
+ Crear una extensión personalizada de Firefox con el Mozilla Build System
+
+ Cómo configurar el espacio de trabajo para una extensión que usa componentes binarios.
+
+
Aplicación Específica
+

Firefox

+

Thunderbird

+

SeaMonkey Soporte de Extensiones en SeaMonkey 2

+

Firefox en Android

+

Fennec (navegador movíl)

+

Ver todos

+
+
+
+

Comunidad

+ +
    +
  • Foros sobre extensiones en comunidad Mozilla... en inglés.
  • +
+

{{ DiscussionList("dev-extensions", "mozilla.dev.extensions") }}

+

Ver todo

+

Herramientas

+ +

Ver todo

+

Temas relacionados

+
+
+ XUL, JavaScript, XPCOM, Temas
+
+
+

Categorías

+

Interwiki Language Links

diff --git "a/files/es/extensions/m\303\263vil_clone/index.html" "b/files/es/extensions/m\303\263vil_clone/index.html" new file mode 100644 index 0000000000..37294a9df9 --- /dev/null +++ "b/files/es/extensions/m\303\263vil_clone/index.html" @@ -0,0 +1,86 @@ +--- +title: Extensiones de Firefox para Android +slug: Extensions/Móvil_clone +tags: + - API + - Browser + - Desarrolladores + - Developer + - Español + - Extensions + - Interfáz de Usuario + - Mobile + - Mozilla + - Móvil + - Spanish + - Tutoriales + - Tutorials + - UI + - desarrollo + - movil(2) +--- +

Los siguientes artículos proporcionan ayuda con el desarrollo de extensiones para Firefox en Android. Además, por favor, consulte la documentación general de las extensiones que se aplica a todas las aplicaciones de Mozilla.

+ + + + + + + + +
+

Documentación

+ +
Tutoriales
+ +
+
Tutorial
+
El desarrollo, el envasado y la instalación de un sencillo complemento para Firefox para Android.
+
Inicialización y Limpieza
+
Cómo inicializar el complemento cuando se inicia y limpiar cuando está apagado.
+
Creación de una interfaz de usuario
+
Una guía rápida para el uso de la API NativeWindow para crear componentes de interfaz de usuario.
+
Interación con el navegador
+
Una guía rápida para el uso de la API BrowserApp para acceder a las pestañas del navegador y el contenido web que alojan.
+
+ +

Consultas a la API y ejemplos de código

+ +
+
NativeWindow
+
Crea widgets nativos para la interfaz de Android.
+
BrowserApp
+
Acceso a las pestañas del navegador y al contenido que éste aloja.
+
Fragmentos de código
+
Ejemplos de códigos para tareas comunes.
+
+
+

Comunidad

+ +
    +
  • +

    Ver foros de desarrollo de extensiones de Mozilla.

    +
  • +
+ +

{{ DiscussionList("dev-extensions", "mozilla.dev.extensions") }}

+ + + +

Herramientas

+ + + +

Ver todas...

+
+ +

Temas Relacionados

+ +
+
XUL, JavaScript, XPCOM, Temas, Desarrollo de Mozilla
+
+ +

Ver todas las páginas con el tag "Extensiones"...

-- cgit v1.2.3-54-g00ecf