From a065e04d529da1d847b5062a12c46d916408bf32 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 21:46:22 -0500 Subject: update based on https://github.com/mdn/yari/issues/2028 --- files/pt-pt/mozilla/add-ons/amo/index.html | 9 - .../add-ons/amo/policy/em_destaque/index.html | 85 -- files/pt-pt/mozilla/add-ons/amo/policy/index.html | 19 - .../add-ons/amo/policy/revis\303\265es/index.html" | 160 --- .../index.html" | 518 ---------- .../pt-pt/mozilla/add-ons/distribuicao/index.html | 78 -- .../linhas_diretrizes_para_extras/index.html | 8 - files/pt-pt/mozilla/add-ons/sdk/index.html | 97 -- .../add-ons/themes/conceitos_tema/index.html | 230 ----- files/pt-pt/mozilla/add-ons/themes/index.html | 49 - .../creating_a_skin_for_firefox/index.html | 33 - .../mozilla/add-ons/themes/obsolete/index.html | 10 - files/pt-pt/mozilla/add-ons/thunderbird/index.html | 135 --- .../mozilla/calendar/calendar_versions/index.html | 1037 -------------------- files/pt-pt/mozilla/calendar/index.html | 80 -- .../criacao_barra_lateral_firefox/index.html | 40 - .../index.html" | 95 -- .../edi\303\247\303\243o_programador/index.html" | 36 - .../mozilla/firefox/multiple_profiles/index.html | 244 ----- .../cross_process_object_wrappers/index.html | 157 --- .../depuracao_de_frame_scripts/index.html | 56 -- .../gestor_de_mensagens/index.html | 74 -- .../multiprocess_firefox/glossario/index.html | 36 - .../firefox/multiprocess_firefox/index.html | 79 -- .../limitacoes_de_chrome_scripts/index.html | 215 ---- .../limitacoes_de_frame_scripts/index.html | 103 -- .../quais_os_uris_que_carregam_e_onde/index.html | 62 -- .../resumo_t\303\251cnico/index.html" | 164 ---- files/pt-pt/mozilla/firefox_for_android/index.html | 77 -- .../index.html | 97 -- .../index.html | 77 -- files/pt-pt/mozilla/ligar/index.html | 117 --- .../index.html" | 282 ------ .../configuracao_inicial/index.html" | 81 -- .../fase_da_traducao/index.html" | 120 --- .../fase_de_lancamento/index.html" | 177 ---- .../fase_pr/index.html" | 212 ---- .../index.html" | 41 - files/pt-pt/mozilla/localization/index.html | 23 - files/pt-pt/mozilla/localization/index/index.html | 9 - .../localization/localizacao_e_plurais/index.html | 384 -------- .../localizar_com_mercurial/index.html | 256 ----- .../index.html" | 138 --- files/pt-pt/mozilla/mercurial/basicos/index.html | 61 -- files/pt-pt/mozilla/mercurial/index.html | 41 - .../mercurial/instaacao_mercurial/index.html | 151 --- .../pt-pt/mozilla/o0coes_linha_comandos/index.html | 486 --------- .../performance/about_colon_memory/index.html | 187 ---- .../index.html | 53 - files/pt-pt/mozilla/performance/index.html | 145 --- .../perfilar_com_o_profiler_integrado/index.html | 356 ------- files/pt-pt/mozilla/persona/index.html | 153 --- files/pt-pt/mozilla/phishing/index.html | 50 - files/pt-pt/mozilla/projects/emscripten/index.html | 42 - files/pt-pt/mozilla/projects/index.html | 14 - files/pt-pt/mozilla/projects/mailnews/index.html | 42 - files/pt-pt/mozilla/projects/rhino/index.html | 24 - .../thunderbird/localizacao_thunderbird/index.html | 100 -- files/pt-pt/mozilla/tech/index.html | 14 - files/pt-pt/mozilla/tech/places/index.html | 75 -- .../mozilla/tech/xpcom/armazenamento/index.html | 372 ------- .../index.html" | 222 ----- files/pt-pt/mozilla/tech/xpcom/guide/index.html | 21 - files/pt-pt/mozilla/tech/xpcom/index.html | 52 - .../tech/xpcom/reference/glue_classes/index.html | 13 - .../pt-pt/mozilla/tech/xpcom/reference/index.html | 27 - .../tech/xul/attribute/textbox.type/index.html | 5 - .../autoconfiguration/fileformat/como/index.html | 243 ----- .../fileformat/definicao/index.html | 6 - .../autoconfiguration/fileformat/index.html | 10 - .../configuracao_autom\303\241tica/index.html" | 162 --- files/pt-pt/mozilla/thunderbird/index.html | 69 -- .../mozilla/thunderbird/lancamentos/index.html | 19 - .../index.html | 397 -------- .../index.html" | 552 ----------- 75 files changed, 10164 deletions(-) delete mode 100644 files/pt-pt/mozilla/add-ons/amo/index.html delete mode 100644 files/pt-pt/mozilla/add-ons/amo/policy/em_destaque/index.html delete mode 100644 files/pt-pt/mozilla/add-ons/amo/policy/index.html delete mode 100644 "files/pt-pt/mozilla/add-ons/amo/policy/revis\303\265es/index.html" delete mode 100644 "files/pt-pt/mozilla/add-ons/cri\303\247\303\243o_de_extens\303\265es_firefox_com_sistema_mozilla/index.html" delete mode 100644 files/pt-pt/mozilla/add-ons/distribuicao/index.html delete mode 100644 files/pt-pt/mozilla/add-ons/linhas_diretrizes_para_extras/index.html delete mode 100644 files/pt-pt/mozilla/add-ons/sdk/index.html delete mode 100644 files/pt-pt/mozilla/add-ons/themes/conceitos_tema/index.html delete mode 100644 files/pt-pt/mozilla/add-ons/themes/index.html delete mode 100644 files/pt-pt/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/index.html delete mode 100644 files/pt-pt/mozilla/add-ons/themes/obsolete/index.html delete mode 100644 files/pt-pt/mozilla/add-ons/thunderbird/index.html delete mode 100644 files/pt-pt/mozilla/calendar/calendar_versions/index.html delete mode 100644 files/pt-pt/mozilla/calendar/index.html delete mode 100644 files/pt-pt/mozilla/criacao_barra_lateral_firefox/index.html delete mode 100644 "files/pt-pt/mozilla/cria\303\247\303\243o_de_um_complemento_de_dicion\303\241rio_de_verifica\303\247\303\243o_ortogr\303\241fica/index.html" delete mode 100644 "files/pt-pt/mozilla/firefox/edi\303\247\303\243o_programador/index.html" delete mode 100644 files/pt-pt/mozilla/firefox/multiple_profiles/index.html delete mode 100644 files/pt-pt/mozilla/firefox/multiprocess_firefox/cross_process_object_wrappers/index.html delete mode 100644 files/pt-pt/mozilla/firefox/multiprocess_firefox/depuracao_de_frame_scripts/index.html delete mode 100644 files/pt-pt/mozilla/firefox/multiprocess_firefox/gestor_de_mensagens/index.html delete mode 100644 files/pt-pt/mozilla/firefox/multiprocess_firefox/glossario/index.html delete mode 100644 files/pt-pt/mozilla/firefox/multiprocess_firefox/index.html delete mode 100644 files/pt-pt/mozilla/firefox/multiprocess_firefox/limitacoes_de_chrome_scripts/index.html delete mode 100644 files/pt-pt/mozilla/firefox/multiprocess_firefox/limitacoes_de_frame_scripts/index.html delete mode 100644 files/pt-pt/mozilla/firefox/multiprocess_firefox/quais_os_uris_que_carregam_e_onde/index.html delete mode 100644 "files/pt-pt/mozilla/firefox/multiprocess_firefox/resumo_t\303\251cnico/index.html" delete mode 100644 files/pt-pt/mozilla/firefox_for_android/index.html delete mode 100644 files/pt-pt/mozilla/how_to_get_a_stacktrace_for_a_bug_report/index.html delete mode 100644 files/pt-pt/mozilla/implementacao_do_pontoon_num_projeto_da_mozilla/index.html delete mode 100644 files/pt-pt/mozilla/ligar/index.html delete mode 100644 "files/pt-pt/mozilla/localization/aplica\303\247\303\243o_tradu\303\247\303\243o_com_mercurial/index.html" delete mode 100644 "files/pt-pt/mozilla/localization/guia_inicia\303\247\303\243o_r\303\241pida/configuracao_inicial/index.html" delete mode 100644 "files/pt-pt/mozilla/localization/guia_inicia\303\247\303\243o_r\303\241pida/fase_da_traducao/index.html" delete mode 100644 "files/pt-pt/mozilla/localization/guia_inicia\303\247\303\243o_r\303\241pida/fase_de_lancamento/index.html" delete mode 100644 "files/pt-pt/mozilla/localization/guia_inicia\303\247\303\243o_r\303\241pida/fase_pr/index.html" delete mode 100644 "files/pt-pt/mozilla/localization/guia_inicia\303\247\303\243o_r\303\241pida/index.html" delete mode 100644 files/pt-pt/mozilla/localization/index.html delete mode 100644 files/pt-pt/mozilla/localization/index/index.html delete mode 100644 files/pt-pt/mozilla/localization/localizacao_e_plurais/index.html delete mode 100644 files/pt-pt/mozilla/localization/localizar_com_mercurial/index.html delete mode 100644 "files/pt-pt/mozilla/localization/localiza\303\247\303\243o_com_pontoon/index.html" delete mode 100644 files/pt-pt/mozilla/mercurial/basicos/index.html delete mode 100644 files/pt-pt/mozilla/mercurial/index.html delete mode 100644 files/pt-pt/mozilla/mercurial/instaacao_mercurial/index.html delete mode 100644 files/pt-pt/mozilla/o0coes_linha_comandos/index.html delete mode 100644 files/pt-pt/mozilla/performance/about_colon_memory/index.html delete mode 100644 files/pt-pt/mozilla/performance/comunicacao_de_um_problema_de_desempenho/index.html delete mode 100644 files/pt-pt/mozilla/performance/index.html delete mode 100644 files/pt-pt/mozilla/performance/perfilar_com_o_profiler_integrado/index.html delete mode 100644 files/pt-pt/mozilla/persona/index.html delete mode 100644 files/pt-pt/mozilla/phishing/index.html delete mode 100644 files/pt-pt/mozilla/projects/emscripten/index.html delete mode 100644 files/pt-pt/mozilla/projects/index.html delete mode 100644 files/pt-pt/mozilla/projects/mailnews/index.html delete mode 100644 files/pt-pt/mozilla/projects/rhino/index.html delete mode 100644 files/pt-pt/mozilla/projects/thunderbird/localizacao_thunderbird/index.html delete mode 100644 files/pt-pt/mozilla/tech/index.html delete mode 100644 files/pt-pt/mozilla/tech/places/index.html delete mode 100644 files/pt-pt/mozilla/tech/xpcom/armazenamento/index.html delete mode 100644 "files/pt-pt/mozilla/tech/xpcom/guide/altera\303\247\303\265es_xpcom_gecko_2.0/index.html" delete mode 100644 files/pt-pt/mozilla/tech/xpcom/guide/index.html delete mode 100644 files/pt-pt/mozilla/tech/xpcom/index.html delete mode 100644 files/pt-pt/mozilla/tech/xpcom/reference/glue_classes/index.html delete mode 100644 files/pt-pt/mozilla/tech/xpcom/reference/index.html delete mode 100644 files/pt-pt/mozilla/tech/xul/attribute/textbox.type/index.html delete mode 100644 files/pt-pt/mozilla/thunderbird/autoconfiguration/fileformat/como/index.html delete mode 100644 files/pt-pt/mozilla/thunderbird/autoconfiguration/fileformat/definicao/index.html delete mode 100644 files/pt-pt/mozilla/thunderbird/autoconfiguration/fileformat/index.html delete mode 100644 "files/pt-pt/mozilla/thunderbird/configuracao_autom\303\241tica/index.html" delete mode 100644 files/pt-pt/mozilla/thunderbird/index.html delete mode 100644 files/pt-pt/mozilla/thunderbird/lancamentos/index.html delete mode 100644 files/pt-pt/mozilla/trabalhar_com_janelas_no_codigo_chrome/index.html delete mode 100644 "files/pt-pt/mozilla/utiliza\303\247\303\243o_cxx_no_c\303\263digo_da_mozilla/index.html" (limited to 'files/pt-pt/mozilla') diff --git a/files/pt-pt/mozilla/add-ons/amo/index.html b/files/pt-pt/mozilla/add-ons/amo/index.html deleted file mode 100644 index 3857ed65ca..0000000000 --- a/files/pt-pt/mozilla/add-ons/amo/index.html +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: AMO -slug: Mozilla/Add-ons/AMO -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Add-ons/AMO ---- -

Content to be added.

diff --git a/files/pt-pt/mozilla/add-ons/amo/policy/em_destaque/index.html b/files/pt-pt/mozilla/add-ons/amo/policy/em_destaque/index.html deleted file mode 100644 index 71eafffe67..0000000000 --- a/files/pt-pt/mozilla/add-ons/amo/policy/em_destaque/index.html +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: AMO - Políticas de Extensões em Destaque -slug: Mozilla/Add-ons/AMO/Policy/Em_destaque -translation_of: Mozilla/Add-ons/AMO/Policy/Featured ---- -

{{AddonSidebar}}

- -

Featured add-ons are top-quality extensions and themes highlighted on AMO, Firefox's Add-ons Manager, and across other Mozilla websites. These add-ons showcase the power of Firefox customization and are useful to a wide audience.

- -

Featured extensions are chosen by the Featured Extensions Advisory Board, a small group of extension developers and fans from the Mozilla community who have volunteered to review and vote on nominations.

- -

Todos os meses, são escolhidas novas extensões em destaque.

- -

Critérios para Extensões em Destaque

- -

Before nominating an extension to be featured, please ensure it meets the following criteria:

- -
    -
  1. The extension must have a complete and informative listing on AMO. This means: -
      -
    • a 64-pixel custom icon
    • -
    • a clear and concise name (no lengthy keywords)
    • -
    • a clear and concise summary of the extension's functionality
    • -
    • detailed description and privacy policy, if applicable
    • -
    • updated screenshots of the extension's functionality
    • -
    -
  2. -
  3. The extension must have excellent user reviews and any problems or support requests must be promptly addressed by the developer.
  4. -
  5. The extension must have a minimum of 500 users.
  6. -
  7. The extension must be built with WebExtensions API.
  8. -
  9. The extension must be compatible with the latest release of Firefox.
  10. -
  11. Most importantly, the extension must have wide consumer appeal to Firefox's users and be outstanding in nearly every way: user experience, performance, security, and usefulness or entertainment value.
  12. -
- -

Painel de Descoberta

- -

The Get Add-ons section (also referred to as the Discovery Pane) in about:addons serves a distinct editorial function: it is a tightly curated list of extensions and themes selected by Mozilla staff to address an array of the most common user needs (e.g. ad blockers, screenshot tools, etc.). The Discovery Pane is primarily intended to introduce extensions to Firefox users who have limited experience with browser customization. As such, we only select extensions that meet the highest standards of functionality, user experience, and Firefox compatibility.

- -

Only content that is part of AMO’s Featured Extensions collection will be considered for the Discovery Pane; please note that featured content must meet certain criteria.

- -

Discovery Pane content is updated monthly, though some highly popular extensions may remain on the page for an indefinite period of time.

- -

If you’d like to nominate a great extensions for consideration in the Discovery Pane, please send us a link to the add-on on AMO to amo-featured@mozilla.org and we’ll add your nomination to the editorial review queue. There’s no need to mention you’re nominating add-ons specifically for the Discovery Pane, but feel free to note that if you like.

- -

Nomear um Extra

- -

If you wish to nominate an extension to be featured and it meets the criteria above, send an email to amo-featured@mozilla.org with:

- - - -

Extension nominations are reviewed by the Advisory Board once a month. Common reasons for rejection include lacking wide appeal to consumers, a suboptimal user experience, quality or security issues, incompatibility, and similarity to another featured extension. Rejected extension cannot be re-nominated within 3 months.

- -

Rodar Extensões em Destaque

- -

Mozilla and the Featured Extensions Advisory Board regularly evaluate and rotate out featured extensions. Some of the most common reasons for extensions being removed from the featured list are:

- - - -

Aderir ao Conselho Consultivo de Extensões em Destaque

- -

Every six months a new Advisory Board is chosen based on applications from the add-ons community. Members must:

- - - -

Members of the Mozilla Add-ons team may veto any extension's selection because of security, privacy, compatibility, or any other reason, but in general it is up to the Board to select extensions to feature.

- -

This featured policy only applies to the addons.mozilla.org global list of featured extensions. Extensions featured in other locations are often pulled from this list, but Mozilla may feature any extension in other locations without the Board's consent. Additionally, locale-specific features override the global defaults, so if a locale has opted to select its own features, some or all of the global features may not appear in that locale.

- -

Follow the Add-ons Blog or @mozamo on Twitter to learn when the next application period opens.

- -

Última atualização: 12 de abril de 2018

- -

How up-and-coming add-ons become featured and what's involved in the process.

diff --git a/files/pt-pt/mozilla/add-ons/amo/policy/index.html b/files/pt-pt/mozilla/add-ons/amo/policy/index.html deleted file mode 100644 index 2dd894f5bd..0000000000 --- a/files/pt-pt/mozilla/add-ons/amo/policy/index.html +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: Políticas AMO -slug: Mozilla/Add-ons/AMO/Policy -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Add-ons/AMO/Policy ---- -

Mozilla está empenhada em garantir uma grande experiência com os extras para os nossos utilizadores e desenvolvedores. Por favor, reveja as políticas abaixo antes de submeter o seu extra.

- -
-
Developer Agreement
-
Effective January 5, 2016
Review Process
-
Add-ons extend the core capabilities of Firefox, allowing users to modify and personalize their Web experience. A healthy add-on ecosystem, built on trust, is vital for developers to be successful and users to feel safe making Firefox their own. For these reasons, Mozilla requires all add-ons to comply with the following set of policies on acceptable practices. The below is not intended to serve as legal advice, nor is it intended to serve as a comprehensive list of terms to include in your add-on’s privacy policy.
Featured Add-ons
-
How up-and-coming add-ons become featured and what's involved in the process.
Contacting us - -

How to get in touch with us regarding these policies or your add-on.

- -
diff --git "a/files/pt-pt/mozilla/add-ons/amo/policy/revis\303\265es/index.html" "b/files/pt-pt/mozilla/add-ons/amo/policy/revis\303\265es/index.html" deleted file mode 100644 index 96e6d880f5..0000000000 --- "a/files/pt-pt/mozilla/add-ons/amo/policy/revis\303\265es/index.html" +++ /dev/null @@ -1,160 +0,0 @@ ---- -title: Políticas de Extras -slug: Mozilla/Add-ons/AMO/Policy/Revisões -tags: - - Extras - - Política de Revisão -translation_of: Mozilla/Add-ons/AMO/Policy/Reviews ---- -

{{AddonSidebar}}

- -

Os extras estendem os recursos principais do Firefox, permitindo que os utilizadores modifiquem e personalizem a sua experiência na Web. Um ecossistema de extras saudável, baseado na confiança, é vital para que os programadores sejam bem-sucedidos e os utilizadores se sintam seguros, tornando o Firefox deles próprio. Por estes motivos, a Mozilla requer que todos os extras estejam em conformidade com o seguinte conjunto de políticas sobre as práticas aceitáveis. O abaixo, não se destina para servir como aconselhamento jurídico, nem pretende servir como uma lista abrangente de termos para incluir na política de privacidade do seu extra.

- -

Todos os extras estão sujeitos a estas políticas, independentemente de como eles são distribuídos. Os extras que não estejam em conformidade com estas políticas podem estar sujeitos à rejeição ou desativação pela Mozilla.

- -

Sem Surpresas

- -

As surpresas podem ser apropriadas em muitas situações, mas não são bem-vindas quando a segurança, a privacidade e o controlo do utilizador estão em jogo. É extremamente importante ser o mais transparente possível quando submeter um extra. Os utilizadores deverão ser capazes de discernir facilmente qual é a funcionalidade do seu extra e não receber experiências inesperadas do utilizador depois de o instalal.

- -

Funcionalidades Inesperadas

- -

“Funcionalidades" inesperadas são aquelas que não estão relacionadas com a função principal do extra e provavelmente não são do nome do extra ou da descrição esperada por um utilizador que está a instalar esse extra.

- -

Um extra deveria incluir qualquer funcionalidade inesperada que se enquadre numa das seguintes categorias:

- - - -

Então, a(s) funcionalidade(s) "inesperada(s)" devem seguir todos os seguintes requisitos:

- - - -

Conteúdo

- -

Os extras que utilizarem as marcas registadas da Mozilla devem obedecer à Política de Marcas Registadas da Mozilla. Se o extra utiliza “Firefox” no seu nome, o padrão de nomeação que o extra deve seguir é “<nome do Extra> por Firefox”.

- -

Além disso, os extras listados em Extras para o Firefox (AMO) devem seguir as seguintes políticas:

- - - -

Linhas Diretrizes de Submissão

- -

Os extras devem funcionar apenas conforme o descrito e devem fornecer uma experiência de utilizador atraente. Com base na descrição do extra, um utilizador deve ser capaz de entender e utilizar os recursos do extra sem exigir conhecimento especializado. Dicas sobre como criar uma boa experiência do utilziador para o seu extra podem ser encontradas aqui.

- -

During review, the add-on undergoes basic testing in addition to code review. To facilitate the functional testing, the add-on author must provide testing information and, if applicable, testing credentials required to use the add-on if an account is needed for any part of the add-on’s functionality.

- -

Issues brought up during review must be addressed using best efforts. If corrections have been requested, the new version should not contain unrelated changes, as this complicates the review process and can lead to further rejections.

- -

Submissão de Código Fonte

- -

Add-ons may contain transpiled, obfuscated, minified or otherwise machine-generated code, but Mozilla needs to review a copy of the human-readable source code. The author must provide this information to Mozilla during submission as well as instructions on how to reproduce the build.

- -

The provided source code will be reviewed by an administrator and will not be redistributed in any way. The code will only be used for the purpose of reviewing the add-on. Failure to provide this information will result in rejection.

- -

Please read our Source Code Submission guidelines to avoid unexpected rejections.

- -

Práticas de Desenvolvimento

- -

In general, developers are free to maintain their add-ons in the manner they choose. However, in order to maintain appropriate data security and effectively review code, we do have certain technical requirements that all add-ons must meet. In particular, potentially dangerous APIs may only be used in ways that are demonstrably safe, and code within add-ons that cannot be verified as behaving safely and correctly may need to be refactored.

- -

While any code, method or practice in a submitted add-on is subject to review and rejection, the following requirements are of particular importance:

- - - -

Gestão, Recolha e Divulgação de Dados

- -

You must disclose how the add-on collects, uses, stores and shares user data in the privacy policy field on AMO. Mozilla expects that the add-on limits data collection whenever possible, in keeping with Mozilla’s Lean Data Practices and Mozilla’s Data Privacy Principles, and uses the data only for the purpose for which it was originally collected.

- -

User data includes all information the add-on collects, regardless of the manner. It can be personal data actively provided by the user (such as a name or email address), technical data (such as operating system, build ID, version numbers, crash reports, activation, updates), and interaction or activity data (add-on activity data, visited URLs, console logs), including interactions with Firefox.

- -

The add-on’s privacy policy must be the full policy text; it cannot be a link to an externally hosted privacy policy. In addition, the privacy policy must:

- - - -

A summary of this information must be included in the add-on’s listing description. Finally, you and your add-on must also comply with all applicable data privacy laws as well as any other laws that may apply to your specific add-on.

- -

Interações do Utilizador e Dados Técnicos

- - - -

Cookies

- - - -

Dados Pessoais

- - - -

Protocolos de Privacidade Adicionais

- - - -

Vulnerabilidades de Segurança

- -

Because add-ons run in an environment with elevated privileges relative to ordinary web pages, they present a very serious set of security considerations. They have the potential to open security holes not only in the add-ons themselves, but also in the browser, in web pages, and, in particularly distressing cases, the entire system the browser is running on.

- -

As a result, we take our security policies very seriously and apply them to all add-ons, whether hosted on AMO or not. We expect all add-ons to be secure and well-maintained in handling both their own data and their user’s data. They must also securely manage all of their interactions with the web, the browser and the operating system.

- -

Monetização

- - - -

Conformidade e Lista de Bloqueio

- -

Para os extras que não correspondem com estas políticas, a Mozilla pode rejeitar ou bloquear as versões afetadas ou extras completos, dependendo da extensão da sua não conformidade.

- -

Geralmente, a Mozilla tentará entrar em contacto com o(s) programador(es) do extra e fornecer um prazo razoável para que os problemas sejam corrigidos antes que um bloqueio seja implementado. Se um extra for considerado malicioso ou se os seus programadores tiverem se mostrado inalcançáveis ou não responderem, ou no caso de violações recorrentes, a inclusão na listagem de bloqueio ser imediata.

- -

A Mozilla reserva o direito de bloquear ou eliminar a conta do programador em addons.mozilla.org, evitando assim a utilização adicional do serviço.

diff --git "a/files/pt-pt/mozilla/add-ons/cri\303\247\303\243o_de_extens\303\265es_firefox_com_sistema_mozilla/index.html" "b/files/pt-pt/mozilla/add-ons/cri\303\247\303\243o_de_extens\303\265es_firefox_com_sistema_mozilla/index.html" deleted file mode 100644 index 35a9c7fbe1..0000000000 --- "a/files/pt-pt/mozilla/add-ons/cri\303\247\303\243o_de_extens\303\265es_firefox_com_sistema_mozilla/index.html" +++ /dev/null @@ -1,518 +0,0 @@ ---- -title: >- - Criação de extensões personalizadas do Firefox com o sistema de criação da - Mozilla -slug: Mozilla/Add-ons/Crição_de_extensões_Firefox_com_Sistema_Mozilla -translation_of: >- - Archive/Add-ons/Creating_Custom_Firefox_Extensions_with_the_Mozilla_Build_System ---- -

{{AddonSidebar}}

- -

Existe uma abundância de  material na criação de extensões para Firefox. Todos estes documentos atualmente assumem, contudo, que está a desenvolver a sua extensão utilizando apena JavaScript e XUL. Para extenões complexas, poderá ser necessário criar componentes em C++ que proporcionam uma funcionalidade adicional. Os motivos pelos quais poderá querer incluir componentes C++ na sua extensão incluem:

- -
-
-
-
-
-
 
-
-
-
-
-
- - - -
Note: With the modern JIT Javascript Engine in Gecko and js-ctypes more extension code can be written only in JavaScript than ever before.  Please consider all of your options carefully before deciding to use native code (C++) in your extension. In addition, binary components need to be recompiled for every major Firefox release, which can be frustrating.
- -

This article describes how to set up the development environment for a large, complex Firefox extension with any or all of the above-mentioned requirements. I should also stress that you do not have to build Mozilla or use the Mozilla build system if you want to create C++ components for Mozilla. If you are just looking to create an XPCOM component or two, this is probably overkill, and you might want to take a look at this guide instead. On the other hand, if you are an experienced developer or team, and you know that you are going to build a large, complex extension, you would do well to consider the approach described in this article.

- -

One final note: I’ve only tried these techniques inside Firefox, but they’ll probably work more or less unchanged on other Gecko-based platforms like Thunderbird or Seamonkey. If someone can confirm this and/or provide guidelines for what’s different, I’ll update the article to incorporate this information.

- -

Bambi Cruza-se com Mozilla

- -

None of this is for the faint of heart. In particular, the initial step involves building Mozilla, which is a huge - nay, gargantuan! - project. Many intelligent developers have been driven to the brink of insanity trying to build it for the first time. If you're not an experienced C++ developer, I wouldn’t even bother. Stick to JavaScript.

- -

Nas Plataformas do Windows

- -

The first time I built Mozilla I used this guide. I can’t even remember why anymore, but I got stuck in a number of places, and the whole affair ended up taking far longer than I originally expected. Much furniture was smashed, much hair torn out by the roots. Here’s a comprehensive looking guide that’s gotten good reviews. Follow every step methodically and you’ll probably be alright. Focus on the fact that once you get the build working, it’ll probably work effortlessly from then on. Maybe.

- -

Em Outras Plataformas

- -

On other platforms, namely Linux and MacOS, the process is much easier. All the tools for building are available built-in, and therefore all you have to do is run some commands in the terminal. You can find full instructions for almost any OS here.

- -

Estruturar o Seu Projeto

- -

Mozilla includes a number of complex extensions that are integrated into its build process. It has thus been necessary to solve all of the issues involved in creating and registering XPCOM components, building JAR files and manifests, installing the lot into the Firefox extensions/ directory and so forth. So it behooves us to piggyback on this infrastructure to build our extension.

- -

First of all, think of a catchy name for your extension and create a directory with that name under the /mozilla/extensions/ directory. Use only lowercase letters. You should see a bunch of other directories (inspector/, reporter/ and so forth) at the same level in the build tree.

- -

Note that before actually building anything, the Mozilla build system invokes a configuration process that generates the actual makefiles used for the build from makefile templates called Makefile.in. The actual makefiles tend to be very similar or identical to the templates, but the extra flexibility gained from having the makefiles generated dynamically is one of the things that makes the build system so powerful.

- -

Anatomia de uma Extensão C++ Simples

- -

We assume that you are using C++ to write XPCOM components that can be used either from other C++ components or from JavaScript. The process of creating a component is actually relatively straightforward when the Mozilla build system is used.

- -

In the simplest case, a component will consist of a single main directory with two subdirectories, public/ and src/. The main directory and each subdirectory must contain a Makefile.in (from now on I’ll just refer to this file as a makefile although we know that it is actually used to generate the real makefile). This makefile says two things. First of all, it lists the subdirectories that make up the extension, so the build system knows where to look for additional makefiles. Secondly, it instructs the build system to create a new extension, rather than copying the components directly into Firefox’s binary directory. The main advantage of using an extension is that it is easy to package everything up and install it on another machine.

- -

So here’s your basic, plain-vanilla top-level makefile (Makefile.in in the main extension directory):

- -
DEPTH		= ../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE = myextension
-
-DIRS		= public src
-
-XPI_NAME		= myextension
-INSTALL_EXTENSION_ID	= myextension@mycompany.com
-XPI_PKGNAME		= myextension
-
-DIST_FILES = install.rdf
-
-include $(topsrcdir)/config/rules.mk
-
- -

A detailed description of the make process, describing the key features of this makefile, can be found here. MODULE and XPI_NAME are both set to the name of your extension; they should be repeated in all project makefiles so that all of the files land in the same place in the XPI staging area (see below). INSTALL_EXTENSION_ID is the unique ID of your extension. This can be a GUID, but the format shown above is prettier and, let’s face it, a lot easier to remember. You don’t have to provide an XPI_PKGNAME, but if you do an XPI file, suitable for distribution, is automatically created in the root of the XPI staging area (/mozilla/$(MOZ_OBJDIR)/dist/xpi-stage/).

- -

Every extension must include an install.rdf file that tells Firefox how to install it. This file should be located in the main extension directory and look something like this:

- -
<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>myextension@mycompany.com</em:id>
-    <em:version>0.1</em:version>
-
-    <em:targetApplication>
-      <!-- Firefox -->
-      <Description>
-        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-        <em:minVersion>1.0+</em:minVersion>
-        <em:maxVersion>1.0+</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-    <!-- front-end metadata -->
-    <em:name>My First Extension</em:name>
-    <em:description>Just an example.</em:description>
-    <em:creator>allpeers.com</em:creator>
-    <em:homepageURL>http://www.allpeers.com/blog/</em:homepageURL>
-  </Description>
-</RDF>
-
- -

There's a detailed description of the format of the install.rdf file. Use the DIST_FILES variable in the makefile to tell make to copy the file into the extension directory and (optional) XPI file.

- -

Interfaces Públicas

- -

The public/ directory contains any interfaces that need to be accessed by other modules. These can be IDL files describing XPCOM interfaces, which are used to generate normal C++ header files for inclusion in your source files. They can also be normal C++ header files that are to be used directly by other modules. The easiest way to accomplish the latter is to use inline implementations for all methods so you don’t have any additional linking dependencies. Otherwise you will have to link statically to your module if you use these public headers in other modules. Personally I would discourage this practice (among other things, static linking means the same code gets loaded more than once into memory, and the code won’t be available from JavaScript or other non-C++ languages) and encourage the use of XPCOM wherever possible.

- -

The makefile in the public/ directory should follow this model:

- -
DEPTH		= ../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE		= myextension
-XPIDL_MODULE	= myextension
-
-XPI_NAME = myextension
-
-EXPORTS = \
-  myHeader.h \
-  $(NULL)
-
-XPIDLSRCS = \
-  myIFirstComponent.idl \
-  myISecondComponent.idl \
-  $(NULL)
-
-include $(topsrcdir)/config/rules.mk
-
- -

XPIDL_MODULE is the name of the generated XPT file that contains type information about your IDL interfaces. If you have multiple modules, make absolutely sure that you use a different value for XPIDL_MODULE for each one. Otherwise the first module’s XPT file will be overwritten by the second and you’ll get NS_ERROR_XPC_BAD_IID errors when you try to access its IDL interfaces from your code. The files under EXPORTS are copied directly to the /mozilla/$(MOZ_OBJDIR)/dist/include/ directory and are thus accessible from other modules (the value of MOZ_OBJDIR is defined in /mozilla/.mozconfig). XPIDLSRCS are run through the IDL processor, and the generated C++ headers are copied into the same include directory. In addition, an XPT (type library) file is generated and placed in the components/ subdirectory of your extension.

- -

Ficheiros Fonte

- -

Now it’s time to create the makefile and source files in the src/ subdirectory. If you're implementing interfaces that you've described using IDL, the easiest way to do this is to leave the src/ directory empty and run make on the public/ directory only; this will be explained shortly.

- -

Then open the generated header file for your interface from /mozilla/$(MOZ_OBJDIR)/dist/include/. It contains stubs for the component .H and .CPP files that you can copy and paste into your implementation files. All you have to do is fill in the implementation stubs in the C++ file and you’re good to go.

- -

Here’s an example of the makefile you need to place into your src directory:

- -
DEPTH		= ../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-IS_COMPONENT = 1
-MODULE = myextension
-LIBRARY_NAME =  myExtension
-USE_STATIC_LIBS = 1
-
-XPI_NAME = myextension
-
-CPPSRCS	= \
-  myFirstComponent.cpp \
-  mySecondComponent.cpp \
-  myExtension.cpp \
-  $(NULL)
-
-include $(topsrcdir)/config/rules.mk
-
-EXTRA_DSO_LDOPTS += \
-  $(MOZ_COMPONENT_LIBS) \
-  $(NSPR_LIBS) \
-  $(NULL)
-
- -

In this example, the first two files contain the implementation of the extension’s two components. The final file, myExtension.cpp, contains the code necessary to register these components, as described in the next section.

- -

Registar os Seus Componentes

- -

Este artigo explica como registar os componentes XPCOM no Gecko 2.0 e superior.

- -

Criação de Extensão

- -

As mentioned above, you’ll probably want to build your extension immediately after creating your IDL files in order to generate the C++ stubs for your component implementations. I’m assuming that you’ve already built Firefox successfully. If not, return immediately to the beginning of this article and don’t come back til you have a functioning firefox.exe. Do not pass go. Do not collect $200.

- -

Still here? Okay, now we have to modify your .mozconfig (in the /mozilla/ root directory) so that your extension is built along with Mozilla. Add the following line at the end of the file:

- -
ac_add_options --enable-extensions=default,myextension
-
- -

Now launch make from the Mozilla root:

- -
make -f client.mk build
-
- -

Even if you have an up-to-date Firefox build, you’ll have to wait a while for make to recurse over the entire Mozilla source tree looking for new stuff (on my machine, which is pretty fast, this takes a good 10-15 minutes). Eventually it will reach your extension and generate a bunch of stuff under /mozilla/$(MOZ_OBJDIR)/:

- - - -

A lot of this stuff won’t get created on this first pass since make will gag when it doesn’t find the source files for your components. Don’t worry about this; all you need are the generated header files that contain the C++ implementation stubs. Go back and flesh out the C++ implementation of your components so that the build can complete next time. Remember that you should never, ever modify any of these generated files. Always modify the files used to generate them and rerun make. If you’re changing the generated files directly, you’re probably doing something wrong.

- -

The process of walking the entire Mozilla tree takes a long time. If you already have a Mozilla build, you can avoid this by creating a makefile for your extension directly. Go to the root of your $(MOZ_OBJDIR) and (from a bash-compatible shell) enter:

- -
../build/autoconf/make-makefile extensions/myextension
-
- -

If your $(MOZ_OBJDIR) is located outside your $(TOPSRCDIR), you'll need to do:

- -
$(TOPSRCDIR)/build/autoconf/make-makefile -t $(TOPSRCDIR) extensions/myextension
-
- -

in order for the script to know where your source is (it'll use the extension path you gave it relative to the current dir to figure out where you want your makefiles to go).

- -

This will generate the proper makefile for your extension. Whether you build the whole Mozilla tree or take this shortcut, you can build from now on by going to /mozilla/$(MOZ_OBJDIR)/extensions/myextension/ and typing "make" on the command line. It should build your component without bothering with the rest of Mozilla. If everything works out, you’ll see your XPI file in the XPI staging area. You’ll also see the "exploded" version of the XPI (i.e. the unzipped directory structure) underneath /mozilla/$(MOZ_OBJDIR)/dist/bin/extensions. (If something goes wrong, figure out what, fix it and then come back here and add it to this article.)

- -

To make sure that the build really finished, launch Firefox and check that your extension is listed when you select Tools/Extensions. If you are using Firefox as your regular browser (and if you’re not, why not!?), you might be annoyed by the fact that you have to close regular Firefox before running your custom-built version. If so, try setting the MOZ_NO_REMOTE environment variable to "1" before running the development version of Firefox. You’ll also need to use a different profile for your development version:

- -
firefox -P development
-
- -

Where development is replaced with the name of the extra profile you’ve created. This will let you run both versions of Firefox simultaneously, saving you oodles of time over the course of the build/test cycle.

- -

Nenhum Local Como o Chrome

- -

Yippee-ki-yay! Now you have an extension that does, well, absolutely nothing. It’s time to do something with those groovy components that you’ve implemented and registered. The simplest way to do this is to write some JavaScript and XUL code. At this point, it would be very helpful to have a bit of experience writing "regular" extensions (i.e. without using custom C++ components). If you’ve never done this, I strongly recommend that you think of a cool idea for something simple that you’ve always wanted to tweak in Firefox and write it. Just displaying a new menu item that opens a "Hello, World!" dialog box would be already be a great exercise to get warmed up with.

- -

Assuming you know how to write XUL/JavaScript extensions, you’re aware that the most important stuff goes in the chrome/ directory of your extension. Well, the fact that you’re also using C++ components doesn’t change that one whit. So now you need to create the normal content/, locale/ and skin/ directories in which to place your chrome files. Personally I like placing these directly under the root directory of my module, but I don’t suppose it makes any difference if you prefer putting them under a chrome/ subdirectory or whatever. Let freedom reign!

- -

Once you’ve written the necessary chrome files (for instance, an overlay that adds a menu item to instantiate and use one of your components), you need to package them up as part of your extension. This is accomplished through the use of a JAR Manifest. For our simple extension example, this file might look something like this:

- -
myextension.jar:
-%  content myextension %content/
-%  locale myextension en-US %locale/en-US/
-%  skin myextension classic/1.0 %skin/classic/
-%  overlay chrome://browser/content/browser.xul chrome://myextension/content/MyExtensionOverlay.xul
-	content/MyExtensionOverlay.js		(content/MyExtensionOverlay.js)
-	content/MyExtensionOverlay.xul		(content/MyExtensionOverlay.xul)
-	locale/en-US/MyExtension.dtd		(locale/en-US/MyExtension.dtd)
-	locale/en-US/MyExtension.properties	(locale/en-US/MyExtension.properties)
-	skin/classic/MyExtension.css		(skin/classic/MyExtension.css)
-
- -

Place this code in a file called jar.mn in the root directory of your extension, making sure that the paths in parentheses point to actual files (when interpreted relative to the root directory). You also have to make one small change to the makefile in the same directory, adding the following line:

- -
USE_EXTENSION_MANIFEST = 1
-
- -

This tells make to create a single manifest file called chrome.manifest instead of creating separate manifests with goofy names for each package.

- -

Now launch make again, and you should see a chrome subdirectory appear in your extension (/mozilla/$(MOZ_OBJDIR)/dist/bin/extensions/myextension@mycompany.com/). Note that the chrome directory contains a JAR (i.e. ZIP) file with all the chrome files listed in jar.mn as well as a complete directory structure mirroring that of the JAR file. The directory structure, however, is empty. Why? I don’t know. Don’t worry about this, the files in the JAR are the ones that are actually used.

- -

Mantedo-a Complexa

- -

If you’re developing a really complex extension with lots of XPCOM components, you’ll probably want to divide your code up into smaller modules.

- -
Kinda, Sorta Complex Extensions
- -

For a moderately complex extension, it’s probably enough just to subdivide the code into a single level of modules. Let’s assume that you have a base/ module that defines a bunch of basic XPCOM components and an advanced/ module that defines some chrome as well as other components that use the basic components. Your complete directory structure will look something like this:

- - - -

Other than that, nothing really changes. The makefiles in the base/ and advanced/ directories should look more or less like your original root makefile, remembering to change the DEPTH variable to account for the fact that they’ve moved a level further away from the Mozilla root. You also need to remove the DIST_FILES variable since that’s going to be in the top-level makefile. Every makefile that generates anything should define the XPI_NAME variable to make sure generated files go into your extension and not into the global components/ directory. In fact, just define this in every makefile to be safe. You can use the same MODULE in both base/ and advanced/ so that all the generated include files go into the same directory, but make sure that you don’t use the same XPIDL_MODULE in the two public/ directories or one of the component type libraries (i.e. XPT files) will overwrite the other one and all hell will break loose.

- -

Each module must also have a different value for the LIBRARY_NAME variable. This is the name of the generated dynamic library, so if we call the libraries "myBase" and "myAdvanced", we’ll end up with myBase.dll and myAdvanced.dll (on Windows, at least). And each of these modules is going to have a separate C++ file for registering components. So there will be two files that look like myExtension.cpp in the original example, say Base.cpp and Advanced.cpp. Finally, each module will obviously have its own jar.mn, though they can reference the same JAR filename and package name if you want all the chrome files to be organized in a single JAR file and package. The only file that really stays put is install.rdf, which still exists once and only once in the extension root directory.

- -

As for the top-level makefile, it will now look like this:

- -
DEPTH		= ../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE = myextension
-
-DIRS		= base advanced
-
-XPI_NAME               = myextension
-INSTALL_EXTENSION_ID   = myextension@mycompany.com
-XPI_PKGNAME		= myextension
-
-DIST_FILES = install.rdf
-
-include $(topsrcdir)/config/rules.mk
-
- -
Extensões Complexas Sérias
- -

At some point, even a single module may grow to the point where you want to divide it further into submodules. The difference between having separate modules and having a single module with separate submodules is that the submodules all share the same file for registering components (the famous myExtension.cpp file), and when compiled they create a single dynamic library. The decision to split a module into submodules is all about code organization; it doesn’t really affect the final product at all.

- -

To split a module into submodules, first create a subdirectory for each submodule. Then create an additional directory called build/. Each submodule will be configured to create a static library, and the build/ directory will pull these libraries together to create a single dynamic component library. Confused? Here’s an example, showing just the advanced/ subbranch of the myextension/ directory:

- - - -

As you can see, we’ve split advanced/ into two submodules: intricate/ and multifarious/, and we’ve added an additional build/ subdirectory. We’ve left the chrome directories directly under advanced/, since they aren’t tied to any specific submodule. This means that jar.mn will stay in the same place.

- -

The intricate/ and multifarious/ makefiles will look a lot like the original advanced/ makefile, but we’ll need to tweak them a bit. As always, we have to adjust the DEPTH variable since the makefiles are deeper in the directory structure. And we should change the LIBRARY_NAME to indicate that we’re generating a static library for each submodule. By convention the "_s" suffix is used for this purpose. So let’s call them "myIntricate_s" and "myMultifarious_s". Finally, we define the variable FORCE_STATIC_LIB, resulting in a makefile that starts something like this:

- -
DEPTH		= ../../../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE = myextension
-LIBRARY_NAME = myIntricate_s
-FORCE_STATIC_LIB = 1
-USE_STATIC_LIBS = 1
-
-XPI_NAME = myextension
-
-...more stuff here...
-
- -

The build makefile pulls together the static libraries generated by the submodules and creates a single (dynamic) component library:

- -
DEPTH		= ../../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-IS_COMPONENT = 1
-MODULE = myextension
-LIBRARY_NAME = myAdvanced
-USE_STATIC_LIBS = 1
-
-XPI_NAME = myextension
-
-DEFINES += XPCOM_GLUE
-
-SHARED_LIBRARY_LIBS = \
-		$(DIST)/lib/$(LIB_PREFIX)myIntricate_s.$(LIB_SUFFIX) \
-		$(DIST)/lib/$(LIB_PREFIX)myMultifarious_s.$(LIB_SUFFIX) \
-                $(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
-                $(DIST)/lib/$(LIB_PREFIX)xul.$(LIB_SUFFIX) \
-                $(DIST)/lib/$(LIB_PREFIX)nss3.$(LIB_SUFFIX) \
-		$(NULL)
-
-CPPSRCS		= \
-		Advanced.cpp \
-		$(NULL)
-
-include $(topsrcdir)/config/rules.mk
-
-LOCAL_INCLUDES += \
-        -I$(srcdir)/../intricate/src \
-        -I$(srcdir)/../multifarious/src \
-        $(NULL)
-
- -

The makefile in the advanced/ directory should list the intricate/, multifarious/ and build/ directories in its DIRS variable. Make sure that build/ comes last since it can’t create the component library until the other makefiles have completed.

- -

Outros Tópicos

- -

Adicionar Ficheiros de Dados às Suas Extensões

- -

In some cases, you may wish to include additional files in your extension that don’t belong in the chrome/ subdirectory. Examples might be database files or XML schemas. This can be achieved by adding a custom step to your makefile that copies the files from the source tree into the extension’s target directory.

- -
Copiar Ficheiros de Dados para a Diretoria de Destino
- -

Let’s say that you have some data files containing statistical information that you want to include in your extension and make available to your components. You’ve placed these files, which have the extension .TXT, into a stats/ subdirectory under your extension directory in the source tree. The following makefile rule can be used to copy these files into the final target directory of the extension:

- -
export::
-	if test ! -d $(FINAL_TARGET)/stats; then \
-		$(NSINSTALL) -D $(FINAL_TARGET)/stats; \
-	fi
-	$(INSTALL) $(srcdir)/*.txt $(FINAL_TARGET)/stats
-
- -
Aceder aos Ficheiros de Dados a partir dos Componentes
- -

The trick to accessing your data files is to figure out where the home directory of your extension is. Rumor has it that at some future date, this will possible through the nsIExtensionManager interface or something similar. In the meantime, there is a simple and reliable hack that can be used to achieve this. In the implementation of any JavaScript XPCOM component, there is a special __LOCATION__ (two leading and two trailing underscores) symbol that points to the component’s implementation file. So you can write a simple component which deduces the root directory of your extensions by extrapolating from its location.

- -

This article explains how to create an XPCOM component in JavaScript. You’ll need an IDL file for an interface that looks something like this:

- -
interface myILocation : nsISupports
-{
-    readonly attribute nsIFile locationFile;
-};
-
- -

Place the IDL file in the public/ directory of your project or subproject. In the src/ directory, place the JavaScript file that implements the component. The component implementation will include the methods for retrieving the path or file for the extension’s home directory:

- -
myLocation.prototype =
-{
-  QueryInterface: function(iid)
-  {
-    if (iid.equals(nsISupports))
-      return this;
-    if (iid.equals(myILocation))
-      return this;
-
-    Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE;
-    return null;
-  },
-
-  get locationFile()
-  {
-     return __LOCATION__.parent.parent;
-  }
-}
-
- -

This assumes that the component resides in a subdirectory of the extension directory (by convention, this directory is called components/). The parent property of __LOCATION__ returns the components/, and the parent of this is the extension directory.

- -

The last step is to modify the makefile of the source directory where you placed your JavaScript file so that it is copied into the appropriate location in the extension:

- -
export::
-	$(INSTALL) $(srcdir)/*.js $(FINAL_TARGET)/components
-
- -

Now you can instantiate an instance of this component and use the locationFile property to get an nsIFile interface that points to your extension’s home directory.

- -

Using Third-Party Libraries

- -

For more sophisticated extensions, you may want to integrate third-party libraries that provide specialized functionality for database connectivity, image processing, networking and the like. If you want your extension to run on all Firefox platforms, you will need to have the source code for the library in question, so I assume that this is available.

- -

The most convenient approach from the perspective of the development cycle is to create a Mozilla-style makefile for the library. This works well for libraries that have a straightforward make process without extensive configuration. A good example of this is the SQLite library included in the Mozilla build tree at db/sqlite. By adapting the makefile in this way, the library is created as part of the standard Mozilla build process, which eliminates additional build steps. The downside is that you will need to update the modified makefile any time a new version of the library is released.

- -

For libraries that have complex configuration processes, use a non-standard compiler or have other special characteristics, it may be unfeasible to create a Mozilla-compliant makefile. In this case, I would recommend placing the entire library distribution inside the project or subproject that uses it. So if library acmelib is used inside the multifarious/ subproject in the above example, it would be placed as a subdirectory underneath that subproject (at the same level as public/ and src/).

- -

Of course, this means that you will have to build acmelib manually on all platforms before launching the Mozilla build. But at least you can then refer to include files and import libraries from your component using relative paths.

- -

Building for Multiple Platforms

- -

TODO

- -
-

Original Document Information

- - -
- -

 

diff --git a/files/pt-pt/mozilla/add-ons/distribuicao/index.html b/files/pt-pt/mozilla/add-ons/distribuicao/index.html deleted file mode 100644 index eede6b7581..0000000000 --- a/files/pt-pt/mozilla/add-ons/distribuicao/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: Assinar e distribuir os seus extras -slug: Mozilla/Add-ons/Distribuicao -tags: - - Extensões - - Extensões da Web - - Extras - - assinatura - - distribuição - - publicação - - revisões -translation_of: Mozilla/Add-ons/Distribution ---- -
{{AddonSidebar}}
- -

Os extras precisam de ser assinados antes de serem instalados nas versões beta e de lançamento do Firefox. Este processo de assinatura ocorre via addons.mozilla.org (AMO), independentemente de optar por distribuir o seu extra via AMO ou por si mesmo.

- -

Nós aqui analisamos os requisitos de assinatura e as revisões relacionadas, antes de discutir como escolher entre o distribuir no AMO ou distribuir um extra por si mesmo. Nós também analisamos os canais disponíveis no AMO e respondemos a questões sobre propriedade e disputas de código.

- -

Assinar os seus extras

- -

Starting with Firefox 43, add-on extensions and multi-item add-ons that include extensions need to be signed by Mozilla before they can install in release and beta versions of Firefox. Themes, and other types of add-ons such as spelling dictionaries, don't need to be signed.

- -

Unsigned extensions can be installed in Developer Edition, Nightly, and ESR versions of Firefox, after toggling the xpinstall.signatures.required preference in about:config.

- -

Mozilla signs add-ons through the AMO website and provides three methods for submitting your add-on for signing:

- - - -

All the signing options are subject to the Firefox Add-on Distribution Agreement.

- -

Using the signing API or web-ext returns you signed add-ons, with no distribution listing created on AMO. If you take the option to upload your add-on through the AMO Developer Hub, you're given a choice between listing on AMO or self-distribution. If you choose self-distribution, at the end of the process you download signed copies of your add-on.

- -

Regardless of the method used all add-ons must pass an automated validation before they are signed. They may also be subject to a manual code review. The review criteria applied to add-ons are found in the Add-on Policies.

- -

Distributir o seu extra

- -

You aren't required to list or distribute your add-on through AMO. You'll, therefore, need to decide if you want to distribute and list your add-on through AMO or distribute it yourself. Here are some things you should consider:

- - - -

For more information on how to submit an add-on for distribution on AMO or self-distribution, see Submitting an add-on.

- -

Mais informação sobre AMO

- -

Propriedade

- -

Os extras no AMO podem ter vários utilizadores com permissão para atualizar e gerir a listagem. Os autores de um extra podem transferir a propriedade e adicionar programadores à listagem de um extra por meio do Hub do Programdor. Não é necessária nenhuma interação com os representantes da Mozilla para uma transferência de propriedade.

- -

 

- -

Para transferir propriedade

- - - -

 

- -

Disputas de códogo

- -

Many add-ons allow their source code to be viewed. This does not mean that the source code is open source or available for use in another add-on. The original author of an add-on retains copyright of their work unless otherwise noted in the add-on's license.

- -

If we're notified of a copyright or license infringement, we will take steps to address the situation per the DMCA, which may include taking down the add-on listing. Details about this process and how to report trademark or licensing issues can be found here.

- -

If you are unsure of the current copyright status of an add-on's source code, you must contact the author and get explicit permission before using the source code.

diff --git a/files/pt-pt/mozilla/add-ons/linhas_diretrizes_para_extras/index.html b/files/pt-pt/mozilla/add-ons/linhas_diretrizes_para_extras/index.html deleted file mode 100644 index 4293fe9c74..0000000000 --- a/files/pt-pt/mozilla/add-ons/linhas_diretrizes_para_extras/index.html +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Linhas Diretrizes para Extras -slug: Mozilla/Add-ons/Linhas_diretrizes_para_extras -translation_of: 'https://extensionworkshop.com/documentation/publish/add-on-policies/' ---- -
-

Este documento já não é válido. Por favor, consulte o documento de Políticas de Revisão para o conjunto atual das políticas de extras.

-
diff --git a/files/pt-pt/mozilla/add-ons/sdk/index.html b/files/pt-pt/mozilla/add-ons/sdk/index.html deleted file mode 100644 index 1c160220ae..0000000000 --- a/files/pt-pt/mozilla/add-ons/sdk/index.html +++ /dev/null @@ -1,97 +0,0 @@ ---- -title: Add-on SDK -slug: Mozilla/Add-ons/SDK -tags: - - Add-on SDK - - Jetpack -translation_of: Archive/Add-ons/Add-on_SDK ---- -
-

Support for extensions using XUL/XPCOM or the Add-on SDK was removed in Firefox 57, released November 2017. As there is no supported version of Firefox enabling these technologies, this page will be removed by December 2020.

- -

Add-ons using the techniques described in this document are considered a legacy technology in Firefox. Don't use these techniques to develop new add-ons. Use WebExtensions instead. If you maintain an add-on which uses the techniques described here, consider migrating it to use WebExtensions.

- -

Starting from Firefox 53, no new legacy add-ons will be accepted on addons.mozilla.org (AMO) for desktop Firefox and Firefox for Android.

- -

Starting from Firefox 57, only extensions developed using WebExtensions APIs will be supported on Desktop Firefox and Firefox for Android.

- -

Even before Firefox 57, changes coming up in the Firefox platform will break many legacy extensions. These changes include multiprocess Firefox (e10s), sandboxing, and multiple content processes. Legacy extensions that are affected by these changes should migrate to use WebExtensions APIs if they can. See the "Compatibility Milestones" document for more information.

- -

A wiki page containing resources, migration paths, office hours, and more, is available to help developers transition to the new technologies.

-
-

Pode criar extras do Firefox utilizando Add-on SDK. Pode utilizar várias tecnologias da Web padrão: CSS, HTML e JavaScript, para criar os extras. O SDK inclui as APIs de JavaScript APIs, que pode utilziar para criar extras e ferramentas para a criação, execução, testes, e empacotamento dos extras.

- -
-

Tutoriais

- -
-
-
-
Getting started
-
How to install the SDK and use the jpm tool to develop, test, and package add-ons.
-
Interact with the browser
-
Open web pages, listen for pages loading and list open pages.
-
Development techniques
-
Learn about common development techniques, such as unit testing, logging, creating reusable modules, localization, and mobile development.
-
-
- -
-
-
Create user interface components
-
Create user interface components such as toolbar buttons, context menus, menu items, and dialogs.
-
Modify web pages
-
Modify pages matching a URL pattern or dynamically modify a particular tab.
-
Putting it together
-
Walkthrough of the Annotator example add-on.
-
-
-
- -
-

Guias

- -
-
-
-
Contributor's guide
-
Learn how to start contributing to the SDK and about the most important idioms used in the SDK code such as modules, classes and inheritance, private properties, and content processes.
-
SDK infrastructure
-
Aspects of the SDK's underlying technology: modules, the Program ID and the rules defining Firefox compatibility.
-
Content scripts
-
A detailed guide to working with content scripts.
-
-
- -
-
-
SDK idioms
-
The SDK's event framework and the distinction between add-on scripts and content scripts.
-
XUL migration
-
A guide to porting XUL add-ons to the SDK. This guide includes a comparison of the two toolsets and a working example of porting a XUL add-on.
-
Multiprocess Firefox and the SDK
-
How to check whether your add-on is compatible with multiprocess Firefox or not and fix it accordingly.
-
-
-
- -
-

Referência

- -
-
-
-
High-Level APIs
-
Reference documentation for the high-level SDK APIs.
-
Tools reference
-
Reference documentation for the jpm tool used to develop, test and package add-ons, the console global used for logging, and the package.json file.
-
-
- -
-
-
Low-Level APIs
-
Reference documentation for the low-level SDK APIs.
-
-
-
diff --git a/files/pt-pt/mozilla/add-ons/themes/conceitos_tema/index.html b/files/pt-pt/mozilla/add-ons/themes/conceitos_tema/index.html deleted file mode 100644 index bb59c4386f..0000000000 --- a/files/pt-pt/mozilla/add-ons/themes/conceitos_tema/index.html +++ /dev/null @@ -1,230 +0,0 @@ ---- -title: Conceitos de Tema -slug: Mozilla/Add-ons/Themes/Conceitos_tema -tags: - - Tema - - extra -translation_of: Mozilla/Add-ons/Themes/Theme_concepts ---- -
{{AddonSidebar()}}
- -

Os temas desenvolvidos utilizando a WebExtensions API no Firefox permitem-lhe alterar a aparência do navegador ao adicionar imagens na área do cabeçalho do navegador Firefox; esta é a área por trás da barra de menus, barras de ferramentas, barra de endereço, barra de pesquisa e seuparador de faixa.

- -

Estas opções de temas podem ser implementadas como temas estáticos (embora as próprias imagens do tema possam ser animadas) ou como temas dinâmicos criados numa extensão do navegador.

- -
-

If you have a lightweight theme it will be converted to this new theme format automatically before lightweight themes are deprecated. You do not need to port your theme. However, please feel free to update your themes to use any of the new features described here.

-
- -

Temas estásticos

- -

Static themes are specified using the same resources as a browser extension: a manifest.json file to define the theme components with those components stored in the same folder as the manifest.json file or a sub folder. These resources are then packed in a zip for publication on addons.mozilla.org (AMO).

- -
-

A theme and browser extension functionality cannot be defined in one package, such as including a theme to complement an extension. You can, however, programmatically include a theme in an extension using the Theme API. See Dynamic themes.

-
- -

Definir um tema

- -

To create a theme (in this example a simple, single image theme):

- - - -

Static theme approaches

- -

There are two approaches you can take to theming the header area of Firefox: using a single image or using multiple images. You could combine the two, but it’s easier to treat them separately.

- -

Single image themes

- -

This is the basic or minimal theming option, where you define:

- - - -

The area your header image needs to fill is a maximum of 200 pixels high. The maximum image width is determined by the resolution of the monitor Firefox is displaying on and how much of the monitor Firefox is using. Practically, this means you would need to allow for a width of up to 5120 pixels wide (for the next generation of 5k monitors). However, rather than creating a very wide image, a better approach is to use a narrower image with a transparent left edge so that it fades to the background color. For example, we could use this image
- An image of a weta (the common name for a group of about 70 insect species in the families Anostostomatidae and Rhaphidophoridae, endemic to New Zealand) with the left edge fading to total transparency.
- combined with a complementary background color, to create this effect in the header
- A single image theme using the weta.png image

- -

See details about this theme in the themes example weta_fade.

- -

Obviously, you can still provide a single wide image if you prefer.

- -

Multiple image themes

- -

As an alternative to creating a single image theme, you have the option to use multiple images. These images can be individually anchored to locations within the header, with the option to apply tiling to each image.

- -

Depending on the effect you want to create you may need to suppress the mandatory "headerURL": image with an empty or transparent image. You would use an empty or transparent image if, for example, you wanted to tile a centrally justified image, such as
- An image of a weta (the common name for a group of about 70 insect species in the families Anostostomatidae and Rhaphidophoridae, endemic to New Zealand) with the left and right edges fading to total transparency.
- to create this effect
- A single image theme using the additional images option to align an image to the center of the heading and tile it.
- Here you specify the weta image like this:

- -
"images": {
-  "headerURL": "empty.png",
-  "additional_backgrounds": [ "weta_for_tiling.png"]
-},
- -

and the images tiling with:

- -
"properties": {
-  "additional_backgrounds_alignment": [ "top" ],
-  "additional_backgrounds_tiling": [ "repeat"  ]
-},
- -

Full details of how to setup this theme can be found in the themes example weta_tiled. Full detais of the alignment and tiling options can be found in the "theme" key description.

- -

Alternatively, you can use multiple images, say combining the original weta image with this one anchored to the left of the header
- An image of a weta (the common name for a group of about 70 insect species in the families Anostostomatidae and Rhaphidophoridae, endemic to New Zealand) with the right edge fading to total transparency.
- to create this effect
- A theme using the additional images option to place two mirrored image to the left and right of the browser header.

- -

Where the images are specified with:

- -
"images": {
-  "headerURL": "empty.png",
-  "additional_backgrounds": [ "weta.png", "weta-left.png"]
-},
- -

and their alignment by:

- -
"properties": {
-  "additional_backgrounds_alignment": [ "right top" , "left top" ]
-},
- -

Full details of how to setup this theme can be found in the themes example weta_mirror. Full detais of the alignment options can be found in the "theme" key description.

- -

Static animated themes

- -

It is possible to create an animated theme using an APNG format image, as in the themes example animated. However, remember that rapid animations, such as the one in the example might be too distracting for a practical theme.

- -

You can also animate themes programmatically, which we discuss in Dynamic themes.

- -

Temas dinâmicos

- -

As an alternative to defining a static theme, you can use the {{WebExtAPIRef("theme")}} API to control the theme used in Firefox from within a browser extension. There are a couple of use cases for this option:

- - - -

And, obviously, you can combine the two and bundle a programmatically controlled theme with your extension.

- -

Using the {{WebExtAPIRef("theme")}} API is straightforward. First, request "theme" permission in the extension's manifest.json file. Next, you build a JSON object containing the same information you would use in a static theme’s manifest.json, Finally, pass the JSON object in a {{WebExtAPIRef("theme.update()")}} call.

- -

For example, the following code, from the dynamic theme example defines the content for the day and night elements of the dynamic theme:

- -
const themes = {
-  'day': {
-    images: {
-     headerURL: 'sun.jpg',
-    },
-    colors: {
-     accentcolor: '#CF723F',
-     textcolor: '#111',
-    }
-  },
-  'night': {
-    images: {
-     headerURL: 'moon.jpg',
-    },
-    colors: {
-     accentcolor: '#000',
-     textcolor: '#fff',
-    }
-  }
-};
- -

The theme.Theme object is then passed to {{WebExtAPIRef("theme.update()")}} to change the header theme, as in this code snippet from the same example:

- -
function setTheme(theme) {
-  if (currentTheme === theme) {
-    // No point in changing the theme if it has already been set.
-    return;
-  }
-  currentTheme = theme;
-  browser.theme.update(themes[theme]);
-}
- -

Learn more about dynamic themes and see an additional example in the following video:

- -

{{EmbedYouTube("ycckyrUN0AY")}}

- -

 

- -

If you have not built a browser extension before, check out Your first extension for a step-by-step guide.

- -

Compatibilidade entre navegadores

- -

There is currently limited compatibility between themes in the major browsers. Opera takes an entirely different approach, and Microsoft Edge themes are not yet open to developers.

- -

There is some compatibility between Firefox static themes and Chrome themes, providing the ability to port a single header image theme from Firefox to Chrome. This would be done by amending the manifest.json keys as follows:

- - - -

Noting that "frame": and "tab_text": support RGB color definition only.

- -

So, in the single image theme example (weta_fade) could be supported in Chrome using the following manifest.json file:

- -
{
-  "manifest_version": 2,
-  "version": "1.0",
-  "name": "<your_theme_name>",
-  "theme": {
-    "images": {
-      "theme_frame": "weta.png"
-    },
-    "colors": {
-      "frame": [ 173 , 176 , 159 ],
-      "tab_text": [ 0 , 0 , 0 ]
-    }
-  }
-}
- -

However, there will be a couple of differences:

- - - -

The basic theme example using the Chrome compatible manifest.json keys, showing the differences in how those keys are implemented.

- -

For more information, see the notes on Chrome compatibility.

diff --git a/files/pt-pt/mozilla/add-ons/themes/index.html b/files/pt-pt/mozilla/add-ons/themes/index.html deleted file mode 100644 index 26dfb24673..0000000000 --- a/files/pt-pt/mozilla/add-ons/themes/index.html +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: Temas -slug: Mozilla/Add-ons/Themes -tags: - - Apresentação e Disposição - - Extras - - Temas -translation_of: Mozilla/Add-ons/Themes ---- -

{{AddonSidebar}}

- -

Temas permite-lhe alterar a apresentação e disposição da interface do utilizador e personalizar a seu gosto. Saiba como criar e partilhar os temas!

- -
-
-

Temas de Navegador

- -
-
Browser theme concepts
-
Get an introduction to creating themes for the latest versions of Firefox
-
- -

Temas Simples

- -
-
Lightweight themes
-
Building lightweight themes for Firefox
-
Lightweight themes FAQ
-
Get answers to commonly asked questions
-
-
- - -
- -

 

- -

 

diff --git a/files/pt-pt/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/index.html b/files/pt-pt/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/index.html deleted file mode 100644 index 9d187b7315..0000000000 --- a/files/pt-pt/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/index.html +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: Creating a Skin for Firefox -slug: Mozilla/Add-ons/Themes/Obsolete/Creating_a_Skin_for_Firefox -tags: - - Add-ons - - NeedsTranslation - - Themes - - TopicStub -translation_of: Archive/Themes/Creating_a_Skin_for_Firefox ---- -

Introduction

- -

In order to create a skin for Firefox, there are three things you need to know: how to edit images, how to extract zip files, and how to modify CSS. Firefox uses standard GIF, PNG, and JPEG images for the buttons and CSS to style everything else in the interface.

- -

What is a skin?

- -

A skin does not totally change the interface; instead, it just defines how the interface looks. You can't change what happens when the user right clicks on an image, but you can change the look of the right click menu (Make it blue with pink polka dots, for example). If you want to change the functionality of Firefox, you'll have to look into modifying the chrome, which is beyond the scope of this document.

- -

Contents

- - - -
-

Informações Sobre o Documento Original

- -
diff --git a/files/pt-pt/mozilla/add-ons/themes/obsolete/index.html b/files/pt-pt/mozilla/add-ons/themes/obsolete/index.html deleted file mode 100644 index d420b6ebf0..0000000000 --- a/files/pt-pt/mozilla/add-ons/themes/obsolete/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Obsolete -slug: Mozilla/Add-ons/Themes/Obsolete -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Add-ons/Themes/Obsolete ---- -

This page collects theme docs that we don't expect will ever be updated, but which we're keeping for the time being as potential source material for updated docs.

-

{{ ListSubPages ("/en-US/Add-ons/Themes/Obsolete", 5) }}

diff --git a/files/pt-pt/mozilla/add-ons/thunderbird/index.html b/files/pt-pt/mozilla/add-ons/thunderbird/index.html deleted file mode 100644 index b15b535a59..0000000000 --- a/files/pt-pt/mozilla/add-ons/thunderbird/index.html +++ /dev/null @@ -1,135 +0,0 @@ ---- -title: Thunderbird extensions -slug: Mozilla/Add-ons/Thunderbird -tags: - - Add-ons - - Extensions - - NeedsTranslation - - TopicStub - - thunderbird -translation_of: Mozilla/Thunderbird/Thunderbird_extensions ---- -
Building a Thunderbird extension
-Step-by-step explanation on how to build an extension for Thunderbird.
- -
-

{{AddonSidebar}}

-The following documentation provides help for creating extensions for Mozilla's Thunderbird email client. Although there are many similarities with Firefox extensions there are also some differences that may confound the starting developer.
- -

-Please help! You can add a how-to (a question or an answer or a code snippet), summarize and link to a relevant newsgroup discussion, or create a tutorial. Need help? Contact jenzed.
- - - - - - - - -
-

Documentation

- -

Getting started with Thunderbird

- -

A brave, young developer wants to develop an add-on for Thunderbird. Here's a few links to help them through this journey.

- -
    -
  • Start by reading the tutorial and learn how to build a Thunderbird extension (Outdated, still talks about overlays and the add-on builder is no longer available but the tutorial has not been updated.)
  • -
  • Read about the main windows so that you know what one means when they say « thread pane », « preview pane », and « folder pane ».
  • - -
  • Want to do some real stuff? See how to inspect a message (demo add-on included!)
  • -
  • Play with our other demo add-on that exercises some more advanced Thunderbird-specific features
  • -
  • Want to do even more stuff? Don't reinvent the wheel: steal functions from the thunderbird-stdlib project (doc here). Functions for dealing with messages (delete them, archive them, change their tags, etc.) are included.
  • -
  • Haven't found what you're looking for? Read the Thunderbird how-tos; they contain a lot of recipes for things extensions want to do.
  • -
  • Still haven't managed to do what you wanted? See the list of all Thunderbird communication channels so that you know where to ask when you get stuck :-).
  • -
  • Feeling really brave? Read the source using a fancy interface; you can often find tests that demonstrate how to do what you're trying to achieve.
  • -
- -

The Gloda database

- -

Thunderbird has a subsystem called Gloda. Gloda stands for « Global Database », and creates Thunderbird-wide relations between objects. Gloda provides concepts such as Conversations, Messages, Identities, Contacts. All these concepts are related together: a Conversation contains Messages which are linked to Identities (from field, to field) which are themselves part of a Contact: indeed, a contact has multiple identities.

- -

Typical use cases for Gloda: find all messages whose subject matches [search term], find all messages from [person], find all messages in the same thread as [a given message], find all messages involving [person], etc. etc.

- -

Gloda is extremely powerful and is used heavily by add-ons such as Thunderbird Conversations. Learn more about Gloda:

- - - - - -

Some of these links may be wildly out of date, but they still provide valuable information on the codebase.

- - - - - - -
-

Community

- - - -

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

- - - -

Tools

- - - -

... more tools ...

- -

View All...

- - - -
-
XUL, JavaScript, XPCOM, Themes, Developing Mozilla
-
-
- -

Categories

- -

{{ languages( { "ja": "ja/Extensions/Thunderbird" } ) }}

diff --git a/files/pt-pt/mozilla/calendar/calendar_versions/index.html b/files/pt-pt/mozilla/calendar/calendar_versions/index.html deleted file mode 100644 index 7e8c1a7958..0000000000 --- a/files/pt-pt/mozilla/calendar/calendar_versions/index.html +++ /dev/null @@ -1,1037 +0,0 @@ ---- -title: Versões de Calendário -slug: Mozilla/Calendar/Calendar_Versions -tags: - - Calendário - - Lightning - - Sunbird -translation_of: Mozilla/Calendar/Calendar_Versions ---- -

Esta página tem como objetivo fornecer um resumo de qual a versão do Lightning que é compatível com a versão do Thunderbird. Esta também mostra qual a versão da plataforma Mozilla que é utilizada na respetiva versão do Sunbird e do Lightning.

- -

O objetivo principal da 'Equipa do Calendário' é sincronizar o ciclo de lançamento do Lightning com o Thunderbird. Isto geralmente significa que nós iremos utilizar o código base mais recente do Thunderbird e da Mozilla (comm-central e mozilla-central) para o desenvolvimento ativo. Se o agendamento do Thunderbird ainda não estiver clara, nós retrocederemos as alterações para uma ramificação mais antiga.

- -

Nota: se estiver a ter problemas e o calendário está em falta, primeiro consulte  calendar update issues, porque depois do Thunderbird 52 Lightning está integrado (empacotado com o Thunderbird) e não deveria de ter que transferir a extensão. Mas se estiver a executar o Thunderbird - versão 45 ou anterior, utilize a hiperligação de transferência abaixo..

- -

Lightning

- -

Resumo de Desenvolvimento

- -
-

As compilações do Lightning listadas abaixo devem ser consideradas instáveis ​​e estão disponíveis apenas para fins de desenvolvimento e testes.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Lightning
- Versão
Thunderbird
- Versão
SeaMonkey
- Versão
-

Plataforma Mozilla
- Versão

-
Build NameChangelog
6.8a166.0a1
- "Daily"
2.63a1mozilla66"nightly"
- (comm-central)
changes in 6.8
6.7b165.0b1
- "Beta"
2.62b1mozilla65"beta"
- (comm-beta)
changes in 6.7
- -

Lançamentos Estáveis

- -

The Lightning releases listed below are considered stable and are recommend for daily usage. 

- -

If you are having trouble and calendar is missing, first see calendar update issues, because after Thunderbird 52 Lightning is built-in (bundled with Thunderbird) and you should not need to download the extension. 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Lightning
- Versão
Thunderbird
- Versão
SeaMonkey
- Versão
Plataforma Mozilla
- Versão
Data de LançamentoRegisto de Alterações
6.7b1 (Beta)65.0 (Beta)2.62mozilla65 changes in 6.7
6.6b4 (Beta)64.0 (Beta)2.61mozilla64December 2, 2018changes in 6.6
6.5b1 (Beta)63.0 (Beta)2.60mozilla63October 11, 2018changes in 6.5
6.4b1 (Beta)62.0 (Beta)2.59mozilla62---changes in 6.4
6.3b1 (Beta)61.0 (Beta)2.58mozilla61---changes in 6.3
6.2.3.360.3.32.57mozilla60December 5, 2018 
6.2.3.260.3.22.57mozilla60November 30, 2018 
6.2.3.160.3.12.57mozilla60November 15, 2018changes in 6.2.3changes in 6.2.3.1
6.2.2.160.2.12.57mozilla60October 2, 2018changes in 6.2.2.1
6.260.02.57mozilla60August 6, 2018changes in 6.2
6.1b2 (Beta)59.0 (Beta)2.56mozilla59---changes in 6.1
6.0b3 (Beta)58.0 (Beta)2.55mozilla58---changes in 6.0
5.9b2 (Beta)57.0 (Beta)2.54mozilla57---changes in 5.9
5.8b4 (Beta)56.0 (Beta)2.53mozilla56---changes in 5.8
5.7b2 (Beta)55.0 (Beta)2.52mozilla55---changes in 5.7
5.6b3 (Beta)54.0 (Beta)2.51mozilla54---changes in 5.6
5.5b2 (Beta)53.0 (Beta)2.50mozilla53October 10, 2017changes in 5.5
5.4.9.152.9.1---mozilla52July 10, 2018---
5.4.852.8.0---mozilla52May 18, 2018changes in 5.4.8
5.4.752.7.0---mozilla52March 23, 2018changes in 5.4.7
5.4.652.6.0---mozilla52January 25, 2018changes in 5.4.6
5.4.5.252.5.2---mozilla52December 22, 2017changes in 5.4.5
5.4.452.4.0---mozilla52October 6, 2017changes in 5.4.4
5.4.352.3.0---mozilla52August 16, 2017changes in 5.4.3
5.4.2.152.2.1----mozilla52June 23, 2017changes in 5.4.2 / changes in 5.4.2.1
5.4.1.152.1.1---mozilla52May 15, 2017changes in 5.4.1 / changes in 5.4.1.1
5.4.0.152.0.1---mozilla52April 14, 2017changes in 5.4.0.1
5.452.02.49mozilla52April 4, 2017changes in 5.4
5.3b2 (Beta)51.0 (Beta)2.48mozilla51March 19, 2017changes in 5.3
5.2b1 (Beta)50.0 (Beta)2.47mozilla50October 16, 2016changes in 5.2
5.1b1 (Beta)49.0 (Beta)2.46mozilla49October 16, 2016changes in 5.1
5.0b1 (Beta)48.0 (Beta)2.45mozilla48October 16, 2016changes in 5.0
4.9b2 (Beta)47.0 (Beta)2.44mozilla47July 1, 2016changes in 4.9
4.8b1 (Beta)46.0 (Beta)2.43mozilla46---changes in 4.8
4.7.845.8.02.42mozilla45March, 7 2017changes in 4.7.8
4.7.7.145.7.12.42mozilla45February 7, 2017changes in 4.7.7
4.7.645.6.02.42mozilla45December 28, 2016changes in 4.7.6
4.7.5.145.5.12.42mozilla45November 30, 2016changes in 4.7.5
4.7.445.4.02.42mozilla45October 3, 2016changes in 4.7.4
4.7.345.3.02.42mozilla45August 30, 2016changes in 4.7.3
4.7.245.2.02.42mozilla45June 30, 2016changes in 4.7.2
4.7.1.145.1.12.42mozilla45May 31, 2016changes in 4.7.1.1
4.745.02.42mozilla45April 25, 2016changes in 4.7
4.6b1 (Beta)44.0 (Beta)2.41mozilla44January 21, 2016changes in 4.6
4.5b1 (Beta)43.0 (Beta)2.40mozilla43January 8, 2016changes in 4.5
4.4b2 (Beta)42.0 (Beta)2.39mozilla42October 14, 2015changes in 4.4
4.3b2 (Beta)41.0 (Beta)2.38mozilla41September 16, 2015changes in 4.3
4.2b1 (Beta)40.0 (Beta)2.37mozilla40July 30, 2015changes in 4.2
4.1b1 (Beta)39.0 (Beta)2.36mozilla39---changes in 4.1
4.0.7.238.7.2---mozilla38April 4, 2016changes in 4.0.7 / changes in 4.0.7.1
4.0.638.6.0---mozilla38February 16, 2016changes in 4.0.6
4.0.5.238.5.12.35mozilla38January 21, 2016changes in 4.0.5
4.0.4.138.4.02.35mozilla38November 30, 2015changes in 4.0.4
4.0.3.138.3.02.35mozilla38October 8, 2015changes in 4.0.3
4.0.2.138.2.02.35mozilla38September 16, 2015changes in 4.0.2.1
4.0.238.2.02.35mozilla38August 14, 2015changes in 4.0.2
4.0.1.238.1.02.35mozilla38July 23, 2015changes in 4.0.1.2
4.0.138.1.02.35mozilla38July 8, 2015changes in 4.0.1
4.0.0.138.0.12.35mozilla38June 12, 2015changes in 4.0.0.1
3.9b1 (Beta)37.0 (Beta)2.34mozilla37March 14, 2015changes in 3.9
3.8b2 (Beta)36.0 (Beta)2.33mozilla36March 12, 2015changes in 3.8
3.7b1 (en-US only)---2.32mozilla35January 28, 2015changes in 3.7
3.6b3 (Beta)34.0 (Beta)2.31mozilla34December 17, 2014changes in 3.6
3.5b1 (Beta)33.0 (Beta)2.30mozilla33September 23, 2014changes in 3.5
3.4b1 (Beta)32.0 (Beta)2.29mozilla32August 18, 2014changes in 3.4
3.3.331.02.28mozilla31January 28, 2015changes in 3.3.3
3.3.231.02.28mozilla31December 27, 2014changes in 3.3.2
3.3.131.02.28mozilla31September 23, 2014changes in 3.3.1
3.331.02.28mozilla31July 21, 2014changes in 3.3
3.2b130.0 (Beta)2.27mozilla30May 9, 2014changes in 3.2
3.1b129.0 (Beta)2.26mozilla29April 24, 2014changes in 3.1
3.0b128.0 (Beta)2.25mozilla28March 6, 2014changes in 3.0
2.9b127.0 (Beta)2.24mozilla27December 19, 2013changes in 2.9
2.8b126.0 (Beta)2.23mozilla26November 15, 2013changes in 2.8
2.7b125.0 (Beta)2.22mozilla25October 17, 2013changes in 2.7
2.6.624.5.0---mozilla24.5June 19, 2014changes in 2.6.6
2.6.524.5.0---mozilla24.5May 13, 2014changes in 2.6.5
2.6.424.2.0---mozilla24.2December 11, 2013changes in 2.6.4
2.6.324.1.1---mozilla24.1.1November 19, 2013changes in 2.6.3
2.6.224.1.0---mozilla24.1October 29, 2013---
2.6.124.0.1---mozilla24.0.1October 13, 2013changes in 2.6.1
2.624.02.21mozilla24September 11, 2013changes in 2.6
2.5b2---2.20mozilla23July 8, 2013changes in 2.5
2.4b1---2.19mozilla22May 24, 2013changes in 2.4
2.3b2---2.18mozilla21May 8, 2013changes in 2.3
2.2b1---2.17mozilla20March 6, 2013changes in 2.2
2.1b1---2.16mozilla19February 12, 2013changes in 2.1
2.0b1---2.15mozilla18November 29, 2012changes in 2.0
1.9.117.02.14mozilla17March 6, 2013changes in 1.9.1
1.917.02.14mozilla17November 20, 2012changes in 1.9
1.816.02.13mozilla16October 09, 2012changes in 1.8
1.715.02.12mozilla15August 28, 2012changes in 1.7
1.614.02.11mozilla14July 17, 2012changes in 1.6
1.5.213.02.10mozilla13June 21, 2012---
1.5.113.02.10mozilla13June 14, 2012---
1.513.02.10mozilla13June 4, 2012changes in 1.5
1.412.02.9mozilla12April 23, 2012changes in 1.4
1.311.02.8mozilla11March 13, 2012changes in 1.3
1.2.310.02.7mozilla10March 9, 2012---
1.2.110.02.7mozilla10February 3, 2012---
1.210.02.7mozilla10January 23, 2012changes in 1.2
1.1.19.02.6mozilla9January 5, 2012changes in 1.1
1.08.02.5mozilla8November 7, 2011 
1.0b77.02.4mozilla7September 27, 2011 
1.0b56.02.3mozilla6July 29, 2011 
1.0b45.02.2mozilla5June 28, 2011 
1.0b23.1.*---mozilla-1.9.2June 24, 2010 
1.0b13.0.*2.0mozilla-1.9.1January 12, 2010 
0.92.0.0.*---mozilla-1.8.1September 23, 2008 
0.82.0.0.*---mozilla-1.8.1April 4, 2008 
- -

Lançamentos de ESR Estáveis

- -

Thunderbird 10 and 17 were considered Extended Support Releases (ESR), which Lightning is compatible with. We followed the ESR policy of Thunderbird and only did releases for security fixes. Additionally, some fixes may have been backported for important regressions related to enterprise features like invitations.

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Lightning
- Versão
Thunderbird
- Versão
SeaMonkey
- Versão
Plataforma Mozilla
- Versão
Data de Lançamento
1.9.117.0esr2.14mozilla17March 6, 2013
1.2.310.0esr2.7mozilla10March 9, 2012
- -

Sunbird

- -

Por favor, note que o Sunbird foi descontinuado, consulte este blogue para detalhes. Não haverá mais lançamento do Sunbird até novo aviso.

- - - - - - - - - - - - - - - - - - - - - - - - - - -
Sunbird
- Versão
Mozilla Platform
- Versão
Data de Lançamento
1.0b11.9.1March 30, 2010
0.91.8.1September 23, 2008
0.81.8.1April 4, 2008
diff --git a/files/pt-pt/mozilla/calendar/index.html b/files/pt-pt/mozilla/calendar/index.html deleted file mode 100644 index 17e6540daa..0000000000 --- a/files/pt-pt/mozilla/calendar/index.html +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: Calendar -slug: Mozilla/Calendar -tags: - - Calendar - - NeedsTranslation - - NeedsUpdate - - TopicStub -translation_of: Mozilla/Calendar ---- - - - - - - - -
Sunbird-Logo-148x155.png -

The Mozilla Calendar Project is a community driven project based on the Mozilla application architecture. The Project's heart is a calendaring backend based on libical. The Lightning extension is built on top of this platform and provides integrated calendaring capabilities for Mozilla Messaging's Email client Thunderbird.

-

Mozilla Calendar emphasizes free and open source technology and supports standardized technology like the ical/ics (rfc2445) format and the CalDAV (rfc4791) protocol, which is implemented by many freely available servers and also some commercial providers.

-
- - - - - - - -
-

Development Topics

-
-
- Building Calendar
-
- Information about building Calendar with the new comm-central repository. There is also a simple build page for Thunderbird including Lightning and information about how comm-central works.
-
-
-
- Creating a Calendar extension
-
- Tutorial on creating a Calendar extension for Sunbird and Lightning.
-
-
-
- Localization
-
- How to get started with translating Calendar into your language and how to build Lightning in your language. 
-
- Testing Calendar
-
- CalendarUtils reference for writing Mozmill tests, which can automatically test the UI so that regressions can be easily found.
-
- Calendar Versions
-
- This page will tell you which Calendar version fits with which Mozilla Platform and where current development is being done.
-
-
-

Tools

-
-
- Bugzilla
-
- The Bugzilla database used to track issues for Mozilla projects.
-
-  
-
- MXR
-
- Browse and search the Calendar source code repository on the Web.
-
-  
-
- Calendar Servers
-
- Setup your own calendar server, or check to see how well commercial products are supported.
-
-  
-
-
-

 

diff --git a/files/pt-pt/mozilla/criacao_barra_lateral_firefox/index.html b/files/pt-pt/mozilla/criacao_barra_lateral_firefox/index.html deleted file mode 100644 index 737ebb5925..0000000000 --- a/files/pt-pt/mozilla/criacao_barra_lateral_firefox/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: Criação de uma barra lateral do Firefox -slug: Mozilla/Criacao_barra_lateral_Firefox -tags: - - Extensões - - Extras - - Firefox -translation_of: Mozilla/Creating_a_Firefox_sidebar ---- -

Os publicadores da Web podem oferecer aos visitantes uma barra lateral do Firefox para encorajar à sua participação. Existem duas maneiras de criar uma barra lateral para os utilizadores do Firefox: a API Social e uma extensão. Pode escolher dependendo das suas necessidades e recursos.

- -

A API Social

- -
-

Este conteúdo abrange as funcionalidades introduzidas no Firefox 17.

-
- -

A API Social é uma nova API da Mozilla que permite aos serviços de redes sociais integrar o seu conteúdo na jabela do navegador. De momento, o Cliqz, Facebook, mixi e a MSN têm uma parceria com a Mozilla, como provedores sociais. Agora que a API está disponível para todos os programadores da Web, então vale a pena conferir se está a oferecer um serviço social.

- -

Uma extensão

- -

An extension is a kind of add-ons that adds new functionalities to Firefox. There is a wide range of extensions available, and some of them provide a sidebar. Such kind of sidebar can be a simple Web panel or a full-featured extension that is completely integrated with the browser. There are some ways to create an extension:

- - - -

A API window.sidebar

- -

{{ obsolete_header(23) }}

- -

As of Firefox 23, the addPanel and addPersistentPanel functions have been removed from the deprecated, Netscape-derived {{ domxref("window.sidebar") }} object. That means the ability to add a traditional sidebar panel is no longer available from Web content. The new Social API or an extension can be used instead as described above.

- -

Consulte Também

- - diff --git "a/files/pt-pt/mozilla/cria\303\247\303\243o_de_um_complemento_de_dicion\303\241rio_de_verifica\303\247\303\243o_ortogr\303\241fica/index.html" "b/files/pt-pt/mozilla/cria\303\247\303\243o_de_um_complemento_de_dicion\303\241rio_de_verifica\303\247\303\243o_ortogr\303\241fica/index.html" deleted file mode 100644 index 50a536375d..0000000000 --- "a/files/pt-pt/mozilla/cria\303\247\303\243o_de_um_complemento_de_dicion\303\241rio_de_verifica\303\247\303\243o_ortogr\303\241fica/index.html" +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: Criação de um complemento de dicionário de verificação ortográfica -slug: Mozilla/Criação_de_um_complemento_de_dicionário_de_verificação_ortográfica -tags: - - Complemento - - add-on -translation_of: Mozilla/Creating_a_spell_check_dictionary_add-on ---- -

Esta página descreve como montar um dicionário de verificação ortográfica Hunspell como um complemento do Firefox, ou como atulizar um complemento existente, e assim, este pode ser instalado, desinstalado e atualizado sem reiniciar.

- -

Partes necessárias

- -

To create a dictionary add-on, you first need two things:

- - - -

If you are creating a new dictionary, as opposed to updating an existing one, please make sure that there is not already a dictionary available for your locale. If there already is one, try contacting the author to get it updated, or contact AMO editors if the author does not respond.

- -

Packaging

- -

A Firefox add-on is a ZIP file renamed to use an .xpi file extension instead of the normal .zip file extension. To create a dictionary add-on, simply create a ZIP file which contains the following files and folders:

- -

my-dictionary.xpi

- - - -

The .dic and .aff files must be placed in a subfolder named dictionaries within the ZIP file. Both files must have the locale code as their file name. You also have to add a file named install.rdf to the root of the ZIP file. This file contains information about your add-on such as name and version number (see below). In addition to these required files, you may add optional files, for example to give your add-on an icon or to describe the license of the dictionary.

- -

Here is an example of the install.rdf file. You can create and edit it with a plain text editor such as Notepad.

- -

<?xml version="1.0"?>
- <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-      xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-   <Description about="urn:mozilla:install-manifest">
-     <em:id>locale-code@dictionaries.addons.mozilla.org</em:id>
-     <em:version>version number</em:version>
-     <em:type>64</em:type>
-     <em:unpack>true</em:unpack>
-     <em:name>Name</em:name>
-     <!--
-       Other install.rdf metadata such as em:localized, em:description, em:creator,
-       em:developer, em:translator, em:contributor or em:homepageURL
-     -->

-
-     <!-- Firefox -->
-     <em:targetApplication>
-       <Description>
-         <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-         <em:minVersion>18.0a1</em:minVersion>
-         <em:maxVersion>46.0</em:maxVersion>
-       </Description>
-     </em:targetApplication>
-
-     <!-- Thunderbird -->
-     <em:targetApplication>
-       <Description>
-         <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
-         <em:minVersion>18.0a1</em:minVersion>
-         <em:maxVersion>22.0</em:maxVersion>
-       </Description>
-     </em:targetApplication>
-
-     <!-- SeaMonkey -->
-     <em:targetApplication>
-       <Description>
-         <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
-         <em:minVersion>2.15a1</em:minVersion>
-         <em:maxVersion>2.49</em:maxVersion>
-       </Description>
-     </em:targetApplication>
-   </Description>
- </RDF>

- -

There are some rules about how you should adapt the install.rdf file:

- - - -

Once you have added these files to your ZIP file and renamed the file to have the .xpi extension, you can install your add-on in Firefox and test it. After a successful test, you can upload your add-on to addons.mozilla.org and ask for it to be included in the Dictionaries & Language Packs page.

diff --git "a/files/pt-pt/mozilla/firefox/edi\303\247\303\243o_programador/index.html" "b/files/pt-pt/mozilla/firefox/edi\303\247\303\243o_programador/index.html" deleted file mode 100644 index 3f3e7d3c90..0000000000 --- "a/files/pt-pt/mozilla/firefox/edi\303\247\303\243o_programador/index.html" +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: Edição do Programador -slug: Mozilla/Firefox/Edição_Programador -tags: - - Beta - - Bugs - - Developer Edition - - Edição de Desenvolvimento - - Edição do Programador - - Erros - - Latest - - Mais Recentes -translation_of: Mozilla/Firefox/Developer_Edition ---- -
{{FirefoxSidebar}}
- -

A 'Edição do Programador' do Firefox é uma versão do Firefox que está preparada para os programadores da Web. Esta inclui:

- - - -

Novidades na Edição do Programador?

- -

Transferir a Edição do Programador

diff --git a/files/pt-pt/mozilla/firefox/multiple_profiles/index.html b/files/pt-pt/mozilla/firefox/multiple_profiles/index.html deleted file mode 100644 index b7935947d7..0000000000 --- a/files/pt-pt/mozilla/firefox/multiple_profiles/index.html +++ /dev/null @@ -1,244 +0,0 @@ ---- -title: Múltiplos perfis do Firefox -slug: Mozilla/Firefox/Multiple_profiles -tags: - - Firefox - - Guía - - Perfis - - Perguntas e Respostas - - Principiante -translation_of: Mozilla/Firefox/Multiple_profiles ---- -
{{FirefoxSidebar}}
- -

Um perfil no Firefox é a coleção de definições. personalizações, extras, e outras personalizações que um utilizador criou ou instalou na sua cópia do Firefox. Pode encontrar mais detalhes sobre os perfis no site de apoio do utilizador final da Mozilla.

- -

Razões para ter múltiplos profiles

- -

The casual user may want to have different profiles for different family members. Having different profiles would allow each person to have his or her own set of bookmarks, settings, and add-ons.

- -

Web developers might want a secondary profile for testing websites, apps, or other projects on different Firefox channels. For example, you might want to have some extensions installed for Web development, but not for general-purpose Web browsing. While using the Nightly channel, you may encounter some add-ons that have become temporarily incompatible with new API changes, until the add-on developer has a chance to update them. You can remove such add-ons from your profile for Nightly use while keeping them for use with other profiles.

- -

For QA, testing, and bug triaging contributors, you may want to have multiple development versions of Firefox installed, each with its own profile. Creating new profiles for testing can keep you from losing your preferences, bookmarks, and history. It takes little time to set up a new profile, and once it is complete, all of your Firefox versions will update separately and can be run simultaneously.

- -

Canais de desenvolvimento do navegador disponíveis

- -

There are four available browser channels, each at a different level of stability and development. The four channels are Release, Beta, Developer Edition, and Nightly. The Release channel is recommended for most users, as it is the "official release" channel. However, for those more adventurous, you can try one of the other three channels to see what is coming in Firefox and play around with emerging features. The Beta channel contains the features that are expected to be in the next release of Firefox and are in final stages of testing. Aurora contains experimental features, which are not yet at beta quality. Nightly contains the latest code from Firefox developers and is the least stable channel.

- -

Ferramentas de terceiros

- -

In addition to the built-in Profile Manager and the external Profile Manager, there are a few third-party tools that make working with multiple profiles easy.

- -
-

This list is by no means exhaustive. Please add any helpful tools you discover to the list!

-
- -

Mac OS X

- - - -

Gestão de perfis

- -

Determining the profile while Firefox is running

- -

To determine the profile of a currently-running Firefox instance in Windows, macOS or Linux,

- -
    -
  1. Type about:profiles into the browser URL search bar.
  2. -
  3. The page presents a list of all of your profiles, each beginning with "Profile: " followed by its name.
  4. -
  5. The one being run by this Firefox instance will include the bold text "This is the profile in use" For example, if you find that text beneath the entry for "Profile: Suzie", then you are running in a profile named Suzie.
  6. -
- -

Launching Firefox into a Desired Profile

- -

You cannot change the profile while Firefox is running.  Although it is possible in some cases to have multiple instances of Firefox running in different profiles, to avoid confusion, you should first exit/quit/terminate all running instances of Firefox, FirefoxDeveloperEdition or Nightly.  Then follow the instructions below, applicable to your operating system.

- -

Windows

- -
Windows XP
- -
    -
  1. Click the Start button.
  2. -
  3. Click "Run".
  4. -
  5. -

    Type firefox --ProfileManager.

    -
  6. -
- -
Windows Vista/7
- -
    -
  1. Click the Start button.
  2. -
  3. Click the search bar at the bottom.
  4. -
  5. -

    Type firefox --ProfileManager.

    -
  6. -
- -
Windows 8/8.1
- -
    -
  1. Press "Windows + R" on your keyboard.
  2. -
  3. Type firefox --ProfileManager.
  4. -
- -

If the Profile Manager window does not open, Firefox may have been running in the background, even though it was not visible. Close all instances of Firefox, or restart the computer, and then try again.

- -

Linux

- -

If Firefox is already included in your Linux distribution, or if you have installed Firefox with the package manager of your Linux distribution:

- -
    -
  1. At the top of the Firefox window, click on the File menu and select Quit.
  2. -
  3. In Terminal run firefox --ProfileManager
  4. -
- -

If the Profile Manager window does not open, Firefox may have been running in the background, even though it was not visible. Close all instances of Firefox, or restart the computer and then try again.

- -

macOS

- -
    -
  1. Run the Terminal application, which is found in Applications/Utilities.
  2. -
  3. Type or paste in the path to Firefox, followed by .app/Contents/MacOS/firefox.  For example, if Firefox is installed in the recommended location, you would enter /Applications/Firefox.app/Contents/MacOS/firefox.
  4. -
  5. If you have the path to your desired profile handy, enter a space character, followed by -profile followed by another space character, followed by the full path to the profile folder you wish to launch into.  This will launch Firefox immediately.  Otherwise, enter a space character followed by --profilemanager.  This will present the Profile Manager window in which you can make your selection.
  6. -
  7. Hit return.
  8. -
- -

Here is a complete example Terminal command from steps 2-3:

- -
/Applications/Firefox.app/Contents/macOS/firefox -profile /Users/Suzie/Library/Application\ Support/Firefox/Profiles/r99d1z7c.default
- -

If you want to do this frequently and more easily, you may wish to create an Automator application, as explained in this tutorial.

- -

Criar um perfil

- -

Creating a profile through the Profile Manager

- -

These instructions should be the same for all operating systems.

- -
    -
  1. To start the Create Profile Wizard, click "Create Profile..." in the Profile Manager.
  2. -
  3. Click Next and enter the name of the profile. Use a profile name that is descriptive, such as your personal name. This name is not exposed to the Internet.
  4. -
  5. You can also choose where to store the profile on your computer. To select storage location, click Choose Folder....
  6. -
  7. If you choose your folder location for the profile, select a new or empty folder. If you choose a folder that isn't empty, and you later remove the profile and choose the \"Delete Files\" option, everything inside that folder will be deleted.
  8. -
  9. To create the new profile, click Finish.
  10. -
- -

Creating a profile through the Firefox browser

- -

You can create a new Firefox profile directly from the browser.

- -
    -
  1. Type about:profiles into the browser URL search bar
  2. -
  3. On the page, click Create a New Profile button
  4. -
  5. Read the introduction, and click Next
  6. -
  7. Enter a profile name for your new Profile. Use a profile name that is descriptive, such as your personal name. This name is not exposed to the Internet.
  8. -
  9. Optionally, to change where the profile will be stored on your computer, click Choose Folder...
  10. -
  11. To create the new profile, click Finish.
  12. -
- -

Eliminar um perfil

- -
    -
  1. In the Profile Manager, select the profile to remove, and click Delete Profile....
  2. -
  3. Confirm that you wish to delete the profile: -
      -
    • Don't Delete Files removes the profile from the Profile Manager yet retains the profile data files on your computer in the storage folder so that your information is not lost. "Don't Delete Files" is the preferred option, because it saves the old profile's folder, allowing you to recover the files to a new profile.
    • -
    • Delete Files removes the profile and its files, including the profile bookmarks, settings, passwords, etc.
      -
      - {{ warning("If you use the \"Delete Files\" option, the profile folder, and files will be deleted. This action cannot be undone.") }}
    • -
    • Cancel interrupts the profile deletion.
    • -
    -
  4. -
- -

Renomear um perfil

- -
    -
  1. In the Profile Manager, select the profile you want to rename, and then click "Rename Profile".
  2. -
  3. Enter a new name for the profile and click on OK.
  4. -
- -
-

Nota: The folder containing the files for the profile is not renamed.

-
- -

Opções

- -

Trabalhar off-line

- -

Choosing this option loads the selected profile, and starts Firefox offline. You can view previously viewed web pages, and experiment with your profile.

- -

Não perguntar no arranque

- -

If you have multiple profiles, Firefox prompts you for the profile to use each time you start Firefox. Select this option to allow Firefox to load the selected profile, without prompting at startup.

- -
-

Nota: To access other profiles after selecting this option, you must start the Profile Manager first.

-
- -

Utilizar os perfis

- -

Windows

- -

If you want to have the profile manager to pop up each time you start Firefox, so you can choose a profile, you will need to edit the "Target" of the launch icon. To do this:

- -
    -
  1. Right-click the icon and choose "Properties".
  2. -
  3. When the properties dialog box pops up, you should see a "Target" text field that you can edit, and it should show the current file path.
  4. -
  5. After the closing quote, add -ProfileManager.
  6. -
  7. Click Ok.
  8. -
- -

Now whenever you double click that icon, the profile manager should appear, allowing you to choose which profile you'd like to use.

- -

If you want individual icons to launch specific profiles, you will need to edit the "Target" of each icon. To do this:

- -
    -
  1. Right-click the icon and choose "Properties".
  2. -
  3. When the properties dialog box pops up, you should see a "Target" text field that you can edit, and it should show the current file path.
  4. -
  5. To permanently set a specific profile, add -p PROFILE_NAME to the target path, but outside of the quotes, replacing "PROFILE_NAME" with the actual profile name you chose.
  6. -
  7. If you would also like to allow multiple instances of Firefox to run at the same time, add -no-remote after the profile name.
  8. -
- -

Once you are all done, click Ok. Do this for each icon you'd like to have a specific profile for. Once done, each one should automatically start with the specified profile.

- -

Linux

- -

There is no extremely straightforward way to create custom application launchers in Gnome 3 like there was in Gnome 2. The following tutorial will help get you going overall: Gnome 3 Custom application launcher. Once you get to the point of adding a new item, you can have the profile dialog show up every time or set the launcher to launch a specific profile.

- -

If you want to have the profile manager to pop up each time you start Firefox, so you can choose a profile, you will need to set the command line for your new launcher.

- -
    -
  1. Set the "command" text field to target the executable file, likely "/usr/bin/firefox", and add the -p parameter.
  2. -
- -

If you want individual icons to launch specific profiles, you will need to set the command line for your new launcher. To do this:

- -
    -
  1. Set the "command" text field to target the executable file, likely "/usr/bin/firefox", and add the -p PROFILE_NAME parameter, replacing "PROFILE_NAME" with the specific profile.
  2. -
  3. Repeat as necessary, for each additional profile you want to set.
  4. -
  5. If you would also like to allow multiple instances of Firefox to run at the same time, add "-no-remote" after the profile name.
  6. -
- -

Mac OS X

- -

You can find a useful tutorial to set up custom launchers here: Managing Multiple Firefox Profiles in OSX. Do note it's best to follow all steps in the "Creating the scripts" section, including the "edit Info.plist" step. Leave off the profile name if you want the profile selector to show up every time you launch.

- -

Configurar vários perfis para diferentes canais do Firefox

- -

This section will be especially helpful if you are a developer, wanting to work with multiple channels, and each having their separate launcher.

- -

Windows

- -

In Windows, the Developer and Nightly builds get their own directory in the "Programs" folder, so you don't have to worry about where to store the downloaded files. However, all three will attempt to use the same profile by default. You won't want to keep this behavior, because the different channels have different levels of features. To set each launcher, follow the Windows instructions at Windows Launcher.

- -

Linux

- -

In Linux, things aren't as automatically set up. You will likely get a prompt to download a tar.bz2 file to extract from. Extract the files to a new directory, and use the new launcher instructions from here. The only change you will need to make is the command path. You will want to set it to the directory where you extracted the Firefox channel's tar.bz2 file, and the executable "firefox" file located within this directory. The remaining profile assignment methods will remain the same. You will want to, for sure, add the -no-remote part to the end of the command field, so that you could run multiple instances at the same time.

- -

Mac OS X

- -

You can find a useful tutorial to set up custom launchers here: Managing Multiple Firefox Profiles in OSX. Do note it's best to follow all steps in the "Creating the scripts" section, including the "edit Info.plist" step. Also, you'll want to change the path in the do shell script to point to the correct .app file for the Firefox channel you want to target.

diff --git a/files/pt-pt/mozilla/firefox/multiprocess_firefox/cross_process_object_wrappers/index.html b/files/pt-pt/mozilla/firefox/multiprocess_firefox/cross_process_object_wrappers/index.html deleted file mode 100644 index d6efcd07ea..0000000000 --- a/files/pt-pt/mozilla/firefox/multiprocess_firefox/cross_process_object_wrappers/index.html +++ /dev/null @@ -1,157 +0,0 @@ ---- -title: Cross Process Object Wrappers -slug: Mozilla/Firefox/Multiprocess_Firefox/Cross_Process_Object_Wrappers -translation_of: Mozilla/Firefox/Multiprocess_Firefox/Cross_Process_Object_Wrappers ---- -
{{FirefoxSidebar}}
-

Este documento descreve Cross Process Object Wrappers (CPOWs), que permite ao código de chrome aceder sincronamente ao conteúdo no 'Multiprocessos do Firefox'.

-
- -
-

Note that from Firefox 47 onwards, unsafe CPOW usage is no longer permitted in browser code. If browser code tries an unsafe CPOW operation, the browser will throw an exception and you'll see an "unsafe CPOW usage forbidden” error in the Browser Console.

- -

Add-on code is still allowed to use CPOWs "unsafely". However, if an add-on passes a CPOW into a platform API, and that platform API then attempts an unsafe operation on it, this will throw an exception. So as a general rule, add-ons should avoid passing CPOWs into non-addon code.

-
- -

In multiprocess Firefox, chrome code runs in a different process from web content. So chrome code can't directly interact with web content: instead, it must factor out the code that interacts with web content into separate scripts that are called frame scripts.

- -

Chrome code can load frame scripts into the content process using the message manager, and can then communicate with them using a message-passing API. To learn more about this, see the documentation on using the message manager.

- -

Chrome to content messaging must be asynchronous. This is because the chrome process runs the Firefox UI, so if it were blocked by the content process, then a slow content process could cause Firefox to become unresponsive to users.
-
- Converting synchronous code to be asynchronous can be difficult and time-consuming. As a migration aid, the messaging framework enables frame scripts to make content objects available to chrome through a wrapper called a Cross Process Object Wrapper, also known as a CPOW. However, although CPOWs are convenient, they have serious limitations and can cause responsiveness problems, so should only be used when necessary and only as a migration aid.

- -

Passagem de CPOWs de frame scripts

- -

Frame scripts can send messages to chrome using one of two global functions: sendAsyncMessage() or sendSyncMessage(). The optional third parameter to each of these functions is an object whose properties are objects to wrap. For example, this frame script sends a DOM node to chrome when the user clicks it, as the clicked property of the third argument:

- -
// frame script
-addEventListener("click", function (event) {
-  sendAsyncMessage("my-e10s-extension-message", {}, { clicked : event.target });
-}, false);
- -

In the chrome script, the DOM node is now accessible through a Cross Process Object Wrapper, as a property of the objects property of the message. The chrome script can get and set the wrapped object's properties and call its functions:

- -
// chrome script
-windowMM.addMessageListener("my-e10s-extension-message", handleMessage);
-
-function handleMessage(message) {
-  let wrapper = message.objects.clicked;
-  console.log(wrapper.innerHTML);
-  wrapper.innerHTML = "<h2>Modified by chrome!</h2>"
-  wrapper.setAttribute("align", "center");
-}
- -

CPOWs gerados automaticamente

- -

Add-ons that have not declared themselves multiprocess compatible are set up with a number of compatibility shims. One of these shims provides the following behavior: whenever chrome code tries to access content directly (for example, through window.content or browser.contentDocument), it is given back a CPOW that wraps the content object. This means that examples like this will actually work, even in multiprocess Firefox:

- -
gBrowser.selectedBrowser.contentDocument.body.innerHTML = "replaced by chrome code";
- -

It's still important to keep in mind, though, that this is access through a CPOW and not direct access to content.

- -

CPOWs bidirecionais

- -

A common pattern is for chrome code to access content objects and add event listeners to them. To deal with this, CPOWs are bidirectional. This means that if content passes a CPOW to the chrome process, the chrome process can synchronously pass objects (such as event listener functions) into functions defined in the CPOW.

- -

This means you can write code like this:

- -
// frame script
-
-/*
-On mouseover, send the button to the chrome script as a CPOW.
-*/
-
-var button = content.document.getElementById("click-me");
-
-button.addEventListener("mouseover", function (event) {
-  sendAsyncMessage("my-addon-message", {}, { element : event.target });
-}, false);
- -
// chrome script
-
-/*
-Load the frame script, then listen for the message.
-When we get the message, extract the CPOW and add
-a function as a listener to the button's "click" event.
-*/
-
-  browserMM.loadFrameScript("chrome://my-addon/content/frame-script.js", false);
-  browserMM.addMessageListener("my-addon-message", function(message) {
-    let wrapper = message.objects.element;
-    wrapper.addEventListener("click", function() {
-      console.log("they clicked");
-    });
-  });
-
- -

Mapear conteúdo de documentos para navegadores XUL

- -

A common pattern is to get the XUL <browser> that corresponds to a content document. To enable this, gBrowser.getBrowserForDocument and gBrowser.getBrowserForContentWindow can be passed a CPOW for the content document and content window, respectively, and return the XUL  <browser> that these documents / windows belong to. Both return null if no such browser can be found.

- -

Limitações de CPOWs

- -

Although CPOWs can be convenient they have several major limitations, which are listed below.

- -

CPOWs e APIs de plataforma

- -

You can't pass CPOWs into platform APIs that expect to receive DOM objects. For example, you can't pass a CPOW into nsIFocusManager.setFocus().

- -

Also, from Firefox 47 onwards, browser code can no longer perform unsafe CPOW operations. This means that as an add-on developer, you should not pass CPOWs into browser APIs.

- -

Reação de Chrome

- -

The lack of a synchronous API on the chrome side is intentional: because the chrome process runs the Firefox UI, any responsiveness problems affect the whole browser. By making the chrome process block on the content process, CPOWs break this principle and allow unresponsive content process to make the whole browser unresponsive.

- -

Consulte em baixo CPOWs seguros e inseguros para mais sobre isto.

- -

Desempenho

- -

Although the wrapper looks just like an object completely contained in the chrome script scope, it's really just a reference to an object in the content process. When you access a property of the wrapper, it sends a synchronous message to the content process and returns the result. This means it is many times slower to use than an object.

- -

Ordenação de mensagem

- -

CPOWs can violate assumptions you might make about message ordering. Consider this code:

- -
mm.addMessageListener("GotLoadEvent", function (msg) {
-  mm.sendAsyncMessage("ChangeDocumentURI", {newURI: "hello.com"});
-  let uri = msg.objects.document.documentURI;
-  dump("Received load event: " + uri + "\n");
-});
-
- -

This sends a message asking the frame script to change the current document URI, then accesses the current document URI via a CPOW. You might expect the value of uri to come back as "hello.com". But it might not: in order to avoid deadlocks, CPOW messages can bypass normal messages and be processed first. It’s possible that the request for the documentURI property will be processed before the "ChangeDocumentURI" message, in which case uri will have its previous value.
-
- For this reason, it’s best not to mix CPOWs with normal message manager messages. It’s also a bad idea to use CPOWs for anything security-related, since you may get results that are not consistent with surrounding code that might use the message manager.

- -

CPOWs seguros e inseguros

- -

The main reason CPOWs can be bad for responsiveness is that they make the chrome process block on the content process.

- -

Essentially, the problem is this: suppose the content process is busy with some long-running operation (for example, garbage collection). In multiprocess Firefox, the browser UI is still responsive, because it's running in a different process. But if the chrome process then tries to use a CPOW, the chrome process will block until the content process is ready to respond. Suddenly, what looked like a simple property access could block the UI for a noticeable amount of time:

- -

- -

There is one scenario, though, in which this is not a problem: when the content process is already blocking on a synchronous message it sent to the chrome process.

- -

The content process is blocked anyway waiting for the chrome process, so there's no chance, in this situation, that the CPOW call will block on some long-running activity in the content process. The content process can respond immediately to the CPOW call:

- -


-

- -

There is still a performance cost to the CPOW in this situation, because the CPOW call is an IPC call instead of a simple property access in the same process. However, the potential impact on responsiveness is much smaller.

- -

Also, in this situation, the content process is in a known state. We know it's blocked waiting for the synchronous message to return, and we know that won't change during the CPOW call. This makes the CPOW call much safer than it would otherwise be.

- -

This situation is thus called "safe CPOW usage". All other uses of CPOWs are called "unsafe CPOW usage".

- -

Consulyat também:

- - - -

 

- -

 

diff --git a/files/pt-pt/mozilla/firefox/multiprocess_firefox/depuracao_de_frame_scripts/index.html b/files/pt-pt/mozilla/firefox/multiprocess_firefox/depuracao_de_frame_scripts/index.html deleted file mode 100644 index 6f22e9a0b7..0000000000 --- a/files/pt-pt/mozilla/firefox/multiprocess_firefox/depuracao_de_frame_scripts/index.html +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: Depuração de frame scripts -slug: Mozilla/Firefox/Multiprocess_Firefox/Depuracao_de_frame_scripts -tags: - - Caixa de ferramentas de Conteúdo de Navegador - - Multiprocessos do Firefox -translation_of: Mozilla/Firefox/Multiprocess_Firefox/Debugging_frame_scripts ---- -
{{FirefoxSidebar}}
-

A Caixa de Ferramentas de Conteúdo de Navegador só está disponível no Firefox Nightly, e apenas se extiver a executar o Firefox no modo de multiprocessos.

-
- -

You can use the Browser Content Toolbox to debug frame scripts. The Browser Content Toolbox is a separate window that includes some of the standard Firefox Developer Tools - specifically: the console, the JavaScript debugger, and Scratchpad - but attaches them to the browser's content process. This means you can debug the frame scripts in your add-on.

- -

Abrir a Caixa de Ferrmanetas de Conteúdo de Navegador

- -

{{EmbedYouTube("Cg6X_zIu7Xk")}}

- -

To open the Browser Content Toolbox, you'll need to:

- - - -

You should now see an item labeled "Browser Content Toolbox" in the Developer submenu in the Firefox Menu (or Tools menu if you display the menu bar or are on OS X). It opens in a separate window:

- -

If you've used the Firefox Developer Tools before, this should look pretty familiar.

- -

Along the top is a row of tabs that you can use to switch the active tool. Currently, we only support the Console, the Debugger, and Scratchpad in the Browser Content Toolbox. At the right of this row are three buttons that activate the split console, open settings, and close the toolbox.

- -

The rest of the toolbox is taken up with the tool you've currently selected.

- -

Utilização

- -

{{EmbedYouTube("XF0ULNnNOxg")}}

- -

O Depurador

- -

The Debugger lists all the scripts that are loaded into the content process. You'll find your frame scripts listed under the chrome:// URL you registered for them:

- -

You can set breakpoints, of course, and do all the other things supported by the debugger.

- -

A Consola

- -

The Console logs output from your frame scripts. If you want to use it to evaluate JavaScript in your frame script's scope, there's a trick you need to know:

- - - -

Now the console's scope is your frame script's scope, and you can interact directly with it:

- -

diff --git a/files/pt-pt/mozilla/firefox/multiprocess_firefox/gestor_de_mensagens/index.html b/files/pt-pt/mozilla/firefox/multiprocess_firefox/gestor_de_mensagens/index.html deleted file mode 100644 index 88d8419e69..0000000000 --- a/files/pt-pt/mozilla/firefox/multiprocess_firefox/gestor_de_mensagens/index.html +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: Gestor de mensagens -slug: Mozilla/Firefox/Multiprocess_Firefox/Gestor_de_mensagens -tags: - - API - - Guia(2) - - JavaScript -translation_of: Mozilla/Firefox/Multiprocess_Firefox/Message_Manager ---- -
{{FirefoxSidebar}}

Os gestores de mensagens fornecem uma maneira para o código de JavaScript chrome-privilegiado para comunicar através dos limites de processo. Eles são particularmente úteis para permitir que código do chrome, incluindo o código do navegador e o código de extensão, para aceder ao conteúdo da Web enquanto o navegador está a executar conteúdo da Web num processo separado

- -

Message managers provide a way for chrome-privileged JavaScript code to communicate across process boundaries. They are particularly useful for allowing chrome code, including the browser's code and extension's code, to access web content while the browser is running web content in a separate process.

- -

These guides explain how to use message managers in multiprocess Firefox.

- -

Note that none of this requires multiprocess Firefox: everything described here will work with single-process Firefox, so the same code will work on both variants.

- -
-

Guias

- -
- - - -
- -
-

Referência de API

- -
- - - -
diff --git a/files/pt-pt/mozilla/firefox/multiprocess_firefox/glossario/index.html b/files/pt-pt/mozilla/firefox/multiprocess_firefox/glossario/index.html deleted file mode 100644 index 22bb1b5b57..0000000000 --- a/files/pt-pt/mozilla/firefox/multiprocess_firefox/glossario/index.html +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: Glossário -slug: Mozilla/Firefox/Multiprocess_Firefox/Glossario -translation_of: Mozilla/Firefox/Multiprocess_Firefox/Glossary ---- -
{{FirefoxSidebar}}
-
-
-
Child-to-parent CPOWs
-
CPOWs that refer to objects in the parent (chrome) process.
-
Chrome process (also called the parent process)
-
The operating system process that runs the Firefox UI, including the toolbar, dialog boxes, and features like session restoration. All add-on code that doesn't run in frame scripts runs here.
-
Content process (also called the child process)
-
The operating system process that runs web content, in multiprocess Firefox. Code for frame scripts runs in this process.
-
Content scripts
-
Deprecated term for frame scripts.
-
CPOWs
-
CPOW stands for Cross Process Object Wrapper. A CPOW gives chrome code synchronous access to content objects, as a migration aid. See more about CPOWs.
-
-
- -
-
-
Frame scripts
-
When chrome code needs to interact with web content, it factors the code that needs to access content into separate scripts, and loads them into the content process. These separate scripts are called frame scripts. We used to call these scripts "content scripts" but have deprecated that term.
-
Message manager
-
Message managers enable chrome code to load frame scripts into content processes, and communicate with them using a message-passing API. See more about message managers.
-
Parent-to-child CPOWs
-
CPOWs that refer to objects that live in the child (content) process.
-
Shim
-
...
-
-
-
- -

 

diff --git a/files/pt-pt/mozilla/firefox/multiprocess_firefox/index.html b/files/pt-pt/mozilla/firefox/multiprocess_firefox/index.html deleted file mode 100644 index 8bf746e32a..0000000000 --- a/files/pt-pt/mozilla/firefox/multiprocess_firefox/index.html +++ /dev/null @@ -1,79 +0,0 @@ ---- -title: Multiprocessos do Firefox -slug: Mozilla/Firefox/Multiprocess_Firefox -tags: - - Firefox -translation_of: Mozilla/Firefox/Multiprocess_Firefox ---- -
{{FirefoxSidebar}}
- -

Nas versões antigas do Firefox para PC, todo o navegador era executado num único processo do sistema operativo. Em particular, o JavaScript que executa a IU do navegador (também conhecido como "código do chrome") executa o mesmo processo como o código nas páginas da Web (também conhecido como "conteúdo" ou "conteúdo da Web").
-
- As últimas versões do Firefox executam a IU do navegador num processo separado do conteúdo da Web. Na primeira iteração dessa arquitetura, todos os separadores do navegador funcionam no mesmo processo e a IU do navegador é executada num processo diferente. Em iterações futuras, nós esperamos ter mais doque um processo de conteúdo. O projeto que está a distribuir 'Multiprocessos do Firefox' é chamado de Electrolysis, por vezes abreviado para e10s.

- -

As páginas da Web normais não são afetadas pelo 'Multiprocessos do Firefox'. As pessoas que trabalham no próprio Firefox e os programadores de extras do Firefox não serão afetados se o seu código depende de ser capaz de aceder diretamente ao conteúdo da Web.

- -

Em vez de aceder ao conteúdo da web diretamente, o código do chrome terá que utilizar o gestor de mensagens. Para ajudar a facilitar esta transição, nós implementamos Cross Process Object Wrappers e alguns shims de compatibilidade para os programadores de extras. Se é um programador de extras perguntando-se a si mesmo se está ou não afetado por esta alteração, consulte o guia para trabalhar com multiprocessos do Firefox.

- -
-
-
-
-
Resumo técnico
-
A very high-level view of how multiprocess Firefox is implemented.
-
Guia de compatibilidade do conteúdo da Web
-
Guidelines and details on potential Web site compatibility issues that may arise due to the transition. Tip: there aren't very many!
-
Glossário
-
Uma referência para o gíria utilizada em 'Multiprocessos do Firefox'.
-
Gestor de mensagens
-
Complete guide to the objects used to communicate between chrome and content.
-
Extras baseados em SDK
-
How to migrate add-ons developed using the Add-on SDK.
-
Quais os URIs que carregam e onde
-
A quick guide to which URIs - chrome:, about:, file:, resource: - are loaded into which process.
-
-
- -
-
-
Motivação
-
Why we are implementing multiprocess Firefox: performance, security, and stability.
-
Guia de migração de extras
-
If you are an add-on developer, find out if you are affected and how to update your code.
-
Cross Process Object Wrappers
-
Cross Process Object Wrappers are a migration aid, giving chrome code synchronous access to content.
-
Depuração de processos do conteúdo
-
How to debug code running in the content process, including frame and process scripts.
-
Seleção de separador nos multiprocessos do Firefox
-
How switching tabs works in multiprocess Firefox.
-
-
-
- -
-
-
-
-
Limitações de chrome scripts
-
Práticas que já não irão funcionar no código de chrome, e como as fixar.
-
-
- -
-
-
Limitações de frame scripts
-
Práticas que já não irão funcionar dentro de frame scripts, e o que fazer.
-
-
-
- -
-

Contacte-nos

- -

Saiba mais sobre o projeto, participe, ou coloque as suas perguntas.

- - diff --git a/files/pt-pt/mozilla/firefox/multiprocess_firefox/limitacoes_de_chrome_scripts/index.html b/files/pt-pt/mozilla/firefox/multiprocess_firefox/limitacoes_de_chrome_scripts/index.html deleted file mode 100644 index f761b2c6f7..0000000000 --- a/files/pt-pt/mozilla/firefox/multiprocess_firefox/limitacoes_de_chrome_scripts/index.html +++ /dev/null @@ -1,215 +0,0 @@ ---- -title: Limitações de "chrome scripts" -slug: Mozilla/Firefox/Multiprocess_Firefox/Limitacoes_de_chrome_scripts -translation_of: Mozilla/Firefox/Multiprocess_Firefox/Limitations_of_chrome_scripts ---- -
{{FirefoxSidebar}}

This page describes patterns that used to work in the chrome process that will no longer work in multiprocess Firefox. These are the sorts of things that will break an old add-on in multiprocess Firefox. The fix is generally some variant of "do that in a frame script loaded into the content process".

- -

This is one of a pair of articles: the other one lists limitations of frame scripts.

- -

Compatibilidade de shims

- -

For many of the patterns described here we've implemented compatibility shims so the patterns still work. For example: whenever extensions try to access web content from the chrome process, the browser will return a Cross Process Object Wrapper that gives the chrome code synchronous access to the content.

- -

You'll get the shims for your add-on by default, unless you set the multiprocessCompatible flag in your add-on's install manifest.

- -

However, these shims are not a substitute for migrating extensions:

- - - -

You can see all the places where your add-on uses compatibility shims by setting the dom.ipc.shims.enabledWarnings preference and watching the browser console as you use the add-on.

- -

The rest of this page documents patterns that don't work in multiprocess Firefox as well as how are shims try to paper over the problem. For each pattern we've noted:

- - - -

gBrowser.contentWindow, window.content...

- -

Sem shim

- -

All APIs in the chrome process that provide direct access to content objects will no longer work. For example:

- -
// chrome code
-
-gBrowser.contentWindow;                    // null
-
-gBrowser.contentDocument;                  // null
-
-gBrowser.selectedBrowser.contentWindow;    // null
-
-window.content;                            // null
-
-content;                                   // null
-
- -

As a special note, docshells live in the content process, so they are also inaccessible:

- -
gBrowser.docShell;                         // null
-
-gBrowser.selectedBrowser.docShell;         // null
- -

Com shim

- -

The shim will give you a CPOW for the content object in these situations.

- -

In some situations, the content process may not be initialized when an add-on asks for access to its content. In this case, the shim will return a JavaScript object that looks somewhat like a window or a document for about:blank. However, this "dummy" object is completely static and only exposes a few of the normal properties that windows and documents have. For this reason, add-ons that try to access content objects in fresh <browser> elements may run into trouble.

- -

To make the shim unnecessary: factor the code that needs to access content into a separate script, load that script into the content process as a frame script, and communicate between the chrome script and the frame script using the message-passing APIs. See the article on using the message manager.

- -

Limitações de CPOWs

- -

Cross process object wrappers (CPOWs) are a migration aid giving chrome code synchronous access to content objects. However, there are various limitations on the kinds of things you can do with a CPOW.

- -
-

Note that from Firefox 47 onwards, unsafe CPOW usage is no longer permitted in browser code. If browser code tries an unsafe CPOW operation, the browser will throw an exception and you'll see an "unsafe CPOW usage forbidden” error in the Browser Console.

- -

Add-on code is still allowed to use CPOWs "unsafely". However, if an add-on passes a CPOW into a platform API, and that platform API then attempts an unsafe operation on it, this will throw an exception. So as a general rule, add-ons should avoid passing CPOWs into non-addon code.

-
- -

nsIContentPolicy

- -

Sem shim

- -

In multiprocess Firefox, if you register the nsIContentPolicy in the chrome process then it will never see any attempts to load web content, because they happen in the content process.

- -

Com shim

- -

The shim enables you to add content policies in the chrome process. It transparently registers an nsIContentPolicy in the content process, whose shouldLoad just forwards to the chrome process. The content to check is forwarded as a CPOW. The chrome process then checks the content against the policy supplied by the add-on, and forwards the response back to the child to be enforced.

- -

To make the shim unnecessary: define and register nsIContentPolicy in the content process. If you need to ensure that the policy is only registered once, use a process script to register the policy.

- -

nsIWebProgressListener

- -

This API will work in the chrome process. There is a shim that gives you access to the DOMWindow property of the nsIWebProgress object passed into onStateChange. However, the DOMWindow is passed asynchronously, so by the time the chrome process receives it, the DOM might have changed (for example, because code running in the content process modified it or we navigated to a different page). We're working on fixing this issue in bug 1118880.

- -

Also note that unlike other shims, this shim is always active.

- -

Alternatively, you can use nsIWebProgressListener in the content process.

- -

Observadores no processo de chrome

- -

Depending on the topic, you need to register observers in either the chrome process or in a frame script.

- -

For most topics you need to register observers in the chrome process.

- -

However, you must listen to content-document-global-created and document-element-inserted in a frame script. Observers for these topics get content objects as the aSubject argument to observe(), so notifications are not sent to the chrome process.

- -

There is a shim that will forward these two topics to the chrome process, sending CPOWs as the aSubject argument.

- -

Pedidos de HTTP

- -

You can't observe HTTP requests in the content process. If you do, you'll get an error.
-
- If you do so in the chrome process, it will mostly work. The subject for the observer notification will be an nsIHttpChannel as you would expect.

- -

A common pattern here is to use the notificationCallbacks property of the nsIHttpChannel to get the DOM window that initiated the load, like this:

- -
observe: function (subject, topic, data) {
-  if (topic == "http-on-modify-request") {
-    var httpChannel = subject.QueryInterface(Ci.nsIHttpChannel);
-    var domWindow = httpChannel.notificationCallbacks.getInterface(Ci.nsIDOMWindow);
-  }
-}
- -

Or this:

- -
observe: function (subject, topic, data) {
-  if (topic == "http-on-modify-request") {
-    var httpChannel = subject.QueryInterface(Ci.nsIHttpChannel);
-    var domWindow = httpChannel.notificationCallbacks.getInterface(Ci.nsILoadContext).associatedWindow;
-  }
-}
- -

In multiprocess Firefox these patterns will no longer work: the getInterface call will fail.

- -

In multiprocess Firefox, notificationCallbacks is a special object that tries to emulate the single-process notificationsCallbacks object as best it can. It will return a dummy nsILoadContext when asked, but any attempt to get a window out of it will fail.
-
- There is an outstanding bug (bug 1108827) to implement a shim here that will make notificationCallbacks a CPOW for the objects in the content process.

- -

The correct way to access the DOM window is through a message manager. In an HTTP observer, you can get the browser message manager for the window using code like this:

- -
observe: function (subject, topic, data) {
-  if (topic == "http-on-modify-request") {
-    var httpChannel = subject.QueryInterface(Ci.nsIHttpChannel);
-    var loadContext = httpChannel.notificationCallbacks.getInterface(Ci.nsILoadContext);
-    // topFrameElement is the <browser> element
-    var topFrameElement = loadContext.topFrameElement;
-    var browserMM = topFrameElement.messageManager;
-    console.log("browserMM: " + browserMM);
-  }
-}
- -

However, before Firefox 38, this technique will not work if multiprocess Firefox is disabled: specifically, topFrameElement will be null. This means that if you need to write code that works before Firefox 38 and on both multiprocess and non-multiprocess variants, you need to implement both paths:

- - - -

From Firefox 38 onwards, the topFrameElement approach always works.

- -

Eventos DOM

- -

Sem shim

- -

In multiprocess Firefox, if you want to register an event listener on some content DOM node, that needs to happen in the content process.

- -

It used to be that if you registered a listener on the XUL <browser>  or <tab> element that hosted some DOM content, then events in the content would bubble up to the XUL and you could handle them there. This no longer happens in multiprocess Firefox.

- -

Com shim

- -

The shim intercepts chrome process code that adds listeners to XUL elements and sets up listeners in the content process, relaying the result back to the chrome process. The Event object itself is relayed to the chrome process as a CPOW.

- -

To make the shim unnecessary: register event listeners on the global object inside a frame script. For example:

- -
addEventListener("load", handler, true) // for example
- -
If you need to contact the chrome process when that happens, send it a message.
- -
 
- -

Sandboxes

- -
You can create sandboxes in the chrome or the content process. Sandboxes are often used as a safe way to manipulate web content, and if that's your goal, create the sandbox in the content process.
- -
 
- -
There is a shim for sandboxes: if you make a sandbox in the chrome process and give it content principals (by passing a CPOW as the first argument to Components.utils.Sandbox) then we'll actually make it in the content process.
- -
 
- -
-

nsIAboutModule

- -

By default, custom about: pages registered using nsIAboutModule are loaded in the chrome process. This means that you can't access their content from the content process (via XHR, for example).

- -

You can change this default in the code you use to register the about: URI. See about: and chrome: URIs.

-
- -

Módulos de código de JavaScript (JSMs)

- -
In single-process Firefox, you can use JavaScript code modules (JSMs) to maintain global state. In multiprocess Firefox, a JSM loaded into one process does not share any state with the same JSM loaded into a different process: so you can't use a JSM to share state between the chrome and content processes.
- -
 
- -
If an add-on wants to use a JSM to share state in this way, it's best to load the JSM in the chrome process, and have frame scripts store and access the JSM's state by sending messages to the chrome process using the message manager.
- -
 
- -

nsIProtocolHandler

- -
In multiprocess Firefox, code which registers a custom protocol using nsIProtocolHandler must register the custom protocol in the child content process.
- -
If the custom protocol is registered only in the chrome process, no iframes or tabs will be able to load any resource from the custom procotol.
- -
 
- -
The solution is to register the custom protocol in the content process. You can do this by loading a frame script or, with the Add-on SDK, you can use remoteRequire() in the "remote/parent" module.
diff --git a/files/pt-pt/mozilla/firefox/multiprocess_firefox/limitacoes_de_frame_scripts/index.html b/files/pt-pt/mozilla/firefox/multiprocess_firefox/limitacoes_de_frame_scripts/index.html deleted file mode 100644 index 999472c499..0000000000 --- a/files/pt-pt/mozilla/firefox/multiprocess_firefox/limitacoes_de_frame_scripts/index.html +++ /dev/null @@ -1,103 +0,0 @@ ---- -title: Limitações de frame scripts -slug: Mozilla/Firefox/Multiprocess_Firefox/Limitacoes_de_frame_scripts -translation_of: Mozilla/Firefox/Multiprocess_Firefox/Limitations_of_frame_scripts ---- -
{{FirefoxSidebar}}

Frame scripts run with system privileges and have access to the Components object, enabling them to use XPCOM objects and JSMs. Many privileged APIs will just work in a content process. Anything that just manipulates data structures will just work. XHR and Workers will work. However, some APIs  that work in the chrome process will not work in a frame script. This article lists the most important of these APIs.

- -

This is one of a pair of articles: the other one lists limitations of chrome scripts.

- -

Restrições de Segurança no Acesso de Ficheiro

- -

Processes that host remote content are isolated from the local system through a content security sandbox. One of the functions of the sandbox is to restrict access to the local file system by processes that host remote content. Since frame and process scripts often execute in remote content processes these scripts are subject to the same file access rules placed on remote content. Therefore frame scripts should not attempt to access the local file system directly, as these calls will fail.

- -

Examples of APIs Add-on authors should avoid in frame scripts:

- - - -

XUL e IU de navegador

- -

Anything that tries to touch the browser UI or anything to do with XUL is likely to not work in the content process. For example:

- - - -

Serviços

- -

Some services will not work in frame scripts.

- - - -

Janelas de Chrome

- -

Anything that needs to use chrome windows will not work in the content process. For example:

- - - -

Places API

- -

A API de Places não pode ser utilizada dentro de uma frame script. Por exemplo:

- - - -

Observadores no processo de conteúdo

- -

As noted in Observers in the chrome process, most observers should be registered in the chrome process and will not work in the content process. The exceptions are:

- - - -

These must be registered in the content process.

- -

QI from content window to chrome window

- -
There's a particular pattern often used to get from a content window to the associated chrome window. It looks something like this:
- -
 
- -
window.QueryInterface(Ci.nsIInterfaceRequestor)
-                         .getInterface(Ci.nsIWebNavigation)
-                         .QueryInterface(Ci.nsIDocShellTreeItem)
-                         .rootTreeItem
-                         .QueryInterface(Ci.nsIInterfaceRequestor)
-                         .getInterface(Ci.nsIDOMWindow);
- -
This will no longer work. In the content process the root tree item is an nsITabChild, that cannot be converted to an nsIDOMWindow, so the second getInterface call here will fail.
- -
 
- -

If you want a chrome window: send a message from the content process using the message manager. The target property of the object passed into the message handler in the chrome process is the XUL <browser> receiving the message, and you can get the chrome window from that (Note: I'm not really sure how...).

- -

nsIAboutModule

- -

By default, custom about: pages registered using nsIAboutModule are loaded in the chrome process. This means that you can't access their content from the content process (via XHR, for example).

- -

You can change this default in the code you use to register the about: URI. See about: and chrome: URIs.

- -

Módulos de código de JavaScript (JSMs)

- -
In multiprocess Firefox, a JSM loaded into the content process does not share any state with the same JSM loaded into the chrome process. See the entry in the Limitations on chrome scripts page.
diff --git a/files/pt-pt/mozilla/firefox/multiprocess_firefox/quais_os_uris_que_carregam_e_onde/index.html b/files/pt-pt/mozilla/firefox/multiprocess_firefox/quais_os_uris_que_carregam_e_onde/index.html deleted file mode 100644 index 7a4ae7a993..0000000000 --- a/files/pt-pt/mozilla/firefox/multiprocess_firefox/quais_os_uris_que_carregam_e_onde/index.html +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: Quais os URIs que carregam e onde -slug: Mozilla/Firefox/Multiprocess_Firefox/Quais_os_URIs_que_carregam_e_onde -tags: - - Processo de Chrome - - Processo de Conteúdo -translation_of: Mozilla/Firefox/Multiprocess_Firefox/Which_URIs_load_where ---- -
{{FirefoxSidebar}}

Baseado inicialmente no esquema de URI da página, o navegador pode decidir se deseja carregar uma página no processo de chrome ou um processo de conteúdo. Para alguns esquemas, pode alterar o comportamento predefinido.

- - - - - - - - - - - - - - - - - - - - - - - - - - -
EsquemaComportamento
about: -

By default, about: pages are always loaded in the chrome process. However, when you register a new about: page, you can change this default.

- -

Two new flags are defined in nsIAboutModule:

- -
    -
  • URI_CAN_LOAD_IN_CHILD: the page will be loaded in the same process as the browser that has loaded it.
  • -
  • URI_MUST_LOAD_IN_CHILD: the page will always be loaded in a child process.
  • -
- -

To use one of these flags, return it from your implementation of getURIFlags in the code that registers the about: URI.

- -

If you use these flags, you must register the about page in the framescript for each tab. If you do not set multiprocessCompatible to true in your install.rdf then shims will be used. But the e10s shims will be deprecated soon. Read more here - Bug 1257201.

-
chrome: -

By default, chrome: pages are always loaded in the chrome process. However, when you register a new chrome: page, you can change this default.

- -

Two new flags are defined in the chrome.manifest file:

- -
    -
  • remoteenabled: the page will be loaded in the same process as the browser that has loaded it.
  • -
  • remoterequired: the page will always be loaded in a child process.
  • -
-
file: -

Carregado sempre num processo de conteúdo.

- -

Nota: This does not mean file: URIs can be used freely by code in content processes. Sandboxing may blacklist particular directories and future changes may restrict file: URIs to a separate content process, isolated from regular web content. See bug 1187099 how this can affect addons attempting to load files from the profile directory.

-
resource:Carregado sempre num processo de conteúdo.
diff --git "a/files/pt-pt/mozilla/firefox/multiprocess_firefox/resumo_t\303\251cnico/index.html" "b/files/pt-pt/mozilla/firefox/multiprocess_firefox/resumo_t\303\251cnico/index.html" deleted file mode 100644 index aa2613a58e..0000000000 --- "a/files/pt-pt/mozilla/firefox/multiprocess_firefox/resumo_t\303\251cnico/index.html" +++ /dev/null @@ -1,164 +0,0 @@ ---- -title: Resumo técnico -slug: Mozilla/Firefox/Multiprocess_Firefox/Resumo_técnico -translation_of: Mozilla/Firefox/Multiprocess_Firefox/Technical_overview ---- -
{{FirefoxSidebar}}
-

This page is an edited extract from Bill McCloskey's blog post on multiprocess Firefox: http://billmccloskey.wordpress.com/2013/12/05/multiprocess-firefox/

-
- -

At a very high level, multiprocess Firefox works as follows. The process that starts up when Firefox launches is called the parent process. Initially, this process works similarly to single-process Firefox: it opens a window displaying browser.xul, which contains all the principal UI elements for Firefox. Firefox has a flexible GUI toolkit called XUL that allows GUI elements to be declared and laid out declaratively, similar to web content. Just like web content, the Firefox UI has a window object, which has a document property, and this document contains all the XML elements from browser.xul. All the Firefox menus, toolbars, sidebars, and tabs are XML elements in this document. Each tab element contains a <browser> element to display web content.

- -

The first place where multiprocess Firefox diverges from single-process Firefox is that each <browser> element has a remote="true" attribute. When such a browser element is added to the document, a new content process is started. This process is called a child process. An IPC channel is created that links the parent and child processes. Initially, the child displays about:blank, but the parent can send the child a command to navigate elsewhere.

- -

Desenho

- -

Somehow, displayed web content needs to get from the child process to the parent and then to the screen. Multiprocess Firefox depends on a new Firefox feature called off main thread compositing (OMTC). In brief, each Firefox window is broken into a series of layers, somewhat similar to layers in Photoshop. Each time Firefox draws, these layers are submitted to a compositor thread that clips and translates the layers and combines them together into a single image that is then drawn.

- -

Layers are structured as a tree. The root layer of the tree is responsible for the entire Firefox window. This layer contains other layers, some of which are responsible for drawing the menus and tabs. One subtree displays all the web content. Web content itself may be broken into multiple layers, but they’re all rooted at a single “content” layer.

- -

In multiprocess Firefox, the content layer subtree is actually a shim. Most of the time, it contains a placeholder node that simply keeps a reference to the IPC link with the child process. The content process retains the actual layer tree for web content. It builds and draws to this layer tree. When it’s done, it sends the structure of its layer tree to the parent process via IPC. Backing buffers are shared with the parent either through shared memory or GPU memory. References to this memory are sent as part of the layer tree. When the parent receives the layer tree, it removes its placeholder content node and replaces it with the actual tree from content. Then it composites and draws as normal. When it’s done, it puts the placeholder back.

- -

The basic architecture of how OMTC works with multiple processes has existed for some time, since it is needed for Firefox OS. However, Matt Woodrow and David Anderson have done a lot of work to get everything working properly on Windows, Mac, and Linux. One of the big challenges for multiprocess Firefox will be getting OMTC enabled on all platforms. Right now, only Macs use it by default.

- -

User input

- -

Events in Firefox work the same way as they do on the web. Namely, there is a DOM tree for the entire window, and events are threaded through this tree in capture and bubbling phases. Imagine that the user clicks on a button on a web page. In single-process Firefox, the root DOM node of the Firefox window gets the first chance to process the event. Then, nodes lower down in the DOM tree get a chance. The event handling proceeds down through to the XUL <browser> element. At this point, nodes in the web page’s DOM tree are given a chance to handle the event, all the way down to the button. The bubble phase follows, running in the opposite order, all the way back up to the root node of the Firefox window.

- -

With multiple processes, event handling works the same way until the <browser> element is hit. At that point, if the event hasn’t been handled yet, it gets sent to the child process by IPC, where handling starts at the root of the content DOM tree. The parent process then waits to run its bubbling phase until the content process has finished handling the event.

- -

Inter-process communication

- -

All IPC happens using the Chromium IPC libraries. Each child process has its own separate IPC link with the parent. Children cannot communicate directly with each other. To prevent deadlocks and to ensure responsiveness, the parent process is not allowed to sit around waiting for messages from the child. However, the child is allowed to block on messages from the parent.

- -

Rather than directly sending packets of data over IPC as one might expect, we use code generation to make the process much nicer. The IPC protocol is defined in IPDL, which sort of stands for “inter-* protocol definition language”. A typical IPDL file is PNecko.ipdl. It defines a set messages and their parameters. Parameters are serialized and included in the message. To send a message M, C++ code just needs to call the method SendM. To receive the message, it implements the method RecvM.

- -

IPDL is used in all the low-level C++ parts of Gecko where IPC is required. In many cases, IPC is just used to forward actions from the child to the parent. This is a common pattern in Gecko:

- -
void AddHistoryEntry(param) {
-  if (XRE_GetProcessType() == GeckoProcessType_Content) {
-    // If we're in the child, ask the parent to do this for us.
-    SendAddHistoryEntry(param);
-    return;
-  }
-
-  // Actually add the history entry...
-}
-
-bool RecvAddHistoryEntry(param) {
-  // Got a message from the child. Do the work for it.
-  AddHistoryEntry(param);
-  return true;
-}
-
- -

When AddHistoryEntry is called in the child, we detect that we’re inside the child process and send an IPC message to the parent. When the parent receives that message, it calls AddHistoryEntry on its side.

- -

For a more realistic illustration, consider the Places database, which stores visited URLs for populating the awesome bar. Whenever the user visits a URL in the content process, we call this code. Notice the content process check followed by the SendVisitURI call and an immediate return. The message is received here; this code just calls VisitURI in the parent.

- -

The code for IndexedDB, the places database, and HTTP connections all runs in the parent process, and they all use roughly the same proxying mechanism in the child.

- -

Frame scripts

- -

IPDL takes care of passing messages in C++, but much of Firefox is actually written in JavaScript. Instead of using IPDL directly, JavaScript code relies on the message manager to communicate between processes. To use the message manager in JS, you need to get hold of a message manager object. There is a global message manager, message managers for each Firefox window, and message managers for each <browser> element. A message manager can be used to load JS code into the child process and to exchange messages with it.

- -

As a simple example, imagine that we want to be informed every time a load event triggers in web content. We’re not interested in any particular browser or window, so we use the global message manager. The basic process is as follows:

- -
// Get the global message manager.
-let mm = Cc["@mozilla.org/globalmessagemanager;1"].
-         getService(Ci.nsIMessageListenerManager);
-
-// Wait for load event.
-mm.addMessageListener("GotLoadEvent", function (msg) {
-  dump("Received load event: " + msg.data.url + "\n");
-});
-
-// Load code into the child process to listen for the event.
-mm.loadFrameScript("chrome://content/content-script.js", true);
-
- -

For this to work, we also need to have a file content-script.js:

- -
// Listen for the load event.
-addEventListener("load", function (e) {
-  // Inform the parent process.
-  let docURL = content.document.documentURI;
-  sendAsyncMessage("GotLoadEvent", {url: docURL});
-}, false);
-
- -

This file is called a frame script. When the loadFrameScript function call runs, the code for the script is run once for each <browser> element. This includes both remote browsers and regular ones. If we had used a per-window message manager, the code would only be run for the browser elements in that window. Any time a new browser element is added, the script is run automatically (this is the purpose of the true parameter to loadFrameScript). Since the script is run once per browser, it can access the browser’s window object and docshell via the content and docShell globals.

- -

The great thing about frame scripts is that they work in both single-process and multiprocess Firefox. To learn more about the message manager, see the message manager guide.

- -

Cross-process APIs

- -

There are a lot of APIs in Firefox that cross between the parent and child processes. An example is the webNavigation property of XUL <browser> elements. The webNavigation property is an object that provides methods like loadURI, goBack, and goForward. These methods are called in the parent process, but the actions need to happen in the child. First I’ll cover how these methods work in single-process Firefox, and then I’ll describe how we adapted them for multiple processes.

- -

The webNavigation property is defined using the XML Binding Language (XBL). XBL is a declarative language for customizing how XML elements work. Its syntax is a combination of XML and JavaScript. Firefox uses XBL extensively to customize XUL elements like <browser> and <tabbrowser>. The <browser> customizations reside in browser.xml. Here is how browser.webNavigation is defined:

- -
<field name="_webNavigation">null</field>
-
-<property name="webNavigation" readonly="true">
-   <getter>
-   <![CDATA[
-     if (!this._webNavigation)
-       this._webNavigation = this.docShell.QueryInterface(Components.interfaces.nsIWebNavigation);
-     return this._webNavigation;
-   ]]>
-   </getter>
-</property>
-
- -

This code is invoked whenever JavaScript code in Firefox accesses browser.webNavigation, where browser is some <browser> element. It checks if the result has already been cached in the browser._webNavigation field. If it hasn’t been cached, then it fetches the navigation object based off the browser’s docshell. The docshell is a Firefox-specific object that encapsulates a lot of functionality for loading new pages, navigating back and forth, and saving page history. In multiprocess Firefox, the docshell lives in the child process. Since the webNavigation accessor runs in the parent process, this.docShell above will just return null. As a consequence, this code will fail completely.

- -

One way to fix this problem would be to create a fake docshell in C++ that could be returned. It would operate by sending IPDL messages to the real docshell in the child to get work done. We may eventually take this route in the future. We decided to do the message passing in JavaScript instead, since it’s easier and faster to prototype things there. Rather than change every docshell-using accessor to test if we’re using multiprocess browsing, we decided to create a new XBL binding that applies only to remote <browser> elements. It is called remote-browser.xml, and it extends the existing browser.xml binding.

- -

The remote-browser.xml binding returns a JavaScript shim object whenever anyone uses browser.webNavigation or other similar objects. The shim object is implemented in its own JavaScript module. It uses the message manager to send messages like "WebNavigation:LoadURI" to a content script loaded by remote-browser.xml. The content script performs the actual action.

- -

The shims we provide emulate their real counterparts imperfectly. They offer enough functionality to make Firefox work, but add-ons that use them may find them insufficient. I’ll discuss strategies for making add-ons work in more detail later.

- -

Cross-process object wrappers

- -

The message manager API does not allow the parent process to call sendSyncMessage; that is, the parent is not allowed to wait for a response from the child. It’s detrimental for the parent to wait on the child, since we don’t want the browser UI to be unresponsive because of slow content. However, converting Firefox code to be asynchronous (i.e., to use sendAsyncMessage instead) can sometimes be onerous. As an expedient, we’ve introduced a new primitive that allows code in the parent process to access objects in the child process synchronously.

- -

These objects are called cross-process object wrappers, frequently abbreviated to CPOWs. They’re created using the message manager. Consider this example content script:

- -
addEventListener("load", function (e) {
-  let doc = content.document;
-  sendAsyncMessage("GotLoadEvent", {}, {document: doc});
-}, false);
-
- -

In this code, we want to be able to send a reference to the document to the parent process. We can’t use the second parameter to sendAsyncMessage to do this: that argument is converted to JSON before it is sent up. The optional third parameter allows us to send object references. Each property of this argument becomes accessible in the parent process as a CPOW. Here’s what the parent code might look like:

- -
let mm = Cc["@mozilla.org/globalmessagemanager;1"].
-         getService(Ci.nsIMessageListenerManager);
-
-mm.addMessageListener("GotLoadEvent", function (msg) {
-  let uri = msg.objects.document.documentURI;
-  dump("Received load event: " + uri + "\n");
-});
-mm.loadFrameScript("chrome://content/content-script.js", true);
-
- -

It’s important to realize that we’re send object references. The msg.objects.document object is only a wrapper. The access to its documentURI property sends a synchronous message down to the child asking for the value. The dump statement only happens after a reply has come back from the child.

- -

Because every property access sends a message, CPOWs can be slow to use. There is no caching, so 1,000 accesses to the same property will send 1,000 messages.

- -

Another problem with CPOWs is that they violate some assumptions people might have about message ordering. Consider this code:

- -
mm.addMessageListener("GotLoadEvent", function (msg) {
-  mm.sendAsyncMessage("ChangeDocumentURI", {newURI: "hello.com"});
-  let uri = msg.objects.document.documentURI;
-  dump("Received load event: " + uri + "\n");
-});
-
- -

This code sends a message asking the child to change the current document URI. Then it accesses the current document URI via a CPOW. You might expect the value of uri to come back as "hello.com". But it might not. In order to avoid deadlocks, CPOW messages can bypass normal messages and be processed first. It’s possible that the request for the documentURI property will be processed before the "ChangeDocumentURI" message, in which case uri will have some other value.

- -

For this reason, it’s best not to mix CPOWs with normal message manager messages. It’s also a bad idea to use CPOWs for anything security-related, since you may not get results that are consistent with surrounding code that might use the message manager.

- -

Despite these problems, we’ve found CPOWs to be useful for converting certain parts of Firefox to be multiprocess-compatible. It’s best to use them in cases where users are less likely to notice poor responsiveness. As an example, we use CPOWs to implement the context menu that pops up when users right-click on content elements. Whether this code is asynchronous or synchronous, the menu cannot be displayed until content has responded with data about the element that has been clicked. The user is unlikely to notice if, for example, tab animations don’t run while waiting for the menu to pop up. Their only concern is for the menu to come up as quickly as possible, which is entirely gated on the response time of the content process. For this reason, we chose to use CPOWs, since they’re easier than converting the code to be asynchronous.

- -

It’s possible that CPOWs will be phased out in the future. Asynchronous messaging using the message manager gives a user experience that is at least as good as, and often strictly better than, CPOWs. We strongly recommend that people use the message manager over CPOWs when possible. Nevertheless, CPOWs are sometimes useful.

diff --git a/files/pt-pt/mozilla/firefox_for_android/index.html b/files/pt-pt/mozilla/firefox_for_android/index.html deleted file mode 100644 index 12be7a39c2..0000000000 --- a/files/pt-pt/mozilla/firefox_for_android/index.html +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: Firefox para Android -slug: Mozilla/Firefox_for_Android -tags: - - Firefox - - Mobile -translation_of: Mozilla/Firefox_for_Android ---- -

Para cada vez mais pessoas, os dispositivos móveis são o meio principal, ou até o único meio, para aceder à Internet. Firefox para Android (nome de código Fennec) é um navegador aberto, personalizável, baseado em padrões, tal como a versão Firefox para pc.

- -

Firefox para Android cria a sua interface gráfica a partir de widgets nativos do Android em vez de XUL: isto aumenta de forma significativa o seu desempenho, especialmente o tempo de arranque, e o consumo de memória.

- -

Contribuir para o Firefox para Android

- -

O ponto de partida para informação acertca do projecto Firefox para Android é a página Wiki do projecto.

- -

Podes ajudar a criar e melhorar Firefox para Android:

- - - -

Programar para a Web móvel

- -

Nós começamos a criar um guia para desenhar sites da Web para os dispositivos móveis.

- -

Com Firefox para Android, pode aceder a um numero of APIs que expoem as capacidades subjacentes do dispositivo, diminuíndo a distância entre a Web e as aplicações nativas:

- - - -

Para testar o seu site da Web no Firefox para Android, pode instalar o Firefox para Android no seu dispositivo móvel ou pode executá-lo no seu computador utilizando o Emulador Android..

- -

Desenvolver extras para dispositivos móveis

- -

Firefox for Android supports add-ons using the exact same extension system used by all other Gecko-based applications. We did not invent a new add-on system. This means that building an add-on for Firefox on Android is the same process that would be used for desktop Firefox. Add-ons that work with desktop Firefox do not automatically work in Firefox on Android. The user interfaces are just too different.

- -
O Firefox no Android tem um identificador de aplicação único que deve ser utilizado em install.rdf. O identificador é {aa3c5121-dab2-40e2-81ca-7ea25febc110}
- -

Both classic restart-required and newer restartless add-on approaches are supported. Using the restartless approach is preferred whenever possible because the user experience is far superior to forcing an application restart when installing or removing an add-on.

- -

Resumo Rápido

- - - -

Obter ajuda com o Firefox para Android

- -

A documentação e tutoriais para utilizar e a resolução de problemas do Firefox para Android estão disponíveis no site da Web de Apoio da Mozilla.

- -

Install Firefox for Android

- -

If you don't already have Firefox installed on your Android device, you can do so at the Google Play store. See the SUMO article Install Firefox on an Android device using Google Play for detailed instructions.

- -

Alternate installs

- -

There are some unofficial builds and specialized installations for devices which don't officially support Firefox for Android. Here are some helpful links for these (keep in mind they are not supported by Mozilla and you are using them at your own risk!).

- - diff --git a/files/pt-pt/mozilla/how_to_get_a_stacktrace_for_a_bug_report/index.html b/files/pt-pt/mozilla/how_to_get_a_stacktrace_for_a_bug_report/index.html deleted file mode 100644 index 0c9d6d4e8d..0000000000 --- a/files/pt-pt/mozilla/how_to_get_a_stacktrace_for_a_bug_report/index.html +++ /dev/null @@ -1,97 +0,0 @@ ---- -title: Como obter um rastreamento para o relatório de erros -slug: Mozilla/How_to_get_a_stacktrace_for_a_bug_report -tags: - - Bugzilla -translation_of: Mozilla/How_to_get_a_stacktrace_for_a_bug_report ---- -

Se registar um relatório de crache no Bugzilla sobre um crache, deverá incluir um rastreamento (call stack) no seu relatório. Um rastreamento irá dizer aos programadores da Mozilla o que aconteceu e fornecer um ponto de partida para investigar a sua causa. Este artigo descreve como utilizar o 'relatóriod e Crache' da Mozilla (Breakpad) para obter uma Id. de crache, que os nossos engenheiros podem utilizar para obter um rastreamento, e formas alternativas de obter um rastreamento se não conseguir uma Id. de crache.

- -

Requisitos

- -

You need a binary build of Firefox from Mozilla.org. SeaMonkey and Thunderbird also support crash reporting.

- -

Mozilla's crash report server currently only has debug information for Mozilla builds and thus the crash reporter cannot work if you use a build from a Linux distribution or if you compile from source code. In these cases you will need to use one of the alternative methods listed below.

- -
Nota: When filing a crash report, it is important to know whether the crash occurs with Firefox safe mode. This helps engineers determine whether a particular extension or plugin is the cause of the crash.
- -

Como obter uma Id. de crache com o 'Relat´rio de Crache' da Mozilla

- - - - - - - - -
-

1. Crash and submit a report to the system.

- -

The Mozilla Crash Reporter window should automatically come up after Firefox crashes. If you have any additional information about the crash, such as additional detail on what you were doing at the time that may have triggered the crash, please enter it into the comments box. Be sure that you check the "Tell Mozilla about this crash" checkbox and click the restart button. The crash reporter should now submit the crash report and Firefox should open again.

- -
The "Details" button gives additional data about the incident, however this is not useful in a bug report.
-
-

reporter.jpg

-
- - - - - - - - -
-

2. Tell us the ID of the report you submitted.

- -

To access all of your submitted reports type "about:crashes" into the Firefox address bar and press enter. Firefox should open a list of IDs for your submitted crash reports. Copy two or three of the IDs for the appropriate crashes and paste them into your Bugzilla report. Please check the listed times to avoid copying the ID of an unrelated crash report.

- -
You can prefix a "bp-" to the beginning of an ID to make Bugzilla turn it into a link: bp-a70759c6-1295-4160-aa30-bc4772090918
-
-

crashlist.jpg

-
- -

How to get the crash ID if Firefox crashes on startup

- -

If Firefox crashes on startup you can still access your submitted crash reports. Crash reports are accessible from all Firefox profiles, so if a new profile does not crash you can use it to access them through "about:crashes" as above.

- -

Aceder às Ids. do relatório de crache fora do Firefox

- -

If you cannot load Firefox at all you can find the crash report files at this location depending on your operating system:

- -

Windows : %APPDATA%\Mozilla\Firefox\Crash Reports\submitted\
- OS X : ~/Library/Application Support/Firefox/Crash Reports/submitted/
- Linux : ~/.mozilla/firefox/Crash Reports/submitted/

- -

Each file in this folder contains one submitted crash report ID. You can check the modified or creation time for each file to discern which crash reports are relevant to your bug report.

- -

Modos alternativos para obter um rastreamento

- -

If the Mozilla crash reporter doesn't come up or isn't available you will need to obtain a stacktrace manually:

- -

Windows

- -

See the article Create a stacktrace with Windbg for information on how to do this.

- -

For a full process dump, see How to get a process dump with Windows Task Manager [en-US]

- -

OS X

- -

Run /Applications/Utilities/Console.app.  Expand "~/Library/Logs" and "CrashReporter", then look for logs for "firefox-bin".

- -

Linux

- -

Note that for most distros the package you need to get symbols for will be something like "xulrunner", not "firefox".

- -

Os ficheiros de relatórios de crache no seu computador

- -

When Breakpad initially catches a crash it first writes crash report files (e.g. .dump and .extra files) into the 'pending' subdirectory of its 'Crash Reports' directory.

- -

If Breakpad successfully sends the crash report to the reporting server then, by default, the files added to the 'pending' subdirectory for the crash are removed, and a .txt file is placed in the 'submitted' directory containing the crash ID that the reporting server recorded the crash under. If you want Breakpad to leave the .dump and .extra files on your computer so that you can examine them locally, then set the MOZ_CRASHREPORTER_NO_DELETE_DUMP environment variable to 1.

- - diff --git a/files/pt-pt/mozilla/implementacao_do_pontoon_num_projeto_da_mozilla/index.html b/files/pt-pt/mozilla/implementacao_do_pontoon_num_projeto_da_mozilla/index.html deleted file mode 100644 index 05fb22e5c3..0000000000 --- a/files/pt-pt/mozilla/implementacao_do_pontoon_num_projeto_da_mozilla/index.html +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: Implementação do Pontoon num projeto da Mozilla -slug: Mozilla/Implementacao_do_Pontoon_num_projeto_da_Mozilla -tags: - - Localização - - Tradução -translation_of: Mozilla/Implementing_Pontoon_in_a_Mozilla_website ---- -

Pontoon é uma ferramenta de localização (l10n), O-Que-Vê-É-O-Que-Obtém (WYSIWYG) baseada na Web. É uma ferramenta muito simples e intuitiva que requer poucos conhecimentos técnicos para os tradutores utilizarem, que irá reduzir o seu tempo para publicar as versões loacalizadas do seu projeto. Aqui, nós iremos discutir como é que pode utilizar o Pontoon com o seu projeto da Mozilla.

- -
-

Would you like to improve Pontoon? Learn how to get involved on GitHub.

-
- -
-

Just getting started with your project l10n? Check out the wiki on getting your project localized.

-
- -

A. Make your project localizable

- -

We realize that these are already considered to be standard best practices for localizing projects at Mozilla, but we feel it's good to add them here as a little reminder.

- -
    -
  1. Ensure that your project supports one of the l10n frameworks (gettext, XLIFF, L20n, lang, properties, etc.).
  2. -
  3. Extract localizable strings into resource files.
  4. -
  5. Push resource files to a repository (SVN, HG, Git). -
      -
    • Individual locale folders must be located at the same nesting level of the directory tree. Source locale needs to be called templates, en-US, en-us or en. If multiple folders with such name exist in the repository and contain files in a supported file format, the first one will be used. You may want to put all locale folders in a dedicated locales folder for this purpose. Locale code must not be part of the file name.
    • -
    • Correct pattern: -
      /locales/{locale_code}/path/to/file.extension
      -
    • -
    • Incorrect pattern: -
      /locales/{locale_code}/path/to/file.{locale_code}.extension
      -
    • -
    -
  6. -
  7. Make sure Pontoon has write access to the repository. - -
  8. -
- -

B. (optional) Enable in-page localization of your web project

- -
    -
  1. Link a script from your HTML <body> element, so Pontoon can talk to your site, detect content and make it localizable in place. You only need to do this in the environment that will be used for in-page localization, e.g. staging server: - - -
  2. -
  3. If your site uses CSP, please make sure that the following is permitted for domain pontoon.mozilla.org: -
      -
    1. loading inside iframe
    2. -
    3. loading remote CSS
    4. -
    5. loading remote images
    6. -
    -
  4. -
  5. If your site uses the X-Frame-Options header, please make sure loading inside iframe is permitted for domain pontoon.mozilla.org.
  6. -
  7. Make sure your site supports HTTPS. It's free, automated and open. Let's encrypt!
  8. -
- -

C. Add your project to Pontoon

- -

Your project is now ready to be set up in Pontoon. Please file a bug in Localization Infrastructure and Tools :: Administration / Setup and provide the following information:

- - - -

For more details, please get in touch with the Project Management Team.

diff --git a/files/pt-pt/mozilla/ligar/index.html b/files/pt-pt/mozilla/ligar/index.html deleted file mode 100644 index 2fda2a50be..0000000000 --- a/files/pt-pt/mozilla/ligar/index.html +++ /dev/null @@ -1,117 +0,0 @@ ---- -title: Ligar com Mozilla -slug: Mozilla/Ligar -tags: - - Ligar - - Mozilla -translation_of: Mozilla/Connect ---- -

Habilitar, inspirar e colaborar para tornar a Web na plataforma primária mais utilizada, para criar experiências através de todos os dispositivos interligados.

- -
-
- -
- -
- -
- -
- -
-
- -
-

Ligar com Mozilla

- -

Developers are creating the future by building services and apps for people all over the world. The goal of Mozilla Developer Relations is to help developers to use open and standardized web technologies to succeed in achieving their goals. We offer help and other resources towards this goal, through various channels. We invite you to connect, learn, and share your knowledge.

- -

Reach out to us at devrel@mozilla.com or on the irc.mozilla.org #devrel IRC channel. We also have a newsletter keeping you informed about the latest happenings in the web scene around web apps and more. Subscribe to the Apps & Hacks newsletter.

- -

We have a lot of plans and ideas for iteratively expanding our Developer Relations offerings, and we want you involved as we do so! So subscribe to the Hacks blog and subscribe to the newsletter!

- -

If you're on Twitter, follow us and hear about doc updates, jobs, contributor opportunities, and more.

- -

Aderir à Mozilla

- -

If you want to go beyond connecting with Mozilla, you can join Mozilla and help realize Mozilla's mission of building a better Internet. As a developer, you have skills to contribute in many areas, as well as the opportunity to enhance your skills. Mozilla is an open source project, so we "default to open." You can "view source" and contribute to our software development projects, like the Firefox browser for desktop and Android, Firefox OS, and Mozilla's websites. You can become part of an international community and get recognition for your efforts. Here are some of the advantages of contributing to the Mozilla project.

- -

Oportunidade para aprender qualquer coisa nova

- -
-

In writing code for an open source project, you may face problems you have not encountered before, which present learning opportunities for you. You can try out new tools and techniques in an open source project. For example, if you have never done unit testing, and cannot get permission to do so at work then coding for an open source project would be an excellent place to learn more about it. Contributing to open source gives you the opportunity to collaborate with and get to know many people around the world who have similar interests. Moreover, an open source organization like Mozilla has many contributors who can help you in solving problems you encounter. If you're just getting started contributing, you can look for "mentored" bugs, where an experienced contributor has offered to help a newcomer fix them.

- -

O que eu obtenho ao contribuir?

- -

Exploring many things and gaining recognition in the community -- these are the intangible benefits of contributing to Mozilla. While we can't guarantee specific tangible benefits, many valued contributors receive free Mozilla gear and invitations to Mozilla-related events, and are first in line to be considered for internships. Moreover, your experience in contributing to an open source project might help you find a job. More and more employers of developers are looking at open source contributions. They like to see that you're blogging and contributing to mailing lists, and they like to see you listed as a contributor to an open source project. It may also help with the work experience section of your CV/resumé.

- -

Como pode contribuir para a Mozilla

- -

There are many project area for which you can contribute to Mozilla. You can find a current, complete list on the main Mozilla Get Involved page. Some areas that may interest you as a developer include:

- - -
-
- -
-
 
- -
 
-
- -

Developers at a Firefox OS workshop in Madrid.

- -
- - -
-

Outros recursos

- - -
-
diff --git "a/files/pt-pt/mozilla/localization/aplica\303\247\303\243o_tradu\303\247\303\243o_com_mercurial/index.html" "b/files/pt-pt/mozilla/localization/aplica\303\247\303\243o_tradu\303\247\303\243o_com_mercurial/index.html" deleted file mode 100644 index ef44aa26fa..0000000000 --- "a/files/pt-pt/mozilla/localization/aplica\303\247\303\243o_tradu\303\247\303\243o_com_mercurial/index.html" +++ /dev/null @@ -1,282 +0,0 @@ ---- -title: Tradução da Aplicação com Mercurial -slug: Mozilla/Localization/aplicação_tradução_com_mercurial -translation_of: Mozilla/Localization/Application_Translation_with_Mercurial ---- -

{{draft}}

- -

Verifique qual o idioma que está disponível para tradução

- -
    -
  1. Find out on which branch localization is done for your locale: Read your localization team's page by clicking on the team with your language code (e.g. "de" for German). The localization lead for your language knows the branch. The default localization branch is aurora.
  2. -
  3. Next check what is still untranslated by going to Localization status page and click on the page for your language.
  4. -
  5. In the section "Applications & Sign-offs", you will find different products and branches which are currently in translation. -
      -
    • gaia-* denotes branches of Firefox OS, the operating system for mobile devices.
    • -
    • Firefox and fx-* denote branches of Firefox for Desktop, the browser for desktops and notebooks running, Windows, Mac OS or Linux.
    • -
    • Fennec and fennec-* denote branches of Firefox for Mobile, the Firefox browser for the Android operating system.
    • -
    • Thunderbird and tb-* denote branches of Thunderbird, the mail client, newsgroup and feed reader and chat client. The localization of the Lightning calendar add-on also takes place on these branches.
    • -
    • SeaMonkey and sea-* denote branches of SeaMonkey, the suite consisting of browser, mail and chat client and more.
    • -
    • Lightning and cal-* denote branches of Lightning, the calendar add-on for Thunderbird. The localization of Lightning now happens on Thunderbird's tb-* branches, the cal-* branches have been retired.
    • -
    -
  6. -
  7. In this example, we assume Firefox for Desktop shall be localized and that the localization branch is aurora. Scroll to the fx_aurora text.
  8. -
  9. Read the text next to it. -
      -
    • If it is 'Translated', the branch has already been translated. Either translate a different product now or contact the person responsible for localization from the team's page (see above) so he can notify you by mail when the next strings for translation become available.
    • -
    • If it is a red text consisting of a number and the word 'missing', then there are untranslated texts and you can move on with this guide.
      -  
    • -
    -
  10. -
- -

Ferramentas Necessárias

- -

Pré-requisitos de criação

- -

First, get the required programs to compile Mozilla applications like Firefox and Thunderbird from Instruções de Compilação. This is only necessary once.

- -
-

MozillaBuild deve estar instalado num caminho de ficheiro absoluto sem espaços em branco, senão este será interrompido..

-
- -

Programa de comparação de ficheiro

- -

For the translation, it is recommend to use file comparison program to compare the English file (containing the new texts) with the file of your locale (which is still missing the new strings). This example uses WinMerge: Download and install it. A comparison of alternatives (e.g. for Linux and Mac OS) is available on Wikipedia.

- -

Editor de ficheiro e texto

- -

For editing individual files a text editor can be a better choice than a file comparion program, e.g. because the file is new and everything has to be translated, the file is too customized to compare it to the English one, or special functionality is required (e.g. bookmarking untranslated lines). Use a text editor you are comfortable with. This example uses Notepad++.

- -

Ferramenta de monitorização do progresso

- -

To track which strings and files already have been translated and later also to see which new strings have already been tested in the product as being a good translation for the functionality behind the translated strings and that the translated texts fit into the available, the translation progress should be tracked. This can be done in a text editor or word processor or any other tool in which you can attach different kind of states to the individual texts to translate. The Firefox extension Scrapbook is used in this guide. Install it into your default Firefox profile (you will have more than one profile when following this guide).

- -

Obter os Textos atuais em inglês e o seu idioma

- -

Obter os textos em inglês com o código fonte

- -

Get the source code by downloading the following file:

- - - -

In the next step, we will unpack the source code:

- -
    -
  1. Open an input shell, e.g. by pressing the Windows key and R on the keyboard Screenshot of Windows key + R key or by calling the "Run..." command from the Windows "Start" button, and then typing cmd and pressing the Enter key.
  2. -
  3. Launch the installed MozillaBuild toolset by launching it with its path, e.g. C:\Mozilla\Coding\Buildtools\MozillaBuild\start-shell-msvc2010.bat You can autocomplete the file path after typing a few characters and then pressing the Tabulator key.
    - If you launch the start-shell-l10n.bat, compiling features will be disabled. You can create translation patches, but creating language packs for the application, binary repacks of the application (changing the localization of the program), and compiling the application likely won't work.
  4. -
  5. You are now in the Mozilla development environment which emulates a Linux environment. Now go to the directory where you want to put the source code. It's highly recommended to put it onto the fastest hard drive in the device. File paths here work starting with a slash (/) followed by the drive letter, and then the directory structure like on Windows, but using slashes (/) instead of backslashes (\). So let's go to C:\Mozilla by typing
    - cd /c/Mozilla/
  6. -
  7. Create a new directory for the source code:
    - mkdir mozilla-aurora
  8. -
  9. Initialize the new directory as new repository:
    - hg init mozilla-aurora
  10. -
  11. Go into the new directory:
    - cd mozilla-aurora
  12. -
  13. Unpack the source code:
    - hg unbundle /path/to/the/downloaded/mozilla-aurora.hg
    - This can take some time, mostly depending on the performance of the hard drive.
  14. -
  15. Extract the files:
    - hg update
  16. -
- -

Obter os textos para a sua localização

- -
    -
  1. Go back to the parent folder of mozilla-aurora:
    - cd ..
  2. -
  3. Find the localization repository for your branch and language on http://hg.mozilla.org/ E.g. for aurora and German (language code 'de'), it is http://hg.mozilla.org/releases/l10n/mozilla-aurora/de/ Copy that url to the clipboard.
  4. -
  5. Copy the repository to your computer by running the following command:
    - hg clone http://hg.mozilla.org/releases/l10n/mozilla-aurora/de/ de-mozilla-aurora
    - This should proceed pretty fast.
    - On Windows, you can paste the url by calling the Paste command from the window menu in the upper left corner of the window.
  6. -
- -

Configurar as suas definições de utilizador do Mercurial

- -

Still in the command prompt, go to your home directory in the file system, e.g. for a Windows user, it looks like C:\Users\MyName , depending on your Windows version:

- -

cd /c/Users/MyName

- -

Now list all the files here:

- -

ls -a

- -

If there is no file called .hgrc , create it with

- -

> .hgrc

- -

This file stores your general Mercurial settings (Mercurial is the tool which manages the source code and its history of changes).

- -

Now go in the file system to the file and open it in your favorite text editor. Windows users can use e.g. Notepad++.

- -

Paste the following content into the file:

- -
[ui]
-username = Firstname Lastname <mynick@example.com>
-merge = internal:merge
-
-[alias]
-qexport = export -g -r qtip
-qexportall = diff -r qparent
-
-[defaults]
-commit = -v
-diff = -p -U 8
-qdiff = -p -U 8
-qnew = -U
-
-[diff]
-git = 1
-showfunc = 1
-unified = 8
-
-[extensions]
-hgext.mq =
-progress =
-
-[hooks]
-
-
- -

Put in your name and email address which later will be public on the internet after your translation patch got accepted and uploaded. Save the file and close it.

- -

Ativar filas do Mercurial (correções revertíveis)

- -

Some time will pass between the moment in which you start the localization, finish it, test it, improve it, upload it for review and get review (maybe not approved on first try). Other localizers will likely have done changes to the translation, either adding new texts, removing obsolete ones or improving the current texts. This can cause conflicts between the changes you created and theirs. For this reason, updating patches kann be necessary so Mercurial is still able to find the lines in the files which it has to replace or where it has to add them. Mercurial queues allow to revert changes and also pull changes and reapply your local changes.

- -

Go back to the localization directory:

- -

cd /c/Mozilla/de-mozilla-aurora

- -

Initiate Mercurial queues:

- -

hg qinit

- -

Conhecer o estilo de tradução

- -

For having good chances that the translation suggestions get accepted, they should match the translation style of the texts in the application already translated. In general, the labels in the applications should have the same style like the operating system, e.g. use the same order of subject, verb and objects; decline verbs or not like the operating system does.

- -

The following resources can help figuring out the translation style and translate according to them:

- - - -

Escolher o que traduzir

- -

Go to the Localization status page and click on the '<number> missing' label of the Firefox branch on which you want to translate, e.g. fx_aurora. The page which opens has a bar holding information about how many texts (strings) have already been translated, how many there are in English and your locale and have the same text, and how many are missing in your local. The interesting part follows below as list of missing texts.

- -

unchanged localization report

- -

The first line shows the locale for which the texts are being translated (in this example: de - German). With the second line start the file paths of the files which require changes. The file paths follow the directory structure of the locale repository downloaded for translation. In this example, the file aboutDialog can be found in the folder browser/chrome/browser/. The text striked through are texts which have been removed in the English version and can also be removed from the locale being worked on. In this example we will translate the one new text with the id privatebrowsingpage.howToStart4 in the file aboutPrivateBrowsing.dtd.

- -

Tips for finding files with usually easily translateable texts:

- - - -

Monotorizar o progresso de tradução

- -

If you translate more than a few strings, you usually want to keep track of what has already been translated (and later if the text has been tested in the product as fitting into the available area and suiting the functionality it describes). This guide achieves this with the Firefox extension Scrapbook.

- -
    -
  1. You installed Scrapbook earlier, now open it in Firefox either by calling it from the Firefox menu bar (press the Alt key to show it if necessary) using "View" > "Sidebar" > "Scrapbook" or by clicking its toolbar button which you likely have to add by toolbar customization if you didn't do this before.
  2. -
  3. Drag the tab with the localization error showing missing and obsolete strings to the sidebar.
  4. -
  5. After Scrapbook has saved the web page to your local disk, click with the right mouse button on the page in the sidebar and choose "Properties" from the context menu which gets opened. Rename it something meaningful, e.g. "Firefox <version number> translation".
  6. -
  7. After you saved the dialog, click with the left mouse button on the page in the sidebar to open the locally saved copy.
  8. -
- -

Abrir ficheiros em inglês e o idioma de destino lado-a-lado

- -

The localization report shows the IDs of added or removed texts, but the English text itself is still unknown. We get this by comparing the English version of the file with the one of the locale we are translating in. To do so,

- -
    -
  1. Launch WinMerge.
  2. -
  3. From its "File" menu, choose "Save project".
  4. -
  5. For the file path of the left directory, go to the downloaded mozilla-aurora source code and then into its browser/locales/en-US/ folder. In this example, the absolute file path is C:\Mozilla\mozilla-aurora\browser\locales\en-US.
  6. -
  7. Enable read-only mode for the left directory.
  8. -
  9. For the file path of the right directory, go to the downloaded translation directory de-mozilla-aurora and then into its browser folder. In this example, the absolute file path is C:\Mozilla\de-mozilla-aurora\browser.
  10. -
  11. Save this comparison as project so you can easily relaunch this comparision without selecting the directories again. A good name is e.g. translation-mozilla-aurora-browser.winmerge
  12. -
  13. Open the comparison you just saved.
  14. -
- -

A tradução

- -
    -
  1. -

    Bring the console with Mercurial to the front.

    -
  2. -
  3. -

    Start tracking changes you make against the localization repository by telling it that with the qnew subcommand to save these changes as patch in a mercurial queue. This patch needs a name, choose something meaning full like "Firefox-<version number>-more-details". In this example, Firefox-29-aboutPrivateBrowsing will be used.
    - hg qnew Firefox-29-aboutPrivateBrowsing

    -
  4. -
  5. Switch back to WinMerge and navigate to browser/chrome/browser/ and open the aboutPrivateBrowsing.dtd file. You will see something like this:
    - single file comparision in WinMerge without changes by the user
    - On the left, you see an overview of the comparison of the English and the non-English file. Gray parts indicate blocks of texts which can't be found in that file, dark yellow represents changed lines and light yellow the parts of text in it which is different.
  6. -
  7. Below the license header which should never changed, the texts are organized in the following format:
    - <!ENTITY stringid "Text which will be shown in Firefox">
  8. -
  9. As you can see there is a bigger block of text not recognized. This is due to the texts which have in the English versionmoved from below the string with the id privatebrowsingpage.howToStart3 to a position above it. Cut and paste these strings in the localized file so their position corresponds to the on in the English file.
  10. -
  11. Press the F5 key or click the reload button in WinMerge's toolbar to re-compare the files.
  12. -
  13. Now copy the empty lines below privatebrowsingpage.learnMore and the line <!-- TO BE REMOVED POST-AUSTRALIS --> to the localized file. This text is a comment (which in .dtd files always can be found between <!-- and -->). There is no need to translate this text.
  14. -
  15. Now we copy the two missing lines from the English file and insert them in the localized file:
    - <!-- LOCALIZATION NOTE (privatebrowsingpage.howToStart4): please leave &newPrivateWindow.label; intact in the translation -->
    - <!ENTITY privatebrowsingpage.howToStart4               "To start Private Browsing, you can also select &newPrivateWindow.label; from the menu.">

    - The first line is a comment providing information on the localization of the text in the following line. &newPrivateWindow.label; has to be left unchanged so it can be replaced with the text of the string id &newPrivateWindow.label; whis is stored elsewhere.
  16. -
  17. Translation time: Translate the text. Afterwars, the line should look somehow like this:
    - <!ENTITY privatebrowsingpage.howToStart4               "Der private Modus kann auch über den Menü-Eintrag &newPrivateWindow.label; gestartet werden.">
  18. -
  19. Save the file.
  20. -
- -

Exportar as alterações como correção

- -

A patch is a file containing recorded changes to a repository. It can be used to apply these changes to a copy of the repository yet without these changes.

- -
    -
  1. Tell Mercurial to store the changes in the Mercurial queue with the qref command. We also create a commit message which will describe the changes in the patch and later get used when the patched gets checked in ('added') to the official repository with the localized files. For the commit message, we have to use the -m command line flag,
    - hg qref -m "Firefox 29: Localize missing string in aboutPrivateBrowsing.dtd"
    - You can change the commit message in the Mercurial queue every time by calling hg qref again.
  2. -
  3. Now export the patch to the file system using the qexport command which is defined in the .hgrc file (see above):
    - hg qexport > ../firefox-29-aboutPrivateBrowsing-v1.patch
    - This creates a patch file called firefox-29-aboutPrivateBrowsing-v1.patch containing the changes in the parent directory of de-mozilla-aurora (in this example: C:\Mozilla\).
  4. -
- -

Correção ortográfica e alterar a correção (patch)

- -

Now proof-read the patch. This detects often more than 90 percent of the possible reasons for the reviewer to not accept the patch. If you find that changes have to be done, edit the real aboutPrivateBrowsing.dtd file from the localization repository, save it and follow the steps from Exporting the changes as patch (see above).

- -

Validar a tradução no produto

- -

This guide hasn't yet a section about the validation of the translation. Please follow the instructions from the QA phase section of the Localization quick start guide.

- -

Submeter a correção (patch) para revisão

- -

Now the patch has to be shared so the people currently trusted to change the official translation can review the suggested changes.

- -
    -
  1. File a bug ("ticket") in the Mozilla Localization product and choose as component the localization for which you have translated.
  2. -
  3. Choose a meaningful bug summary which will be shown for searches etc. like in this example "Firefox 29: aboutPrivateBrowsing.dtd"
  4. -
  5. Fill any important and additional information into the description field.
  6. -
  7. Click the 'Add attachment' button.
  8. -
  9. Select the exported patch file with the file picker. The checkbox for 'patch' should get automatically checked.
  10. -
  11. Add a meaningful name for the attachment, e.g. aboutPrivateBrowsing.dtd, patch, v1
  12. -
  13. Go to the review 'Flags' category and set the one for review to ?, meaning that you request review for the patch.
  14. -
  15. In the text field next to it, add the mail address of the person leading the translation of the locale. This information can be found on the page of the localization team.
  16. -
  17. Submit the bug report.
  18. -
  19. Now you have to wait for the review of that person. This can happen on the same day, on the next weekend or later, but should happen in the timeframe given for the localization of aurora. If the person requests changes, follow the instructions under Proof-reading and altering the patch. If the reviewer accepts the changes, the patch will get uploaded and your translation will officially be added to Firefox.
  20. -
diff --git "a/files/pt-pt/mozilla/localization/guia_inicia\303\247\303\243o_r\303\241pida/configuracao_inicial/index.html" "b/files/pt-pt/mozilla/localization/guia_inicia\303\247\303\243o_r\303\241pida/configuracao_inicial/index.html" deleted file mode 100644 index abde7e440f..0000000000 --- "a/files/pt-pt/mozilla/localization/guia_inicia\303\247\303\243o_r\303\241pida/configuracao_inicial/index.html" +++ /dev/null @@ -1,81 +0,0 @@ ---- -title: Configuração Inciail -slug: Mozilla/Localization/Guia_iniciação_rápida/Configuracao_inicial -translation_of: Mozilla/Localization/Quick_start_guide/Initial_setup ---- -

Como um pré-requisito para contribuir com o programa de L10n, precisa de ter acesso aos códigos, ferramentas e um ambiente local adequadamente configurado (ou seja, o seu computador pessoal). Também precisa de determinar se já existe um esforço de localização para o seu idioma. Aqui, nós irmos ver as contas de que precisa, bem como as ferramentas e as suas configurações que precisa de configurar antes de contribuir.

- -

Nova ou existente

- -

Before anything else, you need to know if you will be creating a new localization or joining an existing one. This will determine what information is most applicable to you throughout the rest of this guide.

- -

Veja o que faz:

- -

Look through the existing localization community directory to see if one already exists for your locale.

- -
    -
  1. If a community already exists, reach out to them and ask how you can help.
  2. -
  3. If a community doesn't exist, send an email to the new-locales newsgroup for additional guidance.
  4. -
- -

Contas

- -

There are a handful of accounts that you need to be aware of as you begin. They're not required for you to begin contributing, but will be required when you are preparing to produce an official release. For now, simply be aware that these will become important as your efforts progress. These accounts will store your code, contributions, and help you produce an official localization.

- -
-
hg (Mercurial)
-
Mercurial is the revision control environment that houses the main Mozilla source code as well as localized code for each official Mozilla localization. You will need this for localizing Mozilla applications. Hg commit access is not necessary to begin localizing. After you have some experience with hg, you may want to get commit access. At that point, you must visit the Mozilla Committer page and follow the process outlined there. Here is an example bug that illustrates the process well. Use this bug template when filing your hg account registration bug. Add a request about creating your locale's repository to the new locales newsgroup.
-
SVN
-
SVN is a revision control environment that Mozilla uses to house Mozilla source websites and their localizations for each official Mozilla localization. See this wiki page about how to gain access to SVN. The SVN for Localizers guide will help you learn the most important SVN commands for l10n. Add a request about creating your locale's repository to the new locales newsgroup.
-
- -
-
Ferramentas de L10n baseadas na Web
-
We'll talk about these in a little bit. For now, just be aware that should you choose to use them, you may need to create a personal account.
-
Mozilla LDAP
-
You will need a Mozilla LDAP account once you're ready to have your localization registered on the main Mozilla repositories. Add a request about creating your LDAP account to the new locales newsgroup.
-
Componente de Bugzilla específico do local
-
Having a Bugzilla component specific to your locale will help us to track your localization's progress from first steps to official release. It will also notify us when you're having problems unique to your localization team's work. Add a request about creating your locale's Bugzilla component to the new locales newsgroup.
-
- -

Ferramentas de ambiente locais

- -

Similar to accounts, there is a number of environment tools that you should install on your personal computer. These tools will help you to store your contributions, build Mozilla applications and language packs, and test your work.

- -
-
Hg (Mercurial)
-
As noted above, we use Mercurial for maintaining Mozilla source code and localized code. Not only will you need a localization repository to store your localizations, but you need to have it installed and configured on your personal computer as well. You can find everything you need to know about installing and configuring Mercurial for your localization work here.
-
- -
-
comparar-idiomas
-
compare-locales is a Python script that helps you check your work without needing to run Firefox or another application. Install intructions are located here.
-
Verificações de L10n
-
L10n checks is another Python script that helps you check your work without running an application. Install instructions are located here.
-
autoconf 2.13
-
autoconf is a utility that is vital to manually creating Mozilla application builds and language packs. We use version 2.13 and higher for these builds. You can find the source files and install instructions here.
-
wget
-
wget is a command-line utility that allows you to retrieve files using internet protocols. We use it for retrieving files from repositories. You can find the source files and install instructions here.
-
Perl
-
Perl is a programming language that will help you create Mozilla application builds and language packs. You can find the source files and install instructions here.
-
Python
-
Python is a programming language in which many of our L10n testing scripts are written. You can find the source files and install instructions here.
-
Locale Switcher ou Quick Locale Switcher
-
Ambos o Locale Switcher e o Quick Locale Switcher são extras para as aplicações da Mozilla. Either one is necessary to enable you to see your work within a Mozilla application. You can install either by searching for them in Firefox's add-ons manager or following these links.
-
Um editor de texto sólido, baseado em Unicode
-
Here are some suggestions: - -
-
GNU make
-
Make is a tool which controls the generation of executables. You can find version 3.79.1 or higher here. Unfortunately, other varieties of make won't do.
-
- -

Fim da configuração inicial

- -

Agora que concluiu a configuração inicial, é hora da melhor parte: traduzir!

- -

{{ PreviousNext("Localization_Quick_Start_Guide", "Localization_Quick_Start_Guide/Translation_phase") }}

diff --git "a/files/pt-pt/mozilla/localization/guia_inicia\303\247\303\243o_r\303\241pida/fase_da_traducao/index.html" "b/files/pt-pt/mozilla/localization/guia_inicia\303\247\303\243o_r\303\241pida/fase_da_traducao/index.html" deleted file mode 100644 index cdb31df82a..0000000000 --- "a/files/pt-pt/mozilla/localization/guia_inicia\303\247\303\243o_r\303\241pida/fase_da_traducao/index.html" +++ /dev/null @@ -1,120 +0,0 @@ ---- -title: Fase da Tradução -slug: Mozilla/Localization/Guia_iniciação_rápida/Fase_da_Traducao -tags: - - Localização - - 'Localização: Ferramentas' - - Tradução -translation_of: Mozilla/Localization/Quick_start_guide/Translation_phase ---- -

Parabéns por completar a configuração inicial! Como recompensa pelos seus esforços, você começa a pensar no motivo pelo qual veio até aqui: localizar projetos da Mozilla.

- -

É onde o aspeto técnico do processo começa a dividir-se. Na Mozilla, nós localizamos muitos projetos diferentes que podem ser categorizados em três grupos diferentes. Cada grupo de projetos emprega um tipo diferente de ferramenta l10n para, você adivinhou, localizar os projetos. As ferramentas do l10n destinam-se a ajudá-lo a manter o seu conteúdo localizado de lançamento a lançamento e aproveitar os materiais já localizados quando localiza novo conteúdo.

- -

Aqui, nos iremo identificar esses grupos de projetos e as ferramentas de l10n associadas com os mesmo. Ao longo do caminho, nós iremos direcioná-lo para os tutoriais técnicos básicos sobre a localização desse grupo específico de projetos. Cabe a si, e à sua comunidade determinar qual a ferramenta de l10n corresponderá melhor às suas necessidades. À medida que ganha mais experiência, talvez queira localizar independentemente das ferramentas de l10n desenvolvidas pela Mozilla, que nós também discutiremos aqui.

- -

Projetos

- -

Os projetos da Mozilla e os ritmos de trabalho de l10n são divididos nestes grupos: aplicações da Mozilla, sites da Web da Mozilla, e Extras. Em baixo, irá encontrar a lista de todos os projetos da Mozilla, as suas ferramentas de l10n associadas, e hiperligações para tutoriais descrevendo os seus ritmos de trabalho.

- -

Aplicações da Mozilla

- -

So you're interested in localizing Mozilla applications. Each l10n tool follows a different workflow for localizing Mozilla application projects. We've linked a brief tutorial to each l10n tool name below. Follow the tutorials to help you decide which l10n tool fits your specific needs.

- -

These are the l10n tools we use to localize Mozilla applications:

- -
-
Pootle
-
A user-friendly web portal built on the Translate Toolkit API. This tool includes workspaces for translating strings, reviewing string submissions, and project dashboards. See the instance of Pootle used to localize Mozilla applications.
-
- -
-
Koala
-
A l10n add-on for the offline, stand-alone Komodo Edit text editor.
-
Mozilla Translator
-
Am offline, stand-alone, Java-based l10n tool that helps you translate and integrates with your repositories. Visit the Mozilla Translator (MT) download page to get your own MT client. Version 5.26 is the latest version.
-
Virtaal
-
An offline, stand-alone version of Pootle that is also built on the Translate Toolkit API.
-
- -

These are the Mozilla application projects that are localized using the l10n tools above:

- -
-
Firefox
-
The award-winning Firefox® Web browser has security, speed and new features that will change the way you use the Web. See the list of the most critical strings for localizing in Firefox, as well as a guide to understanding how they're organized.
-
Thunderbird
-
Enjoy safe, fast and easy email, Mozilla-style. The Thunderbird® email client includes intelligent spam filters, powerful search and customizable views.
-
Seamonkey
-
SeaMonkey® is the all-in-one application formerly known as the "Mozilla Application Suite", containing a web browser, a mail and newsgroups client, an HTML editor, web development tools, and an IRC chat client.
-
Firefox Mobile
-
By adding Firefox® to your mobile phone, you can access rich Web content and enjoy your favorite Firefox features wherever you go.
-
Lightning
-
Lightning is a popular calendaring, scheduling and task management extension.
-
- -

If your locale has an hg repository hosted on the Mozilla servers, you can track your localization's current progress by visiting the l10n dashboards.

- -
-

Nota: se estiver a iniciar uma nova localização e decidir utilizar uma ferramenta off-line para localizar aplicações da Mozilla, terá que familiarizar-se com a utilização de Mercurial (hg). Visite o tutorial sobre como utilizar "hg" nos seus esforços de localização aqui.

-
- -

Sites da Web da Mozilla

- -

So you're interested in localizing Mozilla websites. Each l10n tool follows a different workflow for localizing Mozilla web projects. We've linked a brief tutorial to each l10n tool name below. Follow the tutorials to help you decide which l10n tool fits your specific needs.

- -

These are the l10n tools we use to localize Mozilla web projects:

- -
-
Pontoon
-
A web-based, What-You-See-Is-What-You-Get (WYSIWYG) l10n tool that allows you to localize Mozilla websites within the site itself. Visit Pontoon here. Please note the Pontoon is not available for all web projects yet.
-
- -

These are the Mozilla web projects that are localized using the l10n tools above:

- -
-
mozilla.org
-
Every user's first Mozilla experience.
-
addons.mozilla.org (AMO)
-
A portal for all users interested in finding add-ons for their local Mozilla applications. Read the guidelines on localizing AMO, straight from the AMO team.
-
developer.mozilla.org (MDN)
-
Where you are now! Help localize the MDN user interface for everyone in your region.
-
support.mozilla.com (SUMO)
-
A portal for anyone who needs technical support for their Mozilla applications. Help localize the SUMO user interface for everyone in your region.
-
Mozilla Engagement Campaigns
-
Individual campaigns created by Mozilla to attract new contributors.
-
hacks.mozilla.org
-
For everyone interested in the leading-edge stuff that people are doing with Mozilla Firefox and the open web.
-
In-product pages
-
A set of pages used to interact with and give information to the end-user as part of their first experience with their Mozilla applications.
-
- -

Se está a criar a sua própria localização, existem vários sites da Web da Mozilla que precisam de ser localizados antes que os seus esforços se tornem numa localização lançada oficialmente. Consulte a lista de sites da Web localizados da Mozilla.

- -

Também deveria ler mais informação sobre a localização de projetos da web da Mozilla.

- -
-
 
-
- -

Extras (Add-ons)

- -

l10n for add-ons is handled by at least two other organizations/services called Babelzilla and Adofex. They both have created comprehensive programs and l10n tools for localizing any and all third-party add-ons for Mozilla applications. Visit their websites to learn how to get involved.

- - - -

Ferramenta de localização independente

- -

Are you a command-line master? Do you prefer Unicode text editors to any other applications on Earth? Do you have a pet CAT (computer-assisted translation) tool, like OmegaT? Then you may not be interested in using any of the tools listed above for your localizations. If that is the case, then this section is for you!

- -

For localizers who prefer localizing without a specialized tool the workflows for localizing Mozilla applications and Mozilla websites are essentially the same. This tutorial should provide you with all of the technical information you need to secure and maintain your tool independence.

- -

Produtibilidade

- -

Productization is an essential part of localizing Mozilla products. This is where you research and select the search plugins, content and protocol handlers, bookmarks, and links to recommended sites on the in-product pages that your locale's users will find in their Mozilla products.

- -

This tutorial will walk you through performing these productization tasks, creating productization patches, and submitting them for review.

- -

{{ PreviousNext("Localization_Quick_Start_Guide/Initial_setup", "Localization_Quick_Start_Guide/QA_phase") }}

diff --git "a/files/pt-pt/mozilla/localization/guia_inicia\303\247\303\243o_r\303\241pida/fase_de_lancamento/index.html" "b/files/pt-pt/mozilla/localization/guia_inicia\303\247\303\243o_r\303\241pida/fase_de_lancamento/index.html" deleted file mode 100644 index 310ec4344e..0000000000 --- "a/files/pt-pt/mozilla/localization/guia_inicia\303\247\303\243o_r\303\241pida/fase_de_lancamento/index.html" +++ /dev/null @@ -1,177 +0,0 @@ ---- -title: Fase de Lançamento -slug: Mozilla/Localization/Guia_iniciação_rápida/Fase_de_lancamento -translation_of: Mozilla/Localization/Quick_start_guide/Release_phase ---- -

Você conseguiu! Configurou os seus ambientes locais e remotos, selecionou as suas ferramentas e projetos de L10n, efetuou algumas traduções e até mesmo alguns testes! Agora está pronto para a fase final: ser parte de um lançamento oficial da L10n. Aqui, nós continuaremos a ser fiéis à intenção original deste guia e apresentaremos apenas a informação técnica necessária para se tornar num lançamento oficial. Nós vamos concentrar-nos principalmente em obter a configuração do seu repositório de lançamento e comandos do Mercurial que precisa de saber para utilizar este repositório.

- -

Para obter mais informação sobre a parte de lançamento do processo L10n, visite o site da wiki da Mozilla aqui.

- -

O seu repositório oficial de lançamentos

- -

Now that your locale has been registered, the localization files will live on Mozilla Mercurial server at hg.mozilla.org. Depending on which branch you work on, the URL of your repository might look like this:

- -
http://hg.mozilla.org/releases/l10n-central/x-testing
-
- -

If you followed the Koala or plain text approach, you probably already have a local clone of the repository. Otherwise, in order to be able to make any changes to the localization files, you will need to clone the repository on your local machine and work in the local clone.

- -

There are two different protocols you can use to connet with your Mercurial repository: HTTP and SSH. Be advised that there's an important distinction between them. You can pull using both, but you can only push through SSH. Consequently, if you already have a local clone that you pulled using HTTP, you'll need to modify a config file to tell Mercurial to push through SSH. Let's go over configuring your connection protocols.

- -

Configuração

- -

Before you try pushing, you need to tell SSH which username you wish to use for connecting with hg.mozilla.org. This should be your Mozilla LDAP account name.

- -
    -
  1. Add the following lines to your ~/.ssh/config file, replacing user@host.domain with your Mozilla LDAP account name:
  2. -
- -
Host hg.mozilla.org
-User user@host.domain
- -
    -
  1. If you have already cloned the remote repository using the HTTP protocol using this command: $ hg clone http://hg.mozilla.org/releases/l10n-central/x-testing then you will need to edit the .hg/hgrc file (inside the x-testing local clone) to tell Mercurial to push using SSH. Your .hg/hgrc file shoud look like this (add the emphasized line):
  2. -
- -
[paths]
-default = hg.mozilla.org/releases/l10n-central/x-testing
-default-push = ssh://hg.mozilla.org/releases/l10n-central/x-testing
-
- -
    -
  1. If you haven't already cloned the remote repository, enter this command: hg clone ssh://hg.mozilla.org/releases/l10n-central/x-testing
  2. -
- -

Mercurial will let you know that it's cloning the repository:

- -
destination directory: x-testing
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 242 changes to 239 files
-updating to branch default
-239 files updated, 0 files merged, 0 files removed, 0 files unresolved
-
- -

The default push URL is the same as the default pull URL (i.e., ssh://hg.mozilla.org/releases/l10n-central/x-testing).

- -

You should now be able to push to the remote repository!

- -

Commit, outgoing, and push

- -

You should try to commit your work regularly as you progress through the localization files. Keep in mind that the hg commit command will save your changes locally (in the local clone). With the hg push command you can send the changesets to the remote server. Here's how that's done:

- -
    -
  1. Run this command to see recent commits in your local clone: $ hg log -l 3
  2. -
- -

You should a list of the most recent commits, similar to this one:

- -
changeset:   0:7c543e8f3a6a
-tag:         tip
-user:        Your Name <email@example.com>
-date:        Mon Nov 23 18:08:25 2009 +0100
-summary:     Added search bar strings
-
- -
    -
  1. Now run the hg outgoing command to compare the local repository on your machine with the remote repository on hg.mozilla.org.
  2. -
- -

The hg outgoing command compares the two repositories and lists all changesets that are present locally, but not in the remote repository. These changesets will need to be pushed to the remote repository. The output will look something like this:

- -
comparing with ssh://hg.mozilla.org/releases/l10n-central/x-testing
-searching for changes
-
-changeset:   0:7c543e8f3a6a
-tag:         tip
-user:        Your Name <email@example.com>
-date:        Mon Nov 23 18:08:25 2009 +0100
-summary:     Added search bar strings
-
- -
    -
  1. Make sure this output is accurate before continuing.
  2. -
  3. Once you've made sure the outgoing output is accurate, push this changeset to hg.mozilla.org by running the hg push command.
  4. -
- -

Mercurial will connect to the remote repository, authenticate through SSH and send the changesets. The output should look something like this:

- -
pushing to ssh://hg.mozilla.org/releases/l10n-central/x-testing
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-
- -

Congratulations! Your changeset has been successfully pushed to hg.mozilla.org! You can now visit http://hg.mozilla.org/releases/l10n-central/x-testing in your browser to see the new changeset in the remote repository.

- -

Resolução de problemas de SSH

- -

If pushing fails, make sure your ~/.ssh/config has the correct User set under the hg.mozilla.org host. This should be your Mozilla LDAP account name. Next, try issuing the following command: $ ssh hg.mozilla.org

- -

If SSH is working fine, you should see the following message:

- -
No interactive shells allowed here!
-Connection to hg.mozilla.org closed.
-
- -

If you don't see this message, try running the same command in a more verbose mode (with the debugging information): $ ssh -vvv hg.mozilla.org

- -

This should tell you why your connection is not succeeding. If you can't figure it out on your own, copy the output of the above command, paste it on http://pastebin.mozilla.org and ask in #l10n on the irc.mozilla.org server.

- -

Revisões técnicas e assinadas

- -

You've done some localization work and your ready for it to be released. The merge date for migrating from one product release channel to the next is rapidly approaching. You need to make sure that your work can effectively be compiled into a build for the next release channel. Do you know whether to ask for technical review of your work or a sign-off review? Do you know what what exactly is reviewed in each process? Technical and sign-off reviews apply to different localizations in different ways. Here's the basic difference between the two.

- - - - - - - - - - - - - - -
Revisão TécnicaRevisão Assinada
-
    -
  • Performed as a QA measure on a revision pushed to a new locale's L10n aurora repo in Mercurial.
  • -
  • Very comprehensive. Covers the entire product.
  • -
  • Focus is on technical accuracy and completion of L10n work; not translation quality.
  • -
  • Only performed on the first revision a new locale wants to have released to the public.
  • -
  • Must be approved prior to migrating your revision from one release channel to the next (e.g., Aurora to Beta).
  • -
-
-
    -
  • Performed as a QA measure for maintaining a localization from release-to-release.
  • -
  • Only new L10n work is evaluated. This is done by generating a diff between the new release revision being considered and the previously approved release revision.
  • -
  • Focus is still on technical accuracy and completion of L10n work; not translation quality.
  • -
  • Release revisions are evaluated, not entire L10n repos.
  • -
  • Sign-offs do not need to be approved before revision merge between release channels, although it is recommended.
  • -
-
- -

There is a specific process to follow in Bugzilla for requesting these reviews:technical review.png

- -
    -
  1. File a bug requesting the review.
  2. -
  3. Attach your files to the bug. Once attached, open the attachment details.
  4. -
  5. In the attachment details, select the ? from the dropdown menu next to the review flag or the appropriate approval flags (see image). This will display a text box to assign the review to someone.
  6. -
  7. Enter :Pike as the Requestee.
  8. -
- -

We will perform a technical review of your work and provide you with feedback. We're happy to work with you to make sure that your work is fully functional.

- -

For more detailed information about reviews for new localizations and sign-offs for maintenance releases, visit the technical review and sign-off review pages.

- -

Tah dah!

- -

Mais uma vez, parabéns! Chegou ao final! Sinta-se à vontade para voltar a este tutorial sempre que necessário. Nós estamos felizes em o ter como um novo colaborador da Mozilla L10n e nós esperamos trabalhar de perto consigo.

- -

{{ Previous("Localization_Quick_Start_Guide/QA_phase") }}

diff --git "a/files/pt-pt/mozilla/localization/guia_inicia\303\247\303\243o_r\303\241pida/fase_pr/index.html" "b/files/pt-pt/mozilla/localization/guia_inicia\303\247\303\243o_r\303\241pida/fase_pr/index.html" deleted file mode 100644 index 48e5d343d5..0000000000 --- "a/files/pt-pt/mozilla/localization/guia_inicia\303\247\303\243o_r\303\241pida/fase_pr/index.html" +++ /dev/null @@ -1,212 +0,0 @@ ---- -title: Fase de PR -slug: Mozilla/Localization/Guia_iniciação_rápida/Fase_PR -tags: - - Localização -translation_of: Mozilla/Localization/Quick_start_guide/QA_phase ---- -

Depois de todo o trabalho duro de localização, nós temos a certeza de que não quer ver apenas o seu trabalho, mas quer ter a certeza de que está preciso! Se não tem muita experiência com código, pode até preocupar-se que tenha efetuado algo de errado (Ups!). Nós agora vamos orientá-lo na realização de alguns testes de garantia de qualidade no seu trabalho para garantir que esteja no caminho certo.

- -

If you're localizing Mozilla websites, your work will display soon after you've committed it without needing a language pack. Since such is the case, this part of the guide may not be entirely applicable to you. Feel free to skip ahead to the next section by clicking on the Next link at the bottom of the page.

- -

In order to see your work on Firefox (or another Mozilla application), you'll need to have a built language pack to install on your local instance.

- -

Criações automatizadas e manual

- -

With the click of a button, some L10n tools (like Narro and Koala) automatically create language pack builds for you. If you're using one of these tools, feel free to skip ahead to the Seeing your work section. If you're not using one of these tools, let's walk you through building your own language pack manually.

- -
Nota: Remember all of those pre-requisite tools we asked you to install in the initial setup? Here's where you'll need almost all of them. If you haven't installed them yet, now is the time to do it.
- -

Instruções preliminares

- -

We will be using the following file directories for this example:

- -
your working directory (root)/
-    mozilla-aurora (en-US source, pulled from http://hg.mozilla.org/releases/mozilla-aurora  )/
-    l10n-central (directory for L10n directories, one per L10n; often referred to as "l10n base")/
-       your-locale-code (a directory with your L10n files, in this example we'll use x-testing)
-
-Example: root/mozilla-aurora & root/l10n-central/x-testing
-
- -

Additionally, you will need to copy and translate the toolkit/defines.inc file directly from en-US before you can build. This is due to a bug in the build logic.

- -

Please either follow the above structure closely or adjust the commands below according to your custom setup.

- -

To copy this file to the appropriate directory, do the following:

- -
    -
  1. Navigate to your working directory from your command-line terminal (i.e., where you created the folder structure described above).
  2. -
  3. Enter the following commands:
  4. -
- -
mkdir -p l10n-central/x-testing/toolkit/
-
-cp mozilla-aurora/toolkit/locales/en-US/defines.inc l10n-central/x-testing/toolkit/defines.inc
-
- -

Tah-dah! Copied!

- -

Finally, you will need a file called .mozconfig to proceed with manual builds. This file contains the necessary build instructions.

- -

To create and configure this file, follow these instructions:

- -
-

Until the fix for bug 1063880 lands on mozilla-aurora and mozilla-beta when building language packs against those two trees you should:

- -
    -
  1. -

    remove ac_add_options --disable-compile-environment from .mozconfig in step 3

    -
  2. -
  3. -

    use ./mach build config after step 4

    -
  4. -
-
- -
    -
  1. Update the Mozilla source code:
  2. -
- -

$ cd mozilla-aurora
- $ hg pull -u

- -
    -
  1. Enter the following command to create the .mozconfig file: $ nano -w .mozconfig
  2. -
  3. Enter the following lines in your .mozconfig file:
  4. -
- -
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../firefox-build
-ac_add_options --disable-compile-environment
-ac_add_options --with-l10n-base=../l10n-central # path relative to MOZ_OBJDIR
-ac_add_options --enable-application=[browser or mail]
-
- -

You will need to specify which application you're localizing in the fourth line (e.g., for Firefox, that's browser, Thunderbird would be mail).

- -
    -
  1. Enter the following command to perform the configuration: $ ./mach configure
  2. -
  3. Once your command-line finishes spitting out the config command's output, navigate to the newly created directory: $ cd ../firefox-build/browser/locales
  4. -
- -

Now you're ready to build! At this point you can choose between two build options. You can either:

- - - -

Visit the links above to learn how to make these testing builds.

- -

Testar a sua L10n e ver o seu trabalho

- -

Now that you have your langpack or L10n repack, let's discuss seeing your work and testing it in the application.

- -

Testing the langpack will put you one step closer to having your localization added to the L10n releases. Follow the steps below to test your localization:

- -
    -
  1. Install Aurora in your preferred language.
  2. -
  3. Install the .xpi langpack you just created (or exported).
  4. -
  5. Set your language using the Quick Locale Switcher or Locale Switcher add-ons by navigating to Tools->Language->Your localization's language code.
  6. -
  7. Restart your browser and start testing!
  8. -
- -

Now you should be able to see all of your work up to this point. Click here for guidelines on how to test your localization.

- -

Não perca o seu trabalho!

- -

Your work is SO important! We would really hate to see you lose any of it. After you test your localization, you should send it to a remote repository, which will serve as a backup for your work and will let others follow your progress. We're going to go through the process below.

- -

The official localization teams use repositories at hg.mozilla.org. Before a team becomes official, we like to get the localizers comfortable with the Hg commands that allow for cloning, pulling, committing, and pushing work to an experimental repository.  We use a web service called Bit Bucket to start the learning process.

- -
Nota: You must have Mercurial configured before you begin. That step is back on the initial setup page. If you haven't done that yet, don't worry, we'll wait for you!
- -

Envio (Pushing) para o seu repositório

- -

There are a couple of things you should take note of before you push to your repository:

- - - -

The instructions below will help you learn how to use your Hg repository.

- -
    -
  1. After your new repository is created by the l10n-drivers, please visit the URL for your repo. We'll use x-testing here for our example. You can do this by entering the following URL into your browser: http://hg.mozilla.org/l10n-central/x-testing
  2. -
  3. Now, navigate to your locale's directory on your local machine.
  4. -
- -

If you're using Koala, this should be located at /path/to/your/koala.project/locale/3.6/x-testing, otherwise, it should be located at /path/to/your/working_dir/l10n_base/x-testing.

- -

In this directory, you should have an hg repository. You might have created it yourself by running hg init or hg clone or you might have had it created by Koala when you were setting up a new localization project. Also at this point, you shouldn't have any uncommitted changes (i.e., running the hg status command should show nothing). Let's see what the last revision in this repository is.

- -
    -
  1. Enter the following command: $ hg log -l 1
  2. -
- -

You should see an output similar to the one below:

- -
changeset:   0:7c543e8f3a6a
-tag:         tip
-user:        Your Name <email@example.com>
-date:        Mon Nov 23 18:08:25 2009 +0100
-summary:     Added search bar strings
-
- -
    -
  1. Now compare the local repository on your machine with the remote Hg repository by entering this command: $ hg outgoing http://hg.mozilla.org/l10n-central/x-testing
  2. -
- -

The hg outgoing command compares the two repositories and lists all changesets that are present locally, but not in the remote repository. These changesets will need to be "pushed" to the remote repository. You can expect to see output like this:

- -
comparing with http://hg.mozilla.org/l10n-central/x-testing
-searching for changes
-
-changeset:   0:7c543e8f3a6a
-tag:         tip
-user:        Your Name <email@example.com>
-date:        Mon Nov 23 18:08:25 2009 +0100
-summary:     Added search bar strings
-
- -
    -
  1. Let's now push this changeset. Enter the following command: hg push http://hg.mozilla.org/l10n-central/x-testing
  2. -
  3. Mercurial will connect to your repo and ask you to provide your account information (i.e., the username and the password).
  4. -
- -
real URL is http://hg.mozilla.org/l10n-central/x-testing
-pushing to http://hg.mozilla.org/l10n-central/x-testing
-searching for changes
-http authorization required
-realm: hg.mozilla.org HTTP
-user: your_id
-password:
-
- -

After you enter your account information, the changeset will be pushed.

- -
adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-bb/acl: your_id is allowed. accepted payload.
-quota: 979.7 KB in use, 150.0 MB available (0.64% used)
-
- -

Your changeset has been successfully pushed to your repository!

- -

As you begin to move through your translations, you should commit the changes locally and push your work to this experimental repository. For instance, if you have finished translating all the .dtd and .properties files in your x-testing/browser/chrome/browser/ directory, then you should run these commands:

- -
$ hg status
-$ hg commit -m "Translated browser/chrome/browser/"
-$ hg outgoing
-$ hg push http://hg.mozilla.org/l10n-central/x-testing
- -

Note that due to the distributed nature of Hg, hg commit saves the changes locally (i.e., in your computer's Hg repository). You can see the history of commits with hg log. After doing hg commit, you still need to send the changes to the remote repository. This is where hg push comes in. This sends your commits to the remote repository.

- -

Now you're ready to proceed to the release phase!

- -

 

- -

{{ PreviousNext("Localization_Quick_Start_Guide/Translation_phase", "Localization_Quick_Start_Guide/Release_phase") }}

diff --git "a/files/pt-pt/mozilla/localization/guia_inicia\303\247\303\243o_r\303\241pida/index.html" "b/files/pt-pt/mozilla/localization/guia_inicia\303\247\303\243o_r\303\241pida/index.html" deleted file mode 100644 index 7135cec329..0000000000 --- "a/files/pt-pt/mozilla/localization/guia_inicia\303\247\303\243o_r\303\241pida/index.html" +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: Guia de Iniciação Rápida da Localização -slug: Mozilla/Localization/Guia_iniciação_rápida -tags: - - Guía - - Tradução -translation_of: Mozilla/Localization/Quick_start_guide ---- -

Bem-vindo à localização da Mozilla (abreviado em inglês L10n)!

- -

Se está aqui para iniciar a sua própria localização no projeto Mozilla ou para se juntar aos esforços de uma localização existente, veio ao lugar certo. Este guia é preenchido com todas as informações técnicas básicas que precisa para se envolver no programa Mozilla l10n. Nós iremos guiá-lo através dos passos para começar, desde a configuração inicial do ambiente até ao teste e lançamento da sua própria localização. Ao longo do caminho, irá aprender sobre a variedade de projetos para os quais pode contribuir e as ferramentas utilizadas para localizá-los.

- -

Quando alcamçamos exemplos específicos, nós iremos removê-los do projeto Firefox, já que é o projeto mais amplamente localizado dentro da Mozilla. Ao aproximar-se do final deste guia, poderá fazer uma alteração no Firefox na sua configuração local e, depois ver essa alteração na interface do Firefox. Para encerrar, quando terminar este guia, terá todas as ferramentas necessárias para começar a contribuir!

- -

Lembre-se, este guia irá instruí-lo apenas sobre os aspetos técnicos de L10n da Mozilla. Visite a página do Processo de L10n para saber mais sobre todo o processo.

- -
-

Configuração Inicial

-Preparação da tecnologia antes de localizar.
- -
-

Fase da tradução

-Tutoriais das ferramentas de L10n para tradução.
- -
-

Fase de PR

-Tutoriais de teste de L10n.
- -
-

Fase de Lançamento

-Passos para submeter o seu trabalho de tradução.
- -
Esses quatro estágios formam o lado técnico do programa de l10n. Para saber mais sobre qualquer um deles, clique em quaisquer das hiperligações acima. Para obter uma visão geral, nós sugerimos que comece com a bolha verde e mova de um estágio para outro.
- -

 

- -
Nota: este guia foi escrito para dois tipos de colaboradores: os que iniciam uma nova localização e os que se juntam a uma localização existente. É importante saber que informação se aplica ao tipo de colaborador. Para ajudá-lo a filtrar a informação mais aplicável, note que toda a informação que é única das que iniciam uma nova localização estarão com letra em cor de laranja. Toda a informação que é única para aqueles que se juntam a uma localização existente estará em letra azul.
- -

 

- -

{{ Next("Localization_Quick_Start_Guide/Initial_setup") }}

diff --git a/files/pt-pt/mozilla/localization/index.html b/files/pt-pt/mozilla/localization/index.html deleted file mode 100644 index 049ddf8e95..0000000000 --- a/files/pt-pt/mozilla/localization/index.html +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: Localização na Mozilla -slug: Mozilla/Localization -tags: - - Landing - - Localização - - Mozilla - - Tradução - - l10n -translation_of: Mozilla/Localization ---- -

Localização (L10n) é o processo de tradução das interfaces do utilizador do software de um idioma para outro e a adaptação para o ajustar a uma cultura estrangeira. Estes recursos são para qualquer um com interesse nos aspetos técnicos involvidos na localização. Estes são para os responsáveis pelo desenvolvimento e todos os colaboradores.

- -

Consultar também

- -
-
Localizar MDN
-
Este recurso abrange a localização da documentação aqui na MDN.
-
Localização de aplicação
-
Este conjunto de documentos aplica-se mais especificamente à localização de aplicações, incluindo as aplicações do Firefox OS.
-
L10n
-
Documentos de referência para a API de L10n que a Mozilla utilzia para localizar o sistema operativo Firefox.
-
diff --git a/files/pt-pt/mozilla/localization/index/index.html b/files/pt-pt/mozilla/localization/index/index.html deleted file mode 100644 index 3b35d9f58b..0000000000 --- a/files/pt-pt/mozilla/localization/index/index.html +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Índex -slug: Mozilla/Localization/Index -tags: - - Localização - - Tradução -translation_of: Mozilla/Localization/Index ---- -

{{Index("/pt-PT/docs/Mozilla/Localization")}}

diff --git a/files/pt-pt/mozilla/localization/localizacao_e_plurais/index.html b/files/pt-pt/mozilla/localization/localizacao_e_plurais/index.html deleted file mode 100644 index 207f94128f..0000000000 --- a/files/pt-pt/mozilla/localization/localizacao_e_plurais/index.html +++ /dev/null @@ -1,384 +0,0 @@ ---- -title: Tradução e Plurais -slug: Mozilla/Localization/Localizacao_e_Plurais -tags: - - Internacionalização - - Localização - - Tradução -translation_of: Mozilla/Localization/Localization_and_Plurals ---- -

Provavelmente está aqui porque está a traduzir um ficheiro .properties e este tinha uma hiperligação para esta página. Esta página é para ajudar a explicar como localizar essas entradas de carateres para que a forma correta do plural seja mostrada ao utilizador. Por exemplo, "1 página" vs. "2 páginas".

- -

Se está aqui para criar o seu código (por exemplo, extensões) localizável para as formas de plural, pode ir diretamente para Programar com PluralForm. Também poderá ter que localizar as entradas iniciais para o seu código, por isso também seria bom que lê-se pelo menos a secção 'Utilização'.

- -

Utilização

- -

Aqui tem alguns termos utilizados nesta página para o ajudar a manter as coisas simples:

- - - -

If you're here for pluralRule in the chrome/global/intl.properties file, you'll need to figure out what plural rule to choose for your localization. This plural rule is used to determine how many plural forms are needed for each word that needs to be localized, with plurals in mind.

- -

For all other properties files that link to this page, you'll need to provide enough plural forms of the desired word, and separate them with semi-colons (;). If you don't know how many plural forms you need, check the pluralRule number in chrome/global/intl.properties, and look up the corresponding entry in the following list of plural rules.

- -

Lista das Regras de Plural

- -

Esta secção contém uma lista de regras plurais ordenadas pelo seu número de regra de plural. Cada entrada indica quantas formas de plural são necessárias ao localizar uma palavra. Para cada entrada, há uma lista de famílias e idiomas nessas famílias, para ajudá-lo a descobrir se é a regra que deve escolher para pluralRule. Além disso, há uma breve descrição de cada forma de plural, seguida por alguns números de amostra que se enquadram nessa forma específica.

- -

For a given plural rule, the order in which the plural forms are listed is the same order you need to localize a word, separated by semi-colons. For example, English uses plural rule 1, and localizing plurals would require a string of "plural;plurals" where the first word is the singular form and the second is the general plural form.

- -

Regra de plural #0 (1 forma)

- -

Famílias: Asiáticas (chinês, japonês, coreano), persa, turco/altaico (turco), Thai, Lao
- tudo: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, …

- -

Regra de plural #1 (2 formas)

- -

Famílias: Germânico (dinarmaquês, holandês, inglês, Faroese, Frisian, alemão, norueguês, sueco ), Finno-Ugric (Estonian, Finnish, Hungarian), Language isolate (Basque), Latin/Greek (Greek), Semitic (Hebrew), Românico (italiano, português, espanhol, catalão), e vietnamita
- é 1: 1
- tudo o resto: 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, …

- -

Regra de plural #2 (2 formas)

- -

Famílias: Românico (francês, português (Brasil)), Lingala
- é 0 ou 1: 0, 1
- tudo o resto: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, …

- -

Regra de plural #3 (3 formas)

- -

Famílias: Baltic (Latvian, Latgalian)
- termina em 0: 0
- termina em 1, excluindo 11: 1, 21, 31, 41, 51, 61, 71, 81, 91, 101, 121, 131, 141, 151, 161, 171, 181, 191, 201, 221, 231, 241, 251, 261, 271, 281, 291, …
- tudo o resto: 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22, 23, 24, 25, 26, 27, 28, 29, 32, 33, 34, 35, 36, 37, 38, 39, 42, 43, 44, 45, 46, 47, 48, 49, 52, 53, …

- -

Regra de plural #4 (4 formas)

- -

Famílias: Celtic (Scottish Gaelic)
- é 1 ou 11: 1, 11
- é 2 ou 12: 2, 12
- is 3-10 ou 13-19: 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15, 16, 17, 18, 19
- tudo o resto: 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, …

- -

Regra de plural #5 (3 formas)

- -

Famílias: Romanic (Romanian)
- é 1: 1
- é 0 ou termina em 01-19, excluindo 1: 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, …
- tudo o resto: 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, …

- -

Regra de plural #6 (3 formas)

- -

Famílias: Baltic (Lithuanian)
- termina em 1, excluindo 11: 1, 21, 31, 41, 51, 61, 71, 81, 91, 101, 121, 131, 141, 151, 161, 171, 181, 191, 201, 221, 231, 241, 251, 261, 271, 281, 291, …
- termina em 0 ou termina em 11-19: 0, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, …
- tudo o resto: 2, 3, 4, 5, 6, 7, 8, 9, 22, 23, 24, 25, 26, 27, 28, 29, 32, 33, 34, 35, 36, 37, 38, 39, 42, 43, 44, 45, 46, 47, 48, 49, 52, 53, 54, 55, 56, 57, 58, 59, 62, 63, 64, 65, 66, 67, 68, 69, 72, 73, …

- -

Regra de plural #7 (3 formas)

- -

Famílias: Belarusian, Russian, Ukrainian
- termina em 1, excluindo 11: 1, 21, 31, 41, 51, 61, 71, 81, 91, 101, 121, 131, 141, 151, 161, 171, 181, 191, 201, 221, 231, 241, 251, 261, 271, 281, 291, …
- termina em 2-4, excluindo 12-14: 2, 3, 4, 22, 23, 24, 32, 33, 34, 42, 43, 44, 52, 53, 54, 62, 63, 64, 72, 73, 74, 82, 83, 84, 92, 93, 94, 102, 103, 104, 122, 123, 124, 132, 133, 134, 142, 143, 144, 152, 153, 154, 162, 163, 164, 172, 173, 174, 182, 183, …
- tudo o resto: 0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 26, 27, 28, 29, 30, 35, 36, 37, 38, 39, 40, 45, 46, 47, 48, 49, 50, 55, 56, 57, 58, 59, 60, 65, 66, 67, 68, 69, 70, 75, 76, 77, …, 112, 113, ..., 212, 213, ...

- -

Regra de plural #8 (3 formas)

- -

Famílias: Eslavo (eslovaco, checo)
- é 1: 1
- é 2-4: 2, 3, 4
- tudo o resto: 0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, …

- -

Regra de plural #9 (3 formas)

- -

Famílias: Eslavo (polaco)
- é 1: 1
- termina em 2-4, excluindo 12-14: 2, 3, 4, 22, 23, 24, 32, 33, 34, 42, 43, 44, 52, 53, 54, 62, 63, 64, 72, 73, 74, 82, 83, 84, 92, 93, 94, 102, 103, 104, 122, 123, 124, 132, 133, 134, 142, 143, 144, 152, 153, 154, 162, 163, 164, 172, 173, 174, 182, 183, …
- tudo o resto: 0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 25, 26, 27, 28, 29, 30, 31, 35, 36, 37, 38, 39, 40, 41, 45, 46, 47, 48, 49, 50, 51, 55, 56, 57, 58, 59, 60, 61, 65, 66, 67, 68, …

- -

Plural rule #10 (4 forms)

- -

Famílias: Eslavo (esloveno, sérbio)
- termina em 01: 1, 101, 201, …
- termina em 02: 2, 102, 202, …
- termina em 03-04: 3, 4, 103, 104, 203, 204, …
- tudo o resto: 0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, …

- -

Plural rule #11 (5 forms)

- -

Famílias: Celtic (Irish Gaelic)
- é 1: 1
- é 2: 2
- is 3-6: 3, 4, 5, 6
- is 7-10: 7, 8, 9, 10
- tudo o resto: 0, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, …

- -

Plural rule #12 (6 forms)

- -

Famílias: Semitic (Arabic)
- é 1: 1
- é 2: 2
- termina em 03-10: 3, 4, 5, 6, 7, 8, 9, 10, 103, 104, 105, 106, 107, 108, 109, 110, 203, 204, 205, 206, 207, 208, 209, 210,
- tudo o resto but é 0 and termina em 00-02, excluding 0-2: 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, …
- termina em 00-02, excluding 0-2: 100, 101, 102, 200, 201, 202, …
- é 0: 0

- -

Plural rule #13 (4 forms)

- -

Famílias: Semitic (Maltese)
- é 1: 1
- é 0 ou termina em 01-10, excluindo 1: 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, …
- termina em 11-19: 11, 12, 13, 14, 15, 16, 17, 18, 19, 111, 112, 113, 114, 115, 116, 117, 118, 119, 211, 212, 213, 214, 215, 216, 217, 218, 219, …
- tudo o resto: 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, …

- -

Plural rule #14 (3 forms)

- -

Famílias: unused
- ends in 1: 1, 11, 21, 31, 41, 51, 61, 71, 81, 91, 101, 111, 121, 131, 141, 151, 161, 171, 181, 191, 201, 211, 221, 231, 241, 251, 261, 271, 281, 291, …
- ends in 2: 2, 12, 22, 32, 42, 52, 62, 72, 82, 92, 102, 112, 122, 132, 142, 152, 162, 172, 182, 192, 202, 212, 222, 232, 242, 252, 262, 272, 282, 292, …
- tudo o resto: 0, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15, 16, 17, 18, 19, 20, 23, 24, 25, 26, 27, 28, 29, 30, 33, 34, 35, 36, 37, 38, 39, 40, 43, 44, 45, 46, 47, 48, 49, 50, 53, 54, 55, 56, 57, 58, 59, 60, 63, …

- -

Plural rule #15 (2 forms)

- -

Famílias: Icelandic, Macedonian
- termina em 1, excluindo 11: 1, 21, 31, 41, 51, 61, 71, 81, 91, 101, 121, 131, 141, 151, 161, 171, 181, 191, 201, 221, 231, 241, 251, 261, 271, 281, 291, …
- tudo o resto: 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 53, 54, …

- -

Plural rule #16 (5 forms)

- -

Famílias: Celtic (Breton)
- termina em 1, excluindo 11, 71, 91: 21, 31, 41, 51, 61, 81, 101, 121, 131, 141, 151, 161, 181, 201, 221, 231, 241, 251, 261, 281, ...
- ends in 2, excluindo 12, 72, 92: 2, 22, 32, 42, 52, 62, 82, 102, 122, 132, 142, 152, 162, 182, 202, 222, 232, 242, 252, 262, 282, ...
- ends in 3, 4 or 9 excluindo 13, 14, 19, 73, 74, 79, 93, 94, 99: 3, 4, 9, 23, 24, 29, 33, 34, 39, 43, 44, 49, 53, 54, 59, ...
- termina em 1000000: 1000000: 1000000, 2000000, 3000000, 4000000, 5000000, 6000000, 7000000, 8000000, 9000000, 10000000, ...
- tudo o resto: 0, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 26, 27, 28, 30, 35, 36, 37, 38, 40, ...

- -

Plural rule #17 (2 forms)

- -

Famílias: Ecuador indigenous languages (Shuar)
- é 0: 0
- tudo o resto: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, …

- -

Plural rule #18 (6 forms)

- -

Famílias: Welsh
- é 0: 0
- é 1: 1
- é 2: 2
- is 3: 3
- é 6: 6
- tudo o resto: 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, …

- -

Plural rule #19 (3 forms)

- -

Famílias: Slavic (bósnio, croata, sérvio)
- termina em 1, excluindo 11: 1, 21, 31, 41, 51, 61, 71, 81, 91, 101, 121, 131, 141, 151, 161, 171, 181, 191, 201, 221, 231, 241, 251, 261, 271, 281, 291, …
- termina em 2-4, excluindo 12-14: 2, 3, 4, 22, 23, 24, 32, 33, 34, 42, 43, 44, 52, 53, 54, 62, 63, 64, 72, 73, 74, 82, 83, 84, 92, 93, 94, 102, 103, 104, 122, 123, 124, 132, 133, 134, 142, 143, 144, 152, 153, 154, 162, 163, 164, 172, 173, 174, 182, 183, …
- tudo o resto: 0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 26, 27, 28, 29, 30, 35, 36, 37, 38, 39, 40, 45, 46, 47, 48, 49, 50, 55, 56, 57, 58, 59, 60, 65, 66, 67, 68, 69, 70, 75, 76, 77, …, 112, 113, ..., 212, 213, ...

- -

Exemplos

- -

A seguir tem alguns exemplos para vários idiomas e um breve processo de reflexão.

- -

Francês

- -

Some French speaking places treat 0 as plural while others treat it as singular. The only other singular é 1 while tudo o resto is plural. So pick either plural rule #1 or #2.

- -

pluralRule=2
- seconds=seconde;secondes
- minutes=minute;minutes
- hours=heure;heures
- days=jour;jours

- -

Like many other times when localizing words, gender agreement might force you to rearrange words in a way that the gender is always the same. (seconde vs jour)

- -

Chinês

- -

A word doesn't change if there is a different number in front of it, so all numbers use the same plural form. With just one plural form, it has to be plural rule #0. For each word to localize, it's just like localizing a single word with no semi-colons needed.

- -

pluralRule=0
- seconds=秒
- minutes=分
- hours=時
- days=日

- -

Polaco

- -

There's a singular form fou 1, a plural form for 2-4, and another for 5-21 at which point 22 is the same as 2. Plural rule #7 has a "termina em 2-4, not 12-14" but the singular form includes everything ending in 1 except 11. Plural rule #9 has the correct singular form for only 1.

- -

pluralRule=9
- seconds=sekunda;sekundy;sekund
- minutes=minuta;minuty;minut
- hours=godzina;godziny;godzin
- days=dzień;dni;dni

- -

Even though the last 2 plural forms of "day" are the same, both are still needed, because there needs to be 3 plural forms for each word.

- -

Sérbio

- -

There are 4 plural forms: nominative singular, nominative dual, nominative plural, genitive plural. These match up with plural rule #10.

- -

pluralRule=10
- seconds=sekunda;sekundźe;sekundy;sekundow
- minutes=mjeńšina;mjeńšinje;mjeńšiny;mjeńšin
- hours=hodźina;hodźinje;hodźiny;hodźin
- days=dźeń;dnjej;dny;dnjow

- -

Extensão de Teste

- -

Para ajudar a ter a certeza de que escolhe a regra de plural correta e fornecer formas de plural suficientes para as sequências de carateres, deveria utilizar a extensão "pluralForm Checker". Depois de instalar a extensão, esta deverá estar disponível no menu de "Ferramentas".

- -

To use it, list off the property files and properties that you want to check and click the button. The extension will load each property and display the plural forms in a table. Selecting a table entry will populate the bottom box with sample uses of the word for some numbers.

- -

Image:pluralForm-checker.0.3.png

- -

Instalar a extensão Checker v0.3 de pluralForm

- -

Entrada de extensão

- -

Seria bom manter esta lista atualizada com todas as palavras que precisam de formas plurais. As pessoas que utilizam a extensão podem copiar/colar esta entrada.

- -

chrome://mozapps/locale/downloads/do...tes,hours,days
- chrome://mozapps/locale/downloads/do...dsTitlePercent
- chrome://browser/locale/browser.prop...ausedDownloads

- -

Histórico de versão

- -

0.1: Initial version with pluralRule check, properties input loading, table generation, sample output display
- 0.2: Use PluralForm.numForms() to get the number of forms instead of figuring out locally to better support future rules - Requires build from 2007/01/27 or later
- 0.3: Generate a list of what numbers fall into which plural form to minimize the sample output to at most 3 of each form

- -

Programar com PluralForm

- -

The functionality for getting the correct plural forms is provided by a JavaScript Module, PluralForm.jsm. This module provides a couple methods for localizing to the browser's current locale as well as getting methods to localize to a desired plural rule. The latter ability of specifying a plural rule is useful for extensions because the extension doesn't necessarily have to be localized to the browser's locale.

- -

Carregar PluralForm.jsm

- -

Loading the PluralForm module from JavaScript is simple with Components.utils.import. Just put the following line somewhere that will be evaluated before you want to use PluralForm. At the top of your JavaScript file is fine.

- -
Components.utils.import("resource://gre/modules/PluralForm.jsm");
- -

Métodos: get

- -

Estes métodos utilizam o idioma atual do navegador especificado pelo valor chrome://global/locale/intl.properties's pluralRule.

- -
/**
- * Get the correct plural form of a word based on the number
- *
- * @param aNum
- *        The number to decide which plural form to use
- * @param aWords
- *        A semi-colon (;) separated string of words to pick the plural form
- * @return The appropriate plural form of the word
- */
-string pluralForm
-get(int aNum, string aWords)
- -

Aqui tem um exemplo de utilização deste método:

- -
// Load PluralForm and for this example, assume English
-Components.utils.import("resource://gre/modules/PluralForm.jsm");
-
-// PluralForm.get expects a semi-colon separated list of words
-let downloads = "download;downloads";
-// Pretend this number came from somewhere else
-let num = 10;
-
-// Display the correct plural form fou 10 downloads: "You have 10 downloads.")
-print("You have " + num + " " + PluralForm.get(num, downloads) + ".");
-
-// Try again with a different value: "You have 1 download."
-num = 1;
-print("You have " + num + " " + PluralForm.get(num, downloads) + ".")
- -

The above example works, but is still difficult to localize, because we're concatenating strings assuming a particular grammatical structure. The following would be better:

- -
Components.utils.import("resource://gre/modules/PluralForm.jsm");
-
-let downloads = "You have one download.;You have #1 downloads.";
-let num = 10;
-
-// For English, this would display "You have 10 downloads."
-print(PluralForm.get(num, downloads).replace("#1", num);
- -

Notice in the above example that the code can be written to support placeholders or not use placeholders in some forms of the string. Additionally, the localizer has control over where the placeholder is, in relation to the rest of the text.

- -

Of course, the strings to be localized will be placed in a separate file, such as yourextension.properties, instead of being hardcoded in the JavaScript code file.

- -

The following 3 file snippets show how to use PluralForm with your .xul, .properties, .js files.

- -

downloads.xul:

- -
<stringbundleset>
-  <stringbundle id="strings" src="chrome://downloads.properties"/>
-</stringbundleset>
- -

downloads.properties:

- -
# LOCALIZATION NOTE (downloadsTitleFiles): Semi-colon list of plural forms.
-# See: https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals
-# #1 number of files
-# example: 111 files - Downloads
-downloadsTitleFiles=#1 file - Downloads;#1 files - Downloads
-
-# LOCALIZATION NOTE (timePair): #1 time number; #2 time unit
-# example: 1 second; 11 seconds
-timePair=#1 #2
-seconds=second;seconds
-minutes=minute;minutes
-hours=hour;hours
-
- -

downloads.js:

- -
Components.utils.import("resource://gre/modules/PluralForm.jsm");
-let getStr = function(string) document.getElementById("strings").getString(string);
-
-// Get the correct plural form for the title
-let numDownloads = 3;
-let title = PluralForm.get(numDownloads, getStr("downloadsTitleFiles"));
-// Put in the correct number of downloads
-print(title.replace("#1", numDownloads));
-
-// Get the correct plural form of seconds
-let timeLeft = 55;
-let seconds = PluralForm.get(timeLeft, getStr("seconds"));
-// Print the localized string for "55 seconds"
-print(getStr("timePair").replace("#1", timeLeft).replace("#2", seconds));
- -

Método: makeGetter

- -

If you're writing an extension, you'll want to use makeGetter instead of PluralForm.get() or PluralForm.numForms(). This is because someone installing the extension on a different locale will be using the strings provided by your default extension locale. For example, your extension localized for English with plural rule #1, which expects 2 plural forms, is installed on a localized version of Firefox with plural rule #4, which expects 3 forms:

- -
/**
- * Create a pair of plural form functions for the given plural rule number.
- *
- * @param aRuleNum
- *        The plural rule number to create functions
- * @return A pair: [function that gets the right plural form,
- *                  function that returns the number of plural forms]
- */
-[string pluralForm get(int aNum, string aWords), int numForms numForms()]
-makeGetter(int aRuleNum)
- -

Aqui tem um exemplo de utilização de makeGetter:

- -
Components.utils.import("resource://gre/modules/PluralForm.jsm");
-
-// Let's get Irish (plural rule #11)
-let [get, numForms] = PluralForm.makeGetter(11);
-
-// Make up some values to use with "get"
-let dummyText = "form 1;form 2;form 3;form 4;form 5";
-let dummyNum = 10;
-
-// In the case of Irish, the value 10 uses plural form #4, so "form 4" is printed
-print(get(dummyNum, dummyText));
- -

In this example, the Irish plural rule was hardcoded, but this could be a value specified in the .properties file. So for your extension, specify a pluralRule value in the .properties, and call PluralForm.makeGetter(pluralRuleFromProperties), making sure to save the 2 returned functions. (You can use destructured assignment in JavaScript 1.7 to keep things clean.) The returned functions act just like PluralForm.get() and PluralForm.numForms(), except for the specified plural rule instead of the default plural rule.

- -

Créditos

- -

Inicialmente, o código da "Forma de Plural" foi implementado por {{ Bug(394516) }} - Figure out a remaining-time rounding scheme for minutes -> hours/days
- As regras de plural e as familias derivadas da documentação gettext da GNU.

diff --git a/files/pt-pt/mozilla/localization/localizar_com_mercurial/index.html b/files/pt-pt/mozilla/localization/localizar_com_mercurial/index.html deleted file mode 100644 index de4a09643f..0000000000 --- a/files/pt-pt/mozilla/localization/localizar_com_mercurial/index.html +++ /dev/null @@ -1,256 +0,0 @@ ---- -title: Localizar com Mercurial -slug: Mozilla/Localization/Localizar_com_Mercurial -tags: - - Documentação de criação - - Internacionalização - - Localização - - Tradução -translation_of: Mozilla/Localization/Localizing_with_Mercurial ---- -

In Mozilla, we use the the Mercurial version control system (Hg) to manage our source code and localizations. Mercurial allows localizers to work locally (on their machines) and then push (an Hg term) changes to a remote repository, which usually is hosted on the Mozilla servers (hg.mozilla.org). Localizing current versions of Firefox, Thunderbird and SeaMonkey includes working with Mercurial. If the documentation is incomplete or you have questions, please drop by the #l10n or #hg channels on irc.mozilla.org. The Mercurial FAQ are also worth a read, should you run into trouble.

- -

For the eager and quick, below you'll find instructions on installing and configuring Mercurial, instructions on receiving an Hg account commit priviledges, as well as a few tasks you can complete without account priviledges.

- -

Instalar Mercurial

- -

Follow the instructions below to install Mercurial on your system. Once you've installed Mercurial, we'll walk through the steps to configure it.

- -

Mercurial no Linux

- -

You can easily install Mercurial from the command line by issuing one of the following commands. Choose the appropriate command for your distribution and make sure to run as root.

- -
# Debian/ubuntu
-$ apt-get install mercurial
-
-# Fedora
-$ yum install mercurial
-
-# Gentoo
-$ emerge mercurial
-
-# Arch Linux
-$ pacman -S mercurial
-
-# OpenSolaris
-$ pkg install SUNWmercurial
-
- -

Se preferir uma interface gráfica, pode transferir e instalar o MercurialEclips e aqui.

- -

Este funcionou?

- -

Open a Terminal window and enter hg --version. If you see a message about the version of Mercurial (e.g. Mercurial Distributed SCM (version 1.3.1)), you have installed Mercurial successfully!

- -

Mais detalhes

- -

For more details on installing Hg on Linux systems, refer to the instructions on Mercurial's Download page.

- -

Mercurial no Windows

- -

With Windows, you have a couple of install options:

- - - -

Mercurial Installer.pngPart of the command line Hg install for Windows involves making sure the hg executable is in the system's %PATH% variable (TortoiseHg doesn't need this step). Use the add_path.exe utility found in C:\mozilla-build\hg to do this.

- -
PS C:\Users\your_id> cd C:\mozilla-build\hg
-PS C:\mozilla-build\hg> .\add_path.exe /result .
-
- -

Note the dot (".") at the end of the second command, which means the current directory. If the utility modified your %PATH% successfully, a dialog will open saying, "%PATH% has been updated correctly."

- -

Alternatively, you can edit the %PATH% variable manually. In order to do so, right-click on your computer icon, choose Properties > Advanced > Environmental Variables, select PATH and click Edit. If you don't see PATH among the options, you'll have to click Add and edit it within the Add dialog. See the screenshot for an example.PATH.jpg

- -

Este funcionou?

- -
    -
  1. Go to Start > Run...
  2. -
  3. Type cmd.exe and click OK. A new shell window should appear. 
  4. -
  5. Type hg --version in the new shell window. If you see a message about the version of Mercurial (e.g. Mercurial Distributed SCM (version 1.3.1)), you have installed Mercurial successfully!
  6. -
- -

Mais detalhes

- -

For more details on installing Hg on Windows, refer to the instructions on Mercurial's Download page.

- -

Mercurial no Mac OSX

- -

Installing Hg on Mac OSX is super easy. You can install Mercurial via MacPorts through the Terminal, like so:

- -

$ sudo port install mercurial

- -

You can also install it by downloading the dmg package from the Hg download page. It has an install dialog that will walk you through the process.

- -

If you prefer a graphical interface, you can download and install MercurialEclipse here.

- -

Este funcionou?

- -

Open a Terminal window and type hg --version. If you see a message about the version of Mercurial (e.g. Mercurial Distributed SCM (version 1.3.1)), you have installed Mercurial successfully!

- -

Mais detalhes

- -

For more details on installing Hg on Mac OSX, refer to the instructions on Mercurial's Download page.

- -

Configurar o Mercurial

- -

Once you've installed Mercurial, you'll need to configure it before you can use it successfully.

- -

Your Mercurial configuration is contained within a config file which you must create yourself. Your config file is called either ~/.hgrc (UNIX systems) or Mercurial.ini (Windows), depending on your operating system.

- -

Your config file should have the following settings:

- -
[ui]
-username = Your Real Name <user@example.com>
-merge = internal:merge
-
-[defaults]
-commit = -v
-
-[diff]
-git = 1
-showfunc = 1
-unified = 8
- -

To configure Hg, follow these steps:

- -
    -
  1. Create a new file in your favorite text editor.
  2. -
  3. Copy the settings above and paste them into your new file.
  4. -
  5. Save the file as either .hgrc (UNIX systems) or Mercurial.ini (Windows) and save it in either $HOME/ or C:\mozilla-build\hg\ or C:\Program Files\Mercurial\.
  6. -
- -

Now that you've installed and configured Mercurial, here are a few tasks you can do without Hg commit access priviledges.

- -

Clonar e atualizar os repositórios

- -

There are a couple of repostiories that contain en-US source files that most locales will want to deal with.

- - - -
-

When you get the comm-central repository, this will include the mozilla-central repository as well. You can therefore use the one set up for developing Firefox, SeaMonkey and Thunderbird without having to pull mozilla-central a second time.

-
- -

Here's how to get (or clone) your en-US source files for the first time:

- - - -
hg clone https://hg.mozilla.org/mozilla-central/
-
- -

This will create a clone of the mozilla-central repository in the directory mozilla-central.

- - - -
hg clone https://hg.mozilla.org/comm-central/
-cd comm-central
-python client.py checkout
-
- -

The first command will create a clone of the comm-central repository. The second command will move you into that directory. The third command will do a clone of mozilla-central, and pull some other hg repositories. The other directories are required for SeaMonkey and Thunderbird.

- - - -
hg clone https://hg.mozilla.org/l10n-central/ab-CD/
- -

Atualizar os seus repositórios locais

- - - -
hg pull -u
-
- -

This will both get new changesets from mozilla-central and apply those changes in your working copy.

- - - -
python client.py checkout
- -

This will both get new changesets from comm-central, mozilla-central and the other appropriate locations and apply those changes in your working copy.

- - - -
hg pull -u
- -

Criar correções (patches) de L10n

- -

Another thing you can do with Hg without needing account priviledges is creating L10n patches of your work for someone else to commit to your remote L10n repo on the Mozilla servers. Doing this ensures that your dashboards are always accurate, as they look at your remote repo.

- -

Here's how to create a L10n patch with Hg and the Mq extension:

- -
    -
  1. Enable Mq by adding hg.ext =  to your Mercurial config file (~/.hgrc on Unix-like systems or Mercurial.ini on Windows) under the [extensions] section.
  2. -
  3. Open your command line tool and navigate to your L10n directory.
  4. -
  5. Inside your L10n directory, init your repo with Mq by running hg init --mq.
  6. -
  7. To create a new patch, run hg qnew -m "Your commit message" patch-name.patch. The commit message should take the form of "Bug 123456 - Change this thing to work better by doing something; r=reviewers" if you are to fix a bug.
  8. -
  9. Make your change.
  10. -
  11. Once you finish making your change, run hg qrefresh to commit your changes to the patch.
  12. -
  13. Navigate to your <repository>/.hg/patches to find your .patch.
  14. -
  15. You may repeat from step 4 to create another patch. Your patches will be incremental, i.e. new patches are created based on old patches. If you want to commit all the patches to the repository and cleanup the patch queue, run hg qfinish.
  16. -
- -

Please refer to MqTutorial and Mq documentation for further uses of Mq extension to manage patches.

- -

Privilégios da Conta Mercurial

- -

Eventually, you or your team leader will need Hg account priviledges. Let's face it, it's just more convenient to commit and push your work to the remote repo yourself, rather than creating patches and asking someone else to push them for you.

- -

To get write access to the l10n hg repositories on the Mozilla server, there's a bit of paper work to be done. The localization team owner needs to file a bug requesting an hg account. This bug will request level 1 L10n priviledges. You need to follow the instructions regarding the contributor form. Write access to the hg repositories requires a ''voucher'', which, for the owner, will be done based on the review by Mozilla. For peers of a localization, the owner can vouch (once she or he is registered).

- -

Enviar alterações para a Mozilla

- -

Now that you have Hg account privileges, you can send your work to Mozilla all by yourself. Here are the steps to send your L10n work using Mercurial:

- -
    -
  1. Since your L10n work takes place in your own local repository, you should ensure that there are no changes made to the remote repository before committing your work. To do this, update your locale, as per the section above.
  2. -
  3. After finishing a change or set of changes and checking you have updated to the latest, you should commit by entering this command:
  4. -
- -
hg commit -m "your message identifying the change (bug 555)"
- -

Committing won’t send your changes to Mozilla’s repository, but prepares them for it. The next step will send your changes to your remote repo via push.

- -
    -
  1. To push to mozilla-hosted repositories, you have to have committer access, and you must edit the file (your-local-hg-root AKA the directory you pulled your locale into)/.hg/hgrc (note, this is NOT your ~/.hgrc) to add these lines (replacing ab-CD with your locale code):
  2. -
- -
[paths]
-default = https://hg.mozilla.org/l10n-central/ab-CD/
-default-push = ssh://hg.mozilla.org/l10n-central/ab-CD/
-
- -
    -
  1. You’ll also need to tell ssh which account to use for your pushes, too, by editing ~/.ssh/config and adding these lines, where user@host.domain is your account:
  2. -
- -
Host hg.mozilla.org
-User user@host.domain
-
- -
    -
  1. Now you can push your work to the repository (and check the result on the dashboard) by entering this command from your local directory:
  2. -
- -
hg push
- -

And tah dah! You're done! Congratulations on finishing the tutorial. Take a break and grab a snack, you deserve it

diff --git "a/files/pt-pt/mozilla/localization/localiza\303\247\303\243o_com_pontoon/index.html" "b/files/pt-pt/mozilla/localization/localiza\303\247\303\243o_com_pontoon/index.html" deleted file mode 100644 index 05fa58b1d6..0000000000 --- "a/files/pt-pt/mozilla/localization/localiza\303\247\303\243o_com_pontoon/index.html" +++ /dev/null @@ -1,138 +0,0 @@ ---- -title: Traduzir com Pontoon -slug: Mozilla/Localization/Localização_com_Pontoon -tags: - - Localização - - Tradução -translation_of: Mozilla/Localization/Localizing_with_Pontoon ---- -

Pontoon é uma ferramenta de localização (l10n), O-Que-Vê-É-O-Que-Obtém (WYSIWYG) baseada na Web. Na Mozilla, nós utilizamos o Pontoon para localizar todos os produtos e sites da Web da Mozilla, desde o Firefox até Mozilla.org. Pontoon é uma ferramenta muito simples e intuitiva que requer poucos conhecimentos técnicos para utilizar no ritmo de trabalho de l10n. Aqui, nós iremos discutir como utilizar o Pontoon para localizar projetos, desde o primeiro início de sessão até concluir as suas contribuições. Ao longo do caminho, nós iremos sugerir algumas funcionalidades que irão tornar mais eficiente e facilitar as suas contribuições no seu l10n.

- -
-

É um programador? Leia sobre a implementação do Pontoon no seu projeto ou saiba como participar no GitHub.

-
- -

Primeiros passos

- -

Pontoon's home page is very easy to use. To begin localizing the project, click on the Persona icon and sign in. Next, simply select the project you want to work on and your locale from the dropdown menus. Pontoon will automatically open that locale's project for you to get started. Note that for our purposes here, we'll be using Firefox Affiliates website to demo Pontoon's functionality and workflow. And there it is, opened inside Pontoon:

- -

Browser app and workspace

- -

Barra de ferramentas principal

- -

As you can see, most of the interface is taken by the website being translated. Only the toolbar on top belongs to Pontoon, containing the following items (from left to right):

- -

Main toolbar

- -

Lista de textos

- -

Opens a sidebar with a list of all strings to localize.

- -

Seletor de projeto (Afiliados)

- -

Switches between projects to localize.

- -

Seletor de recursos (Página Inicial)

- -

Switches between project resources to localize, like subpages or localization files. Hidden if no resources available for project.

- -

- -
-
- -

Seletor de idioma (Esloveno)

- -

Switches between languages to localize.

- -

Ir

- -

Opens project-resource-locale selection.

- -

Indicado do progresso

- -

Displays your progress on the resource being localized. More details are available in the popup.

- -
-
- - - -

Allows for user-specific tasks, like commiting to repository, downloading files and signing out.

- - - -

Gives important information, like the anticipated project timeline and a list of keyboard shortcuts.

- -
-
- -

Alright, how about we do some translating now?

- -
-
- -

Traduzir texto

- -

When using Pontoon for localization, you have a couple of options to translate your strings. You can translate in-context, out-of-context, or a combination of the two. We'll start with looking at in-context translation.

- -

In-context

- -

Pontoon's in-context translation mode is what puts it above others. It opens a web page (or web app) and enables real-time editing of that page. Here's how you translate your first string:

- -

In-context localization

- -
    -
  1. Hover over the text you want to translate with your mouse.
  2. -
  3. An edit button appears over that text. Click on it to enable the translate mode.
  4. -
  5. Replace the original text with its translation into your language.
  6. -
  7. Click the save button to save your translation.
  8. -
- -
-

Out-of-context

- -

Some strings are impossible to translate in-context, e.g. the contents of the <title> tag in websites and strings with placeables or different plural forms. By clicking on the hamburger icon in the main toolbar, a list of all strings and available translations will open in the sidebar. You can also use the sidebar for out-of-context localization:

- -

Out-of-context localization: list Out-of-context localization: translate

- -
    -
  1. Click on the string you'd like to translate.
  2. -
  3. Translation panel with original string and its details (e.g. comments) opens.
  4. -
  5. Translate the string in the translation area below.
  6. -
  7. Click the save button to save your translation.
  8. -
- -

As you translate strings out-of-context, translations will also appear in website, if they could also be translated in-context.

- -

Ajudas de tradução

-
- -

As you can see, suggestions from history, translation memory, machine translation and other locales are also available in the out-of-context translation panel. We call all of these translation helpers and here's how each of them will help you as you translate strings:

- -

Translation helpers: History Translation helpers: Machinery Translation helpers: Other locales Translation helpers: Search

- -

Histórico

- -

Displays previously suggested translations, including from other users.

- -

Máquina

- -

Displays matches from various services: internal translation memory, Mozilla Transvision, open source translation memory, Microsoft terminology and machine translation.

- -

Outros idiomas

- -

Displays matching translations from other locales.

- -

Pesquisar

- -

Almost like machinery, but takes provided keyword as input parameter instead of the original string.

- -

By clicking a suggestion, it gets copied into translation area.

- -
-
- -

Publicar a sua localização

- -

Suppose you now want to publish your l10n work by committing it to a repo. Pontoon lets you do that too! Actually, it does that for you by automatically syncing with repositories on hourly basis. You can now pat yourself on the back, do a little dance, go to sleep or do something else to celebrate your work!

diff --git a/files/pt-pt/mozilla/mercurial/basicos/index.html b/files/pt-pt/mozilla/mercurial/basicos/index.html deleted file mode 100644 index a57f7a3778..0000000000 --- a/files/pt-pt/mozilla/mercurial/basicos/index.html +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: Básicos sobre Mercurial -slug: Mozilla/Mercurial/Basicos -tags: - - Desenvolvendo o Mozilla - - Mercurial -translation_of: Mozilla/Mercurial/Basics ---- -

I am about to tell you some stuff about Mercurial that will save you a lot of frustration. This page is cynical and survival-oriented. But I still claim Mercurial is a lot better than CVS. —jorendorff 16:06, 12 May 2008 (PDT)

- -

Expetativas

- -

Mercurial não é CVS. Os comandos não são os mesmos. Os conceitos não são os mesmos. Como é Mercurial diferente de CVS?

- -

This gun is loaded. You can shoot yourself in the foot. You can lose work. The tool tries to protect you, but it can happen anyway. The two common failure modes are: (a) you run a command without knowing what it's going to do; (b) you hg commit or hg qrefresh with a mistaken understanding of the state of your working directory. So you accidentally commit changes that you didn't want to commit; or you accidentally commit a broken merge; etc. Often it's not immediately obvious that anything is wrong.

- -

Forewarned is forearmed. Don't do these things. Don't run commands without knowing what they're going to do—hg help is your friend. Don't commit without diffing and thinking. And don't let yourself get into "play mode" and stop paying attention to the fact that what you're playing with is your own uncommitted work.

- -

Mercurial is not magic dust. Mercurial is flexible, powerful, and fun. It lets you attempt stuff you never would have tried in CVS. But of course not everything turns out to have been a good idea. (For example, we tried sharing patch queues. It sort of sucked.)

- -

Evite problemas

- -

Utilize o último lançamento estável do Mercurial.

- -

Learn how to get your bearings. Use read-only commands (like hg status, hg head, hg parents, hg log, hg diff, hg outgoing) to check the status of your repository. This is a key skill.

- -

Configure a merge program and make sure you know how to use it. DO IT NOW. Otherwise you will likely screw up your repository at some point.

- -

Mercurial doesn't leaves conflict markers in your files; instead, it wants you to fix the conflicts immediately, using a merge program (like kdiff3) which it can launch for you.

- -

This can be error-prone. By default, Mercurial uses the first merge program it finds on your system, and merge programs can have a learning curve. Mercurial does not do a good job of detecting busted merges and refusing to proceed, so just by closing a window you can unwittingly put yourself in a bad state. Bad merges may lead to seemingly inexplicable Mercurial behavior in the future.

- -

If a merge fails, make sure Mercurial knows that it has failed. When you're first learning the ropes, merges often go wrong. You might see this message:

- -
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-There are unresolved merges, you can redo the full merge using:
-  hg update -C 2
-  hg merge 1
-
- -

This means some conflicts weren't resolved during the merge. If you don't know exactly what they are and how to fix them, use that hg update -C command to tell Mercurial that you've given up on that merge.

- -

If you don't, Mercurial won't know, and the next time you commit, it'll make a merge changeset. This is bad. The result can look a lot like accidentally destroying a bunch of work, actually, but the damage can be undone.

- -

If hg parents shows two parents, you're merging.

- -

If you use Mercurial Queues, back up your work. hg qrefresh destructively replaces the old patch with the new one! Use hg qinit -c to create a separate backup repository for your patches and hg commit --mq -m backup regularly.

- -

Don't use Mercurial Queues in a repository that someone might pull from since applied (non-public) patches would also be pulled.

- -

Recuperação

- -

Ups! Mercurial cortou o seu braço!

- -

Don't randomly try stuff to see if it'll magically fix it. Remember what you stand to lose, and set down the chainsaw while you still have one good arm.

- -

Obtenha ajuda no IRC. Tente #hg ou #developers no Mozilla IRC ou #mercurial no freenode.

- -

 

- -

{{ languages( { "es": "es/Lo_b\u00e1sico_de_Mercurial", "fr": "fr/Les_bases_de_Mercurial", "ja": "ja/Mercurial_basics" } ) }}

diff --git a/files/pt-pt/mozilla/mercurial/index.html b/files/pt-pt/mozilla/mercurial/index.html deleted file mode 100644 index 4f54ee5312..0000000000 --- a/files/pt-pt/mozilla/mercurial/index.html +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: Mercurial -slug: Mozilla/Mercurial -tags: - - Desenvolvendo a Mozilla - - Mercurial -translation_of: Mozilla/Mercurial ---- -
-

Por favor, consulte Mercurial para Mozillians em ReadTheDocs para as melhores práticas atuais à volta do Mercurial, including many helpful extra tools and guidelines that make using Mercurial fast and easy.

-
- -

Mercurial (também conhecido como "hg"), é um controlo de versões distribuido de software, utilizado para o desenvolvimento do Firefox, Thunderbird, e o núcleo de Gecko partilhado. Este substituiu CVS depois da ramificação 1.9 da Mozilla.

- -

hg is the Mercurial command-line tool, Hg being the chemical symbol for the element mercury.

- -

Instalação, configuração e obtenção da fonte

- -

See Installing Mercurial for installation and configuration tips.

- -

See Getting Mozilla Source Code Using Mercurial for getting a tree to build.

- -

Aprender a utilizar o Mercurial

- -

If you are new to Mercurial, you should start with the official guide.

- -

Then, move on to Mercurial basics and Mercurial FAQ and the version control tool docs for Mozilla-centric Mercurial information.

- -

Leitura adicional

- -

The Mercurial tag lists the Mercurial-related articles on MDN.

- -

And on wiki.mozilla.org, these helpful pages:

- - - -

{{ languages( { "es": "es/Mercurial", "fr": "fr/Mercurial", "ja": "ja/Mercurial" } ) }}

diff --git a/files/pt-pt/mozilla/mercurial/instaacao_mercurial/index.html b/files/pt-pt/mozilla/mercurial/instaacao_mercurial/index.html deleted file mode 100644 index b5bf466bca..0000000000 --- a/files/pt-pt/mozilla/mercurial/instaacao_mercurial/index.html +++ /dev/null @@ -1,151 +0,0 @@ ---- -title: Instalação de Mercurial -slug: Mozilla/Mercurial/Instaacao_Mercurial -tags: - - Desenvolvendo a Mozilla - - Mercurial - - Precisa de Atualização -translation_of: Mozilla/Mercurial/Installing_Mercurial ---- -

{{Note('Se ainda não leu os básicos sobre Mercurial, faça-o agora ou consulte Mercurial para outros recursos.')}}

- -
-

Please refer to Mercurial para Mozillians em ReadTheDocs for current best-practices around Mercurial, including many helpful extra tools and guidelines that make using Mercurial fast and easy.

-
- -

Instalação

- -

See Installing Mercurial from the Mozilla Version Control Guide.

- -

Configuração básica

- -

You should configure Mercurial before submitting patches to Mozilla.

- -

If you will be pulling the Firefox source code or one of the derived repositories, the easiest way to configure Mercurial is to run the mercurial-setup mach command:

- -
./mach mercurial-setup
- -

This command starts an interactive wizard that will help ensure your Mercurial is configured with the latest recommended settings. This command will not change any files on your machine without your consent.

- -

If you don't have the Firefox source code available, you should edit your Mercurial configuration file to look like the following:

- -
[ui]
-username = Your Real Name <user@example.com>
-merge = your-merge-program (or internal:merge)
-
-[diff]
-git = 1
-showfunc = 1
-unified = 8
-
-[defaults]
-commit = -v
-
- -

On Windows, these settings can be added to $HOME\.hgrc or $HOME\Mercurial.ini, or, if you'd like global settings, C:\mozilla-build\hg\Mercurial.ini or C:\Program Files\Mercurial\Mercurial.ini. On UNIX-like systems, they should be in your $HOME/.hgrc file.

- -

You can configure the editor to use for commit messages using the editor option in the [ui] section or by setting the EDITOR environment variable.

- -

If you are trying to access the repository through a proxy server, see these instructions.

- -

Outras dicas de configuração

- -

Unir programa

- -

After installing, choose a merge program. Seriously. Do it now. If you don't, Mercurial will choose one for you and spring it on you when you least expect it.

- -

A reasonable thing to do is to set ui.merge=internal:merge in the Mercurial configuration file (see below), which makes Mercurial try to merge changes and add the conflict markers (a la CVS) to the files that couldn't be merged.

- -

Under Ubuntu, you can install meld package, then in in the Mercurial configuration file (see below) set ui.merge=meld

- -

You can see the list of merge conflicts by looking for "merging ... failed!" in the update output.

- -

Configuring kdiff3 as a merge tool

- -

If you're on Linux and you have kdiff3 installed, you probably want to configure kdiff3 as a merge tool.  (It's better than meld because it will actually resolve a bunch of the conflicts without prompting you, generally quite accurately.)  You can do this by adding the following lines (which come from contrib/mergetools.hgrc in the Mercurial distribution):

- -
[merge-tools]
-kdiff3.args=--auto -L1 base --L2 local --L3 other $base $local $other -o $output
-kdiff3.regkey=Software\KDiff3
-kdiff3.regappend=\kdiff3.exe
-kdiff3.fixeol=True
-kdiff3.gui=True
-
-
- -

Extensões

- -

There's a number of extensions you can enable. See http://mercurial.selenic.com/wiki/UsingExtensions. Almost everyone should probably enable the following:

- - - -

These can all be turned on by just adding this to your .hgrc file:

- -
[extensions]
-color =
-rebase =
-histedit =
-progress =
-transplant =
-pager =
-
- -

In addition, there are some 3rd party extensions that are incredibly useful for basic development:

- -
-
mozext
-
Mozilla-specific functionality to aid in developing Firefox/Gecko.
-
trychooser
-
Automatically creates a try commit message and then pushes changes to Mozilla's Try infrastructure. Just run: -
hg trychooser
-
-
qimportbz
-
Import patches from Bugzilla. Creates a filename and commit message for you based on the bug's metadata. -
hg qimport bz://1234567
-  
-
-
bzexport
-
Export patches to Bugzilla. There are quite a few optional arguments here to create new or update existing bugs with the attment, as well as auto matically request reviews. Type hg help bzexport for a full list but the basic syntax is: -
hg bzexport -i 1234567
-
-
- -

Installing these is fairly easy. You'll just need to find a place on your system to store the extensions, and clone the extension repos into it:

- -
hg clone https://bitbucket.org/edgimar/crecord
-hg clone https://bitbucket.org/sfink/mqext
-hg clone https://hg.mozilla.org/users/robarnold_cmu.edu/qimportbz
-git clone https://github.com/pbiggar/trychooser
-
- -

And then add then to your .hgrc file

- -
[extensions]
-qcrecord =  /path/to/crecord/crecord
-mqext =  path/to/mqext
-qimportbz =  path/to/qimportbz
-trychooser = path/to/trychooser/trychooser
-
- -

Configuração do repositório de testes

- -

If you have access to the try server you may want to configure Mercurial so you can refer to it simply as "try", since it can be useful from all your trees.  This can be done by adding this to your ~/.hgrc (or Mercurial.ini):

- -

 

- -
[paths]
-try = ssh://hg.mozilla.org/try/
-
- -

You can also configure short names like this that are specific to a particular repository by adding a [paths] section to the .hg/hgrc file within a repository.  There are two magic names, "default" and "default-push", which are used as the default push/pull targets.  (If "default" is specified and "default-push" is not, "default" is used for both.)

- -

Alternativamente, pode instalar a extensão trychooser (versão antiga).

- -

{{ languages( { "fr": "fr/Installation_de_Mercurial" } ) }}

diff --git a/files/pt-pt/mozilla/o0coes_linha_comandos/index.html b/files/pt-pt/mozilla/o0coes_linha_comandos/index.html deleted file mode 100644 index 57a1511c23..0000000000 --- a/files/pt-pt/mozilla/o0coes_linha_comandos/index.html +++ /dev/null @@ -1,486 +0,0 @@ ---- -title: Opções da Linha de Comandos -slug: Mozilla/O0coes_Linha_Comandos -tags: - - Administração - - Desenvolvimento da Mozilla - - Documentação do Utilizador - - Extensões - - Extras - - Firefox - - Linha de Comandos - - Mozilla - - Perguntas e Respostas - - Precisa de Atualização -translation_of: Mozilla/Command_Line_Options ---- -

{{FirefoxSidebar}}

- -

As opções da linha de comandos são utilizadas para especificar várias opções de arranque para as aplicações da Mozilla. Por exemplo, pode utilizar as opções de configuração da linha de comandos para ignorar o 'Gestor de Perfis' e abrir um perfil específico (se tiver vários perfis). Também pode controlar como as aplicações da Mozilla são abertas, quais os componentes que são abertos inicialmente, e o que os componentes fazem quando são abertos. Esta página descreve as opções mais utilizadas e como utilizá-las. Pode abrir a interface da linha de comandos pressionando "Shift + F2".

- -

Regras de Sintaxe

- -

But first, let's describe the syntax rules that apply for all options.

- - - -

Utilizar as opções da linha de comandos

- -

Command line options are entered after the command to start the application. Some options have arguments. These are entered after the command line option. Some options have abbreviations. For example, the command line option "-editor" can be abbreviated as "-edit". (Where abbreviations are available, they are described in the text below.) In some cases option arguments must be enclosed in quotation marks. (This is noted in the option descriptions below.) Multiple command line options can be specified. In general, the syntax is as follows:

- -
application -option -option "argument" -option argument
-
- -

Exemplos

- -

The following examples show the use of the "-ProfileManager" command, which will open the Profile Manager prior to starting Firefox or Thunderbird:

- -

Windows

- -

Select Run from Windows Start menu. Type:

- -
firefox -ProfileManager
-
- -

Mac OS X

- -

Go to Applications > Utilities. Open Terminal and type:

- -
cd /Applications/Firefox.app/Contents/MacOS
-./firefox -ProfileManager
-
- -

If you use Firefox Nightly, you can type:

- -
cd /Applications/FirefoxNightly.app/Contents/MacOS
-./firefox -ProfileManager
-
- -

Linux

- -

Open Terminal and type:

- -
cd Thunderbird installation directory
-./thunderbird -ProfileManager
-
- -

The example above invokes the "-ProfileManager" command line option with Mozilla's Thunderbird mail client.

- -

Perfil do Utilizador

- -

-CreateProfile profile_name

- -

Create a new profile in the default directory, but do not start application. The profile will be named profile_name in the profile manager. profile_name must not contain spaces ( ). To use this successfully no instance of the application must be running, or the -no-remote options must be used.

- -
firefox -CreateProfile JoelUser
-
- -

-CreateProfile "profile_name profile_dir"

- -

Creates a new profile in the profile_dir directory, but do not start application. The profile will be named profile_name in the profile manager. Note profile_name and profile_dir are quoted together, and are separated by exactly 1 space (as with the previous syntax, profile_name must not contain spaces).

- -

To use this successfully no instance of the application must be running, or the -no-remote options must be used.

- -

NOTE: profile_dir must not exist and you must not already have a profile called profile_name.

- -
firefox -CreateProfile "JoelUser c:\internet\joelusers-moz-profile"
-
- -

-migration

- -

Start with Import Wizard.

- -

-new-instance

- -

Open new instance, not a new window in running instance, which allows multiple copies of application to be open at a time.

- -
firefox -new-instance -P "Another Profile"
-
- -
-

Nota: Not available for Windows, see {{bug(855899)}}.

-
- -

-no-remote

- -

- -

Do not accept or send remote commands; implies -new-instance.

- -
firefox -no-remote -P "Another Profile"
-
- -
-

Nota: Since Firefox 9, this does really mean what its name implies on all platforms, i.e. instances created with this parameter do not accept or send remote commands, see {{bug(650078)}}. That means that such instances won't be re-used. Also when using this argument a new instance is created in any case.

-
- -

-override /path/to/override.ini

- -

Load the specified override.ini file to override application.ini ({{Source("browser/app/application.ini")}}). This can be used to suppress the Migration Wizard at startup by loading the following override.ini. Firefox only.

- -
[XRE]
-EnableProfileMigrator=0
- -

-ProfileManager

- -

Start with Profile Manager. Short form: -P without a profile name.

- -

-P "profile_name"

- -

Bypass Profile Manager and launch application with the profile named profile_name. Useful for dealing with multiple profiles. Note profile_name is case sensitive. If you don't specify a profile name then the profile manager is opened instead. You must use an upper case P on Linux with versions older than 7.x, as there lower case invokes Purify mode (memory and leak detection). Other platforms accept both upper and lower case.

- -
firefox -P "Joel User"
-
- -

-profile "profile_path"

- -

Start with the profile with the given path. Firefox, Thunderbird and SeaMonkey2.x only.

- -

"profile_path" can either be an absolute path ("/path/to/profile") or a relative path ("path/to/profile").

- -
-

Nota: On Mac OS X specifying a relative path is not supported anymore from Firefox 4.0 and up due to a regression, see {{bug(673955)}}.

-
- - -

Navegador

- -

-browser

- -

Start with the browser component. Firefox and SeaMonkey only.

- -

-foreground

- -

Make this instance the active application.

- -

-headless

- -

Runs Firefox in headless mode, which is very useful for purposes such as debugging and automated testing. Available in Firefox 55+ on Linux, and Firefox 56+ on Windows/Mac OS X.

- -

-new-tab URL

- -

Open URL in a new tab. Firefox and SeaMonkey2.x only.

- -

-new-window URL

- -

Open URL in a new window. Firefox and SeaMonkey2.x only.

- -

-preferences

- -

Open Options/Preferences window. Firefox and SeaMonkey2.x only.

- -

-private

- -

Opens Firefox in permanent private browsing mode. Firefox 3.6 and later only.

- -

May not be applicable in older Ubuntu for Firefox 20 and later, confirmed to work in 14.04

- -

-private-window

- -

Opens a new private browsing window in an existing instance of Firefox. Firefox 20 and later only.

- -

-private-window URL

- -

Open URL in a new private browsing window. If a private browsing window is already open, a new tab is opened in the existing window. Firefox 29 and later only. Does not work in Firefox 31 on linux mint 17 nor on Firefox 48 on Windows 7. URL opens in a non-private window.

- -

-search term

- -

Search term with your default search engine. Firefox and SeaMonkey 2.1 and later only.

- -

-setDefaultBrowser

- -

Set the application as the default browser. Firefox only.

- -

-url URL

- -

Open URL in a new tab or window, depend on the browser option. -url can be omitted. You may list multiple URLs, separated by spaces. Firefox and SeaMonkey only.

- -
-

Note: When opening multiple URLs, Firefox always opens them as tabs in a new window.

-
- -
firefox www.mozilla.com
-firefox www.mozilla.com developer.mozilla.org
- -

Correio/Notícias

- -

-addressbook

- -

Start with address book. Thunderbird and SeaMonkey only.

- -

-compose message_options

- -

Start with mail composer. See syntax rules. Thunderbird and SeaMonkey only.

- -
thunderbird -compose "to=foo@nowhere.net"
- -

-mail

- -

Start with the mail client. Thunderbird and SeaMonkey only.

- -

-news news_URL

- -

Start with the news client. If news_URL (optional) is given, open the specified newsgroup. Thunderbird and SeaMonkey only.

- -
thunderbird -news news://server/group
-
- -

-options

- -

Open Options/Preferences window. Thunderbird only.

- -

-offline

- -

Start with the offline mode. Thunderbird and SeaMonkey only.

- -

-setDefaultMail

- -

Set the application as the default email client. Thunderbird only.

- -

Calendário

- -

-calendar

- -

Start with the calendar client. Sunbird only.

- -

-showdate date

- -

Show your schedule of the given date. Sunbird only.

- -
sunbird -showdate 08/04/2008
-
- -

-subscribe URL or -url URL

- -

Subscribe to the given URL. Sunbird only.

- -

Outros Componentes

- -

-chat

- -

Start with the IRC client, ChatZilla, if installed.

- -

-devtools

- -

Start with native Developer Tools opened.

- -

-editor URL or -edit URL

- -

Start with editor (Composer) for the given URL (where URL is optional). SeaMonkey only.

- -
seamonkey -edit www.mozilla.org
-
- -

-inspector URL

- -

Start with the DOM Inspector, if installed, and inspect the given URL (where URL is optional).

- -

-jsdebugger

- -

Start application with Browser Toolbox (formerly Browser Debugger). That is different to Venkman debugger (see option -venkman).

- -

-jsconsole

- -

Start application with the Error Console, or, in Firefox, the Browser Console.

- -

-purgecaches

- -

Gecko (layout engine) has a javascript cache, which is not reset on startup. This clears it.

- -

-start-debugger-server port

- -

Firefox only. Start the debugger server on port. This will enable another instance of Firefox to connect the Firefox Developer Tools to this Firefox instance. See the article on remotely debugging Firefox Desktop.

- -

The port argument is optional, and if it is omitted, the server will listen on port 6000.

- -

-venkman

- -

Start with the JavaScript debugger, Venkman, if installed.

- -

XULRunner

- -

-app /path/to/application.ini

- -

Start a new process running the XULRunner application at path/to. Also works with Firefox version 3 and above.

- -

--install-app path/to/myapplication.(xpi|xulapp)

- -

Installs the XULRunner application at path/to onto the system. Applications are installed into the default location for your system (program files|Applications|usr/lib) at vendorname/applicationName.  Applications may be uninstalled per usual methods for your system.

- -
"C:\Program Files\Mozilla XULRunner\1.8.0.4\xulrunner\xulrunner.exe" --install-app "C:\Users\Billdo\Desktop\myapplication.xpi"
- -
/opt/xulrunner/1.8.0.4/xulrunner/xulrunner --install-app ~/Desktop/myapplication.xulapp
- -
/Library/Frameworks/XUL.framework/xulrunner-bin --install-app ~/Desktop/myapplication.xpi
- -

--register-global

- -

Registers XULRunner on the system for all users. Must be run as admin / root.

- -

--register-user

- -

Registers XULRunner for a single user.

- -

--unregister-global

- -

Unregisters XULRunner for all users.

- -

--unregister-user

- -

Unregisters XULRunner for a single user.

- -

Chrome

- -

-chrome chrome_URL

- -

Load the specified chrome.

- -
firefox -chrome chrome://inspector/content
-
- -

-register chrome_URL

- -

Register the specified chrome, but do not start application.

- -

Extras

- -

{{Gecko_MinVersion_Note(1.9.2, "-install-global-extension and -install-global-theme have been removed from Gecko 1.9.2 and upwards.")}}

- -

-install-global-extension /path/to/extension

- -

Installs the extension into the application directory. The parameter is the path to the extension. You must have administrative privileges.

- -

-install-global-theme /path/to/theme

- -

Same as above, but for themes. You must have administrative privileges.

- -
-

Note: Since Firefox 2.0.0.7, use of the -install-global-extension and -install-global-theme command line arguments have been restricted to only allow installing add-ons that are on local disks or mapped drives. Installing from a network share directly will no longer succeed.

-
- -

-safe-mode

- -

Launches the application with all extensions disabled, for that launch only. (Extensions are not loaded, but are not permanently disabled in the Extension Manager data source).

- -

Controlo remoto

- -

-remote remote_command {{Obsolete_Inline}}

- -
-

This feature was removed in Firefox 36.0, restored in 36.0.1 and removed again in 39.0. See {{bug(1080319)}}.

-
- -

Execute the specified remote_command in an already running application process.

- -
firefox -remote "openURL(www.mozilla.org, new-tab)"
-
- -
-

This option is only available on X-Windows Unix platforms.

-
- -

Diversos

- -

-attach-console

- -

Write messages for the debugging console into the window which launched the application instead of opening a new window for the debugging messages. Only supported on the Windows operating system.

- -

-console

- -

Start application with a debugging console. Note: Windows only.

- -

-h or -help or -?

- -

Print the list of all available command line options. Note that on Windows this only works with a redirection such as |more ({{Bug(355889)}}). This option is available only in a command console.

- -

-osint

- -

Tells the application that it is being launched by the OS shell. This should not be specified unless the caller provides all of the functionality provided by the OS shell when launching the application ({{Bug(384384)}}).

- -

-requestPending

- -

Tells the application that there will be a Windows DDE request to open the same url specified on the command line. This should not be specified unless the caller provides all of the functionality provided by the OS shell when launching the application ({{Bug(354005)}}).

- -

-silent

- -

Don't open default windows. Useful with those command-line arguments that open their own windows but don't already prevent default windows from opening. Firefox, Thunderbird3.x and SeaMonkey2.x only.

- -

-tray

- -

Start application minimized to system tray. Useful with autorun.

- -

-v or -version

- -

Print application version. Note that on Windows this only works with a redirection such as |more ({{Bug(355889)}}). This option is available only in a command console.

- -

X11 options

- -

These options are only available for an application build for and running atop the X11/X.org display and window system to be found on Linux and other Unix-based systems.

- -

--class=WM_CLASS

- -

Set the WM_CLASS resource class of the X11 windows created by the application.

- -

--display=DISPLAY

- -

Set the X display to use.

- -

--g-fatal-warnings

- -

Make all warnings fatal.

- -

--sync

- -

Make X calls synchronous.

- -

Outras opções que precisam de ser documentadas

- - - -

Referências

- - - -
-

Informação do Documento Original

- - -
- -

 

diff --git a/files/pt-pt/mozilla/performance/about_colon_memory/index.html b/files/pt-pt/mozilla/performance/about_colon_memory/index.html deleted file mode 100644 index 02878e1d31..0000000000 --- a/files/pt-pt/mozilla/performance/about_colon_memory/index.html +++ /dev/null @@ -1,187 +0,0 @@ ---- -title: 'about:memory' -slug: 'Mozilla/Performance/about:memory' -tags: - - Desempenho - - Relatório - - diagnóstico - - memoria -translation_of: 'Mozilla/Performance/about:memory' ---- -

about:memory is a special page within Firefox that lets you view, save, load, and diff detailed measurements of Firefox's memory usage. It also lets you do other memory-related operations like trigger GC and CC, dump GC & CC logs, and dump DMD reports. It is present in all builds and does not require any preparation to be used.

- -

Como gerar relatórios de memória

- -

Let's assume that you want to measure Firefox's memory usage. Perhaps you want to investigate it yourself, or perhaps someone has asked you to use about:memory to generate "memory reports" so they can investigate a problem you are having. Follow these steps.

- - - -

Note that in both cases the generated data contains privacy-sensitive details such as the full list of the web pages you have open in other tabs. If you do not wish to share this information, you can select the "anonymize" checkbox before clicking on "Measure and save..." or "Measure...". This will cause the privacy-sensitive data to be stripped out, but it may also make it harder for others to investigate the memory usage.

- -

Carregar relatórios de memória de um ficheiro

- -

The easiest way to load memory reports from file is to use the "Load..." button. You can also use the "Load and diff..." button to get the difference between two memory report files.

- -

Single memory report files can also be loaded automatically when about:memory is loaded by appending a file query string, for example:

- -
about:memory?file=/home/username/reports.json.gz
-
- -

This is most useful when loading memory reports files obtained from a Firefox OS device.

- -

Memory reports are saved to file as gzipped JSON. These files can be loaded as is, but they can also be loaded after unzipping.

- -

Interpretar os relatórios de memória

- -

Almost everything you see in about:memory has an explanatory tool-tip. Hover over any button to see a description of what it does. Hover over any measurement to see a description of what it means.

- -

Básico de cálculo

- -

Most measurements use bytes as their unit, but some are counts or percentages.

- -

Most measurements are presented within trees. For example:

- -
 585 (100.0%) -- preference-service
- └──585 (100.0%) -- referent
-    ├──493 (84.27%) ── strong
-    └───92 (15.73%) -- weak
-        ├──92 (15.73%) ── alive
-        └───0 (00.00%) ── dead
-
- -

Leaf nodes represent actual measurements; the value of each internal node is the sum of all its children.

- -

The use of trees allows measurements to be broken down into further categories, sub-categories, sub-sub-categories, etc., to arbitrary depth, as needed. All the measurements within a single tree are non-overlapping.

- -

Tree paths can be written using '/' as a separator. For example, preference/referent/weak/dead represents the path to the final leaf node in the example tree above.

- -

Sub-trees can be collapsed or expanded by clicking on them. If you find any particular tree overwhelming, it can be helpful to collapse all the sub-trees immediately below the root, and then gradually expand the sub-trees of interest.

- -

Secções

- -

Memory reports are displayed on a per-process basis, with one process per section. Within each process's measurements, there are the following subsections.

- -

Alocação Explícitas

- -

This section contains a single tree, called "explicit", that measures all the memory allocated via explicit calls to heap allocation functions (such as malloc and new) and to non-heap allocations functions (such as mmap and VirtualAlloc).

- -

Here is an example for a browser session where tabs were open to cnn.com, techcrunch.com, and arstechnica.com. Various sub-trees have been expanded and others collapsed for the sake of presentation.

- -
191.89 MB (100.0%) -- explicit
-├───63.15 MB (32.91%) -- window-objects
-│   ├──24.57 MB (12.80%) -- top(http://edition.cnn.com/, id=8)
-│   │  ├──20.18 MB (10.52%) -- active
-│   │  │  ├──10.57 MB (05.51%) -- window(http://edition.cnn.com/)
-│   │  │  │  ├───4.55 MB (02.37%) ++ js-compartment(http://edition.cnn.com/)
-│   │  │  │  ├───2.60 MB (01.36%) ++ layout
-│   │  │  │  ├───1.94 MB (01.01%) ── style-sheets
-│   │  │  │  └───1.48 MB (00.77%) -- (2 tiny)
-│   │  │  │      ├──1.43 MB (00.75%) ++ dom
-│   │  │  │      └──0.05 MB (00.02%) ── property-tables
-│   │  │  └───9.61 MB (05.01%) ++ (18 tiny)
-│   │  └───4.39 MB (02.29%) -- js-zone(0x7f69425b5800)
-│   ├──15.75 MB (08.21%) ++ top(http://techcrunch.com/, id=20)
-│   ├──12.85 MB (06.69%) ++ top(http://arstechnica.com/, id=14)
-│   ├───6.40 MB (03.33%) ++ top(chrome://browser/content/browser.xul, id=3)
-│   └───3.59 MB (01.87%) ++ (4 tiny)
-├───45.74 MB (23.84%) ++ js-non-window
-├───33.73 MB (17.58%) ── heap-unclassified
-├───22.51 MB (11.73%) ++ heap-overhead
-├────6.62 MB (03.45%) ++ images
-├────5.82 MB (03.03%) ++ workers/workers(chrome)
-├────5.36 MB (02.80%) ++ (16 tiny)
-├────4.07 MB (02.12%) ++ storage
-├────2.74 MB (01.43%) ++ startup-cache
-└────2.16 MB (01.12%) ++ xpconnect
- -

Some expertise is required to understand the full details here, but there are various things worth pointing out.

- - - -

Some add-on memory usage is identified, as the following example shows.

- -
├───40,214,384 B (04.17%) -- add-ons
-│   ├──21,184,320 B (02.20%) ++ {d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}/js-non-window/zones/zone(0x100496800)/compartment([System Principal], jar:file:///Users/njn/Library/Application%20Support/Firefox/Profiles/puna0zr8.new/extensions/%7Bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7D.xpi!/bootstrap.js (from: resource://gre/modules/addons/XPIProvider.jsm:4307))
-│   ├──11,583,312 B (01.20%) ++ jid1-xUfzOsOFlzSOXg@jetpack/js-non-window/zones/zone(0x100496800)
-│   ├───5,574,608 B (00.58%) -- {59c81df5-4b7a-477b-912d-4e0fdf64e5f2}
-│   │   ├──5,529,280 B (00.57%) -- window-objects
-│   │   │  ├──4,175,584 B (00.43%) ++ top(chrome://chatzilla/content/chatzilla.xul, id=4293)
-│   │   │  └──1,353,696 B (00.14%) ++ top(chrome://chatzilla/content/output-window.html, id=4298)
-│   │   └─────45,328 B (00.00%) ++ js-non-window/zones/zone(0x100496800)/compartment([System Principal], file:///Users/njn/Library/Application%20Support/Firefox/Profiles/puna0zr8.new/extensions/%7B59c81df5-4b7a-477b-912d-4e0fdf64e5f2%7D/components/chatzilla-service.js)
-│   └───1,872,144 B (00.19%) ++ treestyletab@piro.sakura.ne.jp/js-non-window/zones/zone(0x100496800)
- -

More things worth pointing out are as follows.

- - - -

Outros Cálculos

- -

This section contains multiple trees, includes many that cross-cut the measurements in the "explicit" tree. For example, in the "explicit" tree all DOM and layout measurements are broken down by window by window, but in "Other Measurements" those measurements are aggregated into totals for the whole browser, as the following example shows.

- -
26.77 MB (100.0%) -- window-objects
-├──14.59 MB (54.52%) -- layout
-│  ├───6.22 MB (23.24%) ── style-sets
-│  ├───4.00 MB (14.95%) ── pres-shell
-│  ├───1.79 MB (06.68%) ── frames
-│  ├───0.89 MB (03.33%) ── style-contexts
-│  ├───0.62 MB (02.33%) ── rule-nodes
-│  ├───0.56 MB (02.10%) ── pres-contexts
-│  ├───0.47 MB (01.75%) ── line-boxes
-│  └───0.04 MB (00.14%) ── text-runs
-├───6.53 MB (24.39%) ── style-sheets
-├───5.59 MB (20.89%) -- dom
-│   ├──3.39 MB (12.66%) ── element-nodes
-│   ├──1.56 MB (05.84%) ── text-nodes
-│   ├──0.54 MB (02.03%) ── other
-│   └──0.10 MB (00.36%) ++ (4 tiny)
-└───0.06 MB (00.21%) ── property-tables
- -

Some of the trees in this section measure things that do not cross-cut the measurements in the "explicit" tree, such as those in the "preference-service" example above.

- -

Finally, at the end of this section are individual measurements, as the following example shows.

- -
    0.00 MB ── canvas-2d-pixels
-    5.38 MB ── gfx-surface-xlib
-    0.00 MB ── gfx-textures
-    0.00 MB ── gfx-tiles-waste
-          0 ── ghost-windows
-  109.22 MB ── heap-allocated
-        164 ── heap-chunks
-    1.00 MB ── heap-chunksize
-  114.51 MB ── heap-committed
-  164.00 MB ── heap-mapped
-      4.84% ── heap-overhead-ratio
-          1 ── host-object-urls
-    0.00 MB ── imagelib-surface-cache
-    5.27 MB ── js-main-runtime-temporary-peak
-          0 ── page-faults-hard
-    203,349 ── page-faults-soft
-  274.99 MB ── resident
-  251.47 MB ── resident-unique
-1,103.64 MB ── vsize
- -

Some measurements of note are as follows.

- - diff --git a/files/pt-pt/mozilla/performance/comunicacao_de_um_problema_de_desempenho/index.html b/files/pt-pt/mozilla/performance/comunicacao_de_um_problema_de_desempenho/index.html deleted file mode 100644 index a641730856..0000000000 --- a/files/pt-pt/mozilla/performance/comunicacao_de_um_problema_de_desempenho/index.html +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: Comunicação de um Problema de Desempenho -slug: Mozilla/Performance/Comunicacao_de_um_problema_de_desempenho -tags: - - Desempenho - - Perfilar - - QA - - Testes -translation_of: Mozilla/Performance/Reporting_a_Performance_Problem ---- -

Este artigo irá guiá-lo na comunicação de um problema de desempenho utilizando a extensão do Gecko Profiler. Se preferir, também existe um tutorial em vídeo, em vez da leitura.

- -

Configurar a extensão Gecko Profiler

- -
    -
  1. Transferir e instalar a última versão da extensão Gecko Profiler
  2. -
  3. A exntensção de perfilar irá aparecer no topo à direita da barra do URL como um ícone globo (se não, arraste-a para lá da janela de Personalizar).
    -
    - The Gecko Profiler Add-on installed and visible within the Nightly toolbar.
  4. -
  5. Lembre-se de desativar ou desinstalar a extensão se a não estiver a utilizar.
  6. -
- -

Apenas macOS, ou para verificar se um problema foi corrigido numa versão posterior do Firefox (as compilações do macOS atualmente irão produzir informação importante dos perfis em falta):

- -
    -
  1. Transferir e instalar a compilação nightly para a sua platforma. Terá de fechar todas as instâncias do Firefox antes de executar nightly.
  2. -
  3. Nightly é uma versão de desenvolvimento, que pode conter erros, por isso, teste com um novo perfil ou efetue uma cópia de segurança dos seus dados.
  4. -
  5. Verifique se está a funcionar corretamente, indo até 'Sobre Nightly' procurando por 'nightly' como o canal de atualização (3ª. linha). O ícone deverá ser um globo azul .
  6. -
- -

Using the Add-on

- -

Once installed, the profiler becomes active immediately (the icon being blue indicates it is active). The profiler uses a fixed size buffer to store sample data. When it runs out of space in its buffer, it discards old entries so you may want to increase the buffer size if you find you are unable to capture the profile quickly enough after you notice a performance problem. In the Settings part of the UI you can adjust the size of the buffer (presently defaults to 9 MB) and the time interval between data collection (presently defaults to 1 ms). Note that increasing the buffer size uses more memory and can make capturing a profile take longer.

- -

Profiler UI

- -

Using the keyboard shortcuts is often more convenient than using the mouse to interact with the UI:

- - - -

Capturing and sharing a profile

- -
    -
  1. Reproduce the performance problem. If possible let the problem manifest itself for 5-10 seconds.
  2. -
  3. Press Ctrl+Shift+2 or click on the 'Globe' icon in the top right and select 'Capture Profile'. Try to do this within a few seconds from reproducing the performance problem as only the last few seconds are recorded. If the timeline has a large red block it's a good sign.
    - Jank markers appearing in the Perf.html profile analysis tool.
  4. -
  5. The data will open in a new tab. Wait until the "Waiting for symbol tables for library libxul.pdb..." notification disappears before sharing the profile.
  6. -
  7. There will be a button in the top right labeled 'Share' which will upload this profile and once completed will write out a link. Copy this URL to your clipboard by right clicking and add the profile URL to the bug for your performance problem and/or send it to the appropriate person. Try to give some context about what you were doing when the performance problem arose such as the URL you were viewing and what actions were you doing (ex. scrolling on gmail.com).
    - The button for sharing a profile.
  8. -
diff --git a/files/pt-pt/mozilla/performance/index.html b/files/pt-pt/mozilla/performance/index.html deleted file mode 100644 index 44fcdebce2..0000000000 --- a/files/pt-pt/mozilla/performance/index.html +++ /dev/null @@ -1,145 +0,0 @@ ---- -title: Performance -slug: Mozilla/Performance -tags: - - Add-ons - - Debugging - - Depuração - - Desempenho - - Desenvolvimento - - Development - - Extras - - Mozilla - - Performance -translation_of: Mozilla/Performance ---- -

The articles linked to from here will help you improve performance, whether you're developing core Mozilla code or an add-on.

- - - - - - - - -
-

Documentação

- -
-
Reporting a Performance Problem
-
A user friendly guide to reporting a performance problem. A development environment is not required.
-
Benchmarking
-
Tips on generating valid performance metrics.
-
Performance best practices in extensions
-
A performance "best practices" guide for extension developers.
-
Measuring Add-on Startup Performance
-
A guide for add-on developers on how to set up a performance testing environment.
-
XUL School: Add-on Performance
-
Tips for add-on developers to help them avoid impairing application performance.
-
GPU performance
-
Tips for profiling and improving performance when using a GPU.
-
Scroll-Linked Effects
-
Information on scroll-linked effects, their effect on performance, related tools, and possible mitigation techniques.
-
Automated Performance Testing and Sheriffing
-
Information on automated performance testing and sheriffing at Mozilla.
-
Best practices for Front-end Engineers
-
Tips for reducing impacts on browser performance in front-end code.
-
- -

View all pages tagged with "Performance"...

- -

Memory profiling and leak detection tools

- -
-
The Developer Tools "Memory" panel
-
The memory panel in the devtools supports taking heap snapshots, diffing them, computing dominator trees to surface "heavy retainers", and recording allocation stacks.
-
- -
-
about:memory
-
about:memory is the easiest-to-use tool for measuring memory usage in Mozilla code, and is the best place to start. It also lets you do other memory-related operations like trigger GC and CC, dump GC & CC logs, and dump DMD reports. about:memory is built on top of Firefox's memory reporting infrastructure.
-
DMD
-
DMD is a tool that identifies shortcomings in about:memory's measurements, and can also do multiple kinds of general heap profiling.
-
Are We Slim Yet
-
areweslimyet.com (a.k.a. AWSY) is a memory usage and regression tracker.
-
BloatView
-
BloatView prints per-class statistics on allocations and refcounts, and provides gross numbers on the amount of memory being leaked broken down by class. It is used as part of Mozilla's continuous integration testing.
-
Refcount tracing and balancing
-
Refcount tracing and balancing are ways to track down leaks caused by incorrect uses of reference counting. They are slow and not particular easy to use, and thus most suitable for use by expert developers.
-
GC and CC logs
-
GC and CC logs can be generated and analyzed to in various ways. In particular, they can help you understand why a particular object is being kept alive.
-
Valgrind
-
Valgrind is a tool that detects various memory-related problems at runtime, including leaks. Valgrind is used as part of Mozilla's continuous integration testing, though the coverage is limited because Valgrind is slow.
-
LeakSanitizer
-
LeakSanitizer (a.k.a. LSAN) is similar to Valgrind, but it runs faster because it uses static source code instrumentation. LSAN is part of Mozilla's continuous integration testing, with most tests running through it as part of the AddressSanitizer (a.k.a. ASAN) test jobs.
-
Apple tools
-
Apple provides some tools for Mac OS X that report similar problems to those reported by LSAN and Valgrind. The "leaks" tool is not recommended for use with SpiderMonkey or Firefox, because it gets confused by tagged pointers and thinks objects have leaked when they have not (see bug 390944).
-
Leak Gauge
-
Leak Gauge is a tool that can be used to detect certain kinds of leaks in Gecko, including those involving documents, window objects, and docshells.
-
LogAlloc
-
LogAlloc is a tool that dumps a log of memory allocations in Gecko. That log can then be replayed against Firefox's default memory allocator independently or through another replace-malloc library, allowing the testing of other allocators under the exact same workload.
-
Memory Profiler
-
The memory profiler samples allocation events and provides different views to analyze the allocation characteristic.
-
- -

See also the documentation on Leak-hunting strategies and tips.

-
-

Profiling and performance tools

- -
-
Profiling with the Developer Tools Profiler
-
The profiler built into the developer tools has a high-level waterfall, detailed call tree, allocations and GC profiling, and flame graphs. It is available on all platforms and release channels, and also supports remote profiling b2g and Fennec.
-
- -
-
Profiling with the Gecko Profiler {{ gecko_minversion_inline("16.0") }}
-
The Gecko Profiler is a good tool to start with, particularly for understanding where time is spent within C++ code in Firefox.
-
Profiling with Instruments
-
How to use Apple's Instruments tool to profile Mozilla code.
-
Profiling with Xperf
-
How to use Microsoft's Xperf tool to profile Mozilla code.
-
Profiling with Concurrency Visualizer
-
How to use Visual Studio's Concurrency Visualizer tool to profile Mozilla code.
-
Profiling with Zoom
-
Zoom is a profiler for Linux done by the people who made Shark
-
Measuring performance using the PerfMeasurement.jsm code module {{ gecko_minversion_inline("2.0") }}
-
Using PerfMeasurement.jsm to measure performance data in your JavaScript code.
-
Adding a new Telemetry probe
-
Information on how to add a new measurement to the Telemetry performance-reporting system
-
Profiling JavaScript with Shark (obsolete - replaced by Instruments)
-
How to use the Mac OS X Shark profiler to profile JavaScript code in Firefox 3.5 or later.
-
Profiling with Shark (obsolete - replaced by Instruments)
-
How to use Apple's Shark tool to profile Mozilla code.
-
Investigating CSS Performance
-
How to figure out why restyle is taking so long
-
- -

Power profiling

- -
-
Power profiling overview
-
This page provides an overview of relevant information, including details about hardware, what can be measured, and recommended approaches. It should be the starting point for anybody new to power profiling.
-
tools/power/rapl (Mac, Linux)
-
tools/power/rapl is a command-line utility in the Mozilla codebase that uses the Intel RAPL interface to gather direct power estimates for the package, cores, GPU and memory.
-
powermetrics (Mac-only)
-
powermetrics is a command-line utility that gathers and displays a wide range of global and per-process measurements, including CPU usage, GPU usage, and various wakeups frequencies.
-
TimerFirings logging (All platforms)
-
TimerFirings logging is a built-in logging mechanism that prints data on every time fired.
-
Activity Monitor, Battery Status Menu and top (Mac-only)
-
The battery status menu, Activity Monitor and top are three related Mac tools that have major flaws but often consulted by users, and so are worth understanding.
-
Intel Power Gadget (Windows, Mac, Linux)
-
Intel Power Gadget provides real-time graphs for package and processor RAPL estimates. It also provides an API through which those estimates can be obtained.
-
perf (Linux-only)
-
perf is a powerful command-line utility that can measure many different things, including energy estimates and high-context measurements of things such as wakeups.
-
turbostat (Linux-only)
-
turbostat is a command-line utility that gathers and displays various power-related measurements, with a focus on per-CPU measurements such as frequencies and C-states.
-
powertop (Linux-only)
-
powertop is an interactive command-line utility that gathers and displays various power-related measurements.
-
- -

Rópicos Relacionados

- -
-
JavaScript, XPCOM, Developing Mozilla, Extensions, Addons
-
-
diff --git a/files/pt-pt/mozilla/performance/perfilar_com_o_profiler_integrado/index.html b/files/pt-pt/mozilla/performance/perfilar_com_o_profiler_integrado/index.html deleted file mode 100644 index 0a34c2bc64..0000000000 --- a/files/pt-pt/mozilla/performance/perfilar_com_o_profiler_integrado/index.html +++ /dev/null @@ -1,356 +0,0 @@ ---- -title: Perfilar com o Gecko Profiler -slug: Mozilla/Performance/Perfilar_com_o_Profiler_integrado -tags: - - Desempenho - - Desenvolvimento da Mozilla - - Perfilar -translation_of: Mozilla/Performance/Profiling_with_the_Built-in_Profiler ---- -

{{ gecko_minversion_header("16.0") }}

- -
-

O Gecko Profiler é um profiler que está integrado no Firefox. Possui uma integração mais apertada com o Firefox do que os profilers externos, e também pode ser utilizado em situações em que os profilers externos não estão disponíveis, tal como numa máquina de não desenvolvimento ou num dispositivo Android bloqueado

-
- -
-

The Gecko Profiler has been previously known as "SPS" and "the built-in profiler". We have changed as many references to the old names as possible, but there may still be some around.

-
- -

Obter o Extra Gecko Profiler

- -

First things first, you want to make sure you are using the correct build of Firefox.  An official Nightly or Beta or Release build would work.  If you are using a local build, make sure you have the --enable-profiling option turned on in your mozconfig.

- -

The Gecko Profiler has two interfaces:

- -
    -
  1. for Web developers there is a simplified profiler that can be opened from the menu Tools > Web Developer > Performance.
  2. -
  3. a more advanced interface for developers of Mozilla's internals can be accessed by installing the Gecko Profiler add-on (more details on installation are available).
  4. -
- -
-

Reporting a Performance Problem has a step-by-step guide for obtaining a profile when requested by Firefox developers.

- -

Reporting a Thunderbird Performance Problem has a step-by-step guide for obtaining a profile when requested by Thunderbird developers.

-
- -

Compreender os Perfis

- -

You can check out some frequently asked questions about the Gecko Profilers.

- -

Here's a video of Ehsan examining some profiles:

- -

- -

- -
-

If there are features you would find helpful, please file a bug with details.

-
- -

Interface

- -

1. Timeline

- -

- -

The timeline has several rows of tracing markers (colored segments) which indicate interesting events. Hover over them to see more information. Below the tracing markers are rows corresponding with activity on a variety of threads.

- -
-

Tip: Threads that are annotated with "[default]" are in the parent (aka "UI", aka "browser chrome", aka "main") process and those annotated with "[tab]" are in the Web content (aka "child") processes.

-
- -
-

Tip: Long-running tasks in the parent process will block all input or drawing with the browser UI (aka "UI jank") whereas long-running tasks in the content process will block interactivity with the page but still allowing the user to pan and zoom around thanks to APZ.

-
- -
Tracing markers
- - - -
Ranges
- -

Timeline showing ranged breadcrumbs and zoom icon

- -

Ranges of time can be zoomed in on by clicking and dragging anywhere in the tracing marker or thread areas. Once a range is selected, a magnifying glass appears which zooms into that range. Clicking on a tracing marker will create a selection corresponding with its duration allowing for easy zooming in on interesting time ranges. As you zoom in on ranges, breadcrumbs are created allowing you to easily navigate back to previously-selected ranges or the entire profile (denoted as "Full Range").

- -
-

Tip: While zooming out to a previously-selected range deletes the narrower range, the browser back button can be used to restore the narrower range.

-
- -
Thread Timeline(s)
- -

Thread/Process Timelines: Below the tracing markers we have a list of profiled threads. These threads may come from different processes. In this case, we have the 'GeckoMain [default]' process' main thread, a content process' main thread, and the main thread of the compositor process. Each of these timelines is aligned with wall clock time. So, for example, when a thread is blocked, like 'GeckoMain [tab]', on a thread like 'GeckoMain [default]', we can see what's occurring on the latter thread that is preventing it from responding to the former.

- -

X (Time) axis: The timelines go from left to right as wall clock time increases along the X axis. Elements in the timeline are spaced at the sampling frequency with an attempt to align them with time. Factors such as sampling or stack-walking variance and system load can lead to sampling delays which manifest as gaps in the timeline.

- -
-

Nota: because this is a sampling profiler, be cautious when examining running time that is equal to the sampling interval. For very time-sensitive profiling, you may want to consider a non-sampling profiler.

-
- -

Y (Stack) axis: The Y axis is the stack depth, not the CPU activity. The change in stack height is useful to find patterns like long blocking calls (long flatlines) or very tall spiky blocks (recursive calls and JS). With more experience you can read profiles faster by recognizing patterns. Also note that you can click on timeline elements (the selected element gets darker when selected) and the tree view (see below) reflects the selected element.

- - - -

2. Call Tree

- -

- -

The Call Tree shows the samples organized by 'Running Time' which will show the data by wall clock time. There are lighter grey names to the right of tree elements that indicate where the code comes from. Be aware that elements can be from JavaScript, Gecko, or system libraries. Note that if some functions are not yet named properly, symbolication may not yet be finished.

- -
-

Dica: You can right-click on a function name to get an option to copy its name to the clipboard.

-
- -

A significant portion of time can be spent in idle, blocking calls like waiting for events. This is ideal for a responsive application to be ready to service incoming events. There are OS-specific waiting functions like NtWaitForMultipleObjects seen in the example above taken on Windows or mach_msg_trap on macOS.

- -
-

Dica: You can quickly go deeper into the call tree by holding down your right arrow key. Alternatively, expand an entire tree segment by holding Alt and clicking on the arrow to the left of the collapsed tree segment.

-
- -

As we progress into a more specific part of the tree, you'll notice that the 'Running time' decreases. This happens when a function has 2 or more non-trivial calls: the running time will be split between its children.

- -
-

Dica: Focus on one section of the tree by clicking on the "arrow-in-a-circle" icon that appears to the right of the tree element as you hover over it. A "tree breadcrumb" will appear similar to the range breadcrumbs noted above.

-
- -

Clicking the "JavaScript only" option will only show JavaScript code in the Call Tree. You could compare the time with this option checked and the total time to get an idea of how much time was spent running JS. Note that long-running JS function execution may not actually be taking as long as you think because further down the call stack there may be something like painting happening.

- -

Clicking the "Invert call stack" option will sort by the time spent in a function in descending order. Note that the running time here is only the running time of that particular frame and not the total of all called instances of that function. You can see the samples in the Timeline get darker as you select different functions in the Call Tree; these are samples that were taken when the selected function was running.

- -

"Filter stacks" will allow you to search for functions by name. One of the easiest ways to find slowness caused by a page's JS is to type its URL into the "Filter stacks" box. You can then select corresponding Call Tree entries and watch the Timeline for entries in the content process main thread that get darker as you select Call Tree entries.

- -
-

Tip: If things are blank elsewhere in the UI, you may have text entered into the "Filter stacks" box.

-
- -
Custom Annotations
- -

In bug 1334218 an annotation was added to PresShell::Paint to show the URL of the document being painted. These annotations are not too complex to add so if you would like something added, file a bug.

- -

3. Partilhar o perfil

- -

Click "Share..." > Share acknowledging that the URLs you had open and your Firefox extensions will be included in the profile data sent to the server. If you select a different time range, the URL revealed by pressing "Permalink" will change so that you can be sure the recipient of the URL will see the same things you are seeing.

- -

Dicas

- -

Understanding profiles can be difficult. If you're unfamiliar with Gecko's internals, you can click the JavaScript only button to see where your JavaScript code is slow. Each entry in the Call Tree shows a call stack and how much time is spent in that call stack. For example:In the results above we can see that we're spending ~287 milliseconds in Startup::XRE_InitChildProcess, 194 ms of which are spent in PVsync::Msg_Notify and all child functions that it calls. It is useful to scan down the "Running Time" column and look for when the time changes. While looking for performance problems, you're looking for the processes that are taking the most time; then you can figure out how to optimize them.

- -

Erros (Bugs) de Desempenho Comuns no Firefox

- -

Inefficient code that is on the reflow or restyle paths is often to blame for jank. So is code that is run often in the parent process or in parts of the codebase that apply to many users.

- -

Synchronous re-flow can be caused by JS that, for example, makes changes to the page content in a loop and queries about the layout of the page in that same loop.

- -

A PresShell:Flush means that we are either recomputing styles or recomputing layout. These sorts of flushes should be avoided if possible, as they can be quite expensive. Keep your eyes out for flushes like this that are blocking the main thread for a long time. If you notice these things happening in a loop, that's a bug to be fixed, since we're likely "layout thrashing".

- -

Some more tips and answers to common questions are available in a mid-2017 FAQ document.

- -

It's a good idea to search bugzilla before filing a bug about a performance problem in Firefox but sometimes it's hard to find issues that have already been reported. Therefore, it's usually a good idea to file a bug.

- -

Perfilar compilações (builds) locais do Windows

- -

If you built Firefox for Windows locally and you would like to use the local symbols with the profiler, you will need to run an additional tool; see Profiling with the Gecko Profiler and Local Symbols on Windows.

- -

Perfilar compilações (builds) Try

- -

The profiler currently doesn't really support symbolication for profiles from Try builds. For Linux builds, there seem to be symbols inside the binaries, which the profiler should pick up correctly. But on Windows and macOS, you'll have to do some tricks to make it work:

- -
    -
  1. Put your firefox build into a directory with the name dist.
  2. -
  3. Download the crashreporter symbols zip for your build. It should be one of the "artifacts" of the build job of your try build.
  4. -
  5. Unzip the crashreporter symbols into dist/crashreporter-symbols/.
  6. -
  7. Now profile as usual.
  8. -
- -

(This abuses the symbolication logic for local builds. It's at ext-geckoProfiler.js and may stop working at any time.)

- -

Perfilar móvel Firefox

- -
    -
  1. For local builds of Fennec, you should build with optimization and STRIP_FLAGS="--strip-debug" but NOT with --enable-profiling. Nightly builds are already built with the appropriate flags.
  2. -
  3. You'll need to have adb and arm-eabi-addr2line (which is part of the Android NDK) in your bash PATH, so use locate arm-eabi-addr2line (on Linux) or mdfind name:arm-eabi-addr2line (on OS X) and stick an export to its location in ~/.bash_profile. The extension will invoke bash to use adb and addr2line.
  4. -
  5. Install the latest pre-release build in your host machine's Firefox browser that has your phone reachable via ADB. This will add a icon in the top right of the browser.
  6. -
  7. Set devtools.debugger.remote-enabled to true in about:config for Fennec.
  8. -
  9. Select target Mobile USB and press Connect. The first run will take an additional 1 minute or so to pull in the required system libraries.
  10. -
- -

Profiling Firefox Startup

- -
    -
  1. Start your Firefox with the environment variable MOZ_PROFILER_STARTUP=1 set. This way the profiler is started as early as possible during startup.
  2. -
  3. Then capture the profile using the add-on as usual.
  4. -
- -

Startup profiling does not use the settings that you configured in the add-on's panel. It uses settings that can be configured with the environment variables MOZ_PROFILER_STARTUP_ENTRIES and MOZ_PROFILER_STARTUP_INTERVAL:

- - - -

Profiling JS benchmark (xpcshell)

- -
    -
  1. To profile the script run.js with IonMonkey (-I), type inference (-n) and JäegerMonkey (-m). Thgis requires the following command: - -
    $ xpcshell -m -I -n -e '
    -    const Ci = Components.interfaces;
    -    const Cc = Components.classes;
    -    var profiler = Cc["@mozilla.org/tools/profiler;1"].getService(Ci.nsIProfiler);
    -    profiler.StartProfiler(
    -      10000000 /* = profiler memory */,
    -      1 /* = sample rate: 100µs with patch, 1ms without */,
    -      ["stackwalk", "js"], 2 /* = features, and number of features. */
    -    );
    -  ' -f ./run.js -e '
    -    var profileObj = profiler.getProfileData();
    -    print(JSON.stringify(profileObj));
    -  ' | tail -n 1 > run.cleo
    - The xpcshell output all benchmark information and on its last line it output the result of the profiling, you can filter it with tail -n 1 and redirect it to a file to prevent printing it in your shell.  The expected size of the output is around 100 of MB.
  2. -
  3. To add symbols to your build, you need to call ./scripts/profile-symbolicate.py available in B2G repository. -
    $ GECKO_OBJDIR=<objdir> PRODUCT_OUT=<objdir> TARGET_TOOLS_PREFIX= \
    -    ./scripts/profile-symbolicate.py -o run.symb.cleo run.cleo
    -
  4. -
  5. Clone Cleopatra and start the server with ./run_webserver.sh.
  6. -
  7. Access Cleopatra from your web browser by loading the page localhost:8000, and upload run.symb.cleo to render the profile with most of the symbol information.
  8. -
- -

Native stack vs. Pseudo stack

- -

The profiler periodically samples the stack(s) of thread(s) in Firefox, collecting a stack trace, and presents the aggregated results using the Cleopatra UI.  Stack traces can be collected into two different ways: Pseudostack (the default) or Nativestack.

- -

Native stack

- -

Native stacks are the normal stacks most developers are used. They are the default.

- -

Pseudostack

- -

The pseudostack uses function entry/exit tags added by hand to important points in the code base.  The stacks you see in the UI are chains of these tags.  This is good for highlighting particularly interesting parts of the code, but they miss out on un-annotated areas of the code base, and give no visibility into system libraries or drivers.

- -

Tagging is done by adding macros of the form AUTO_PROFILER_LABEL("NAMESPACE", "NAME"). These add RAII helpers, which are used by the profiler to track entries/exits of the annotated functions.  For this to be effective, you need to liberally use AUTO_PROFILER_LABEL throughout the code. See GeckoProfiler.h for more variations like AUTO_PROFILER_LABEL_DYNAMIC.

- -

Because of the non-zero overhead of the instrumentation, the sample label shouldn't be placed inside hot loops.  A profile reporting that a large portion is spent in "Unknown" code indicates that the area being executed doesn't have any sample labels.  As we focus on using this tool and add additional sample labels coverage should improve.

- -

Sharing, saving and loading profiles

- -

After capturing and viewing a profile you will see "Share..." and "Save as file..." buttons in the top-right of the window. Sharing will upload your profile to perf-html.io and make it public. More information on sharing profiles is available.

- -

Profiling a hung process

- -

It is possible to get profiles from hung Firefox processes using lldb1.

- -
    -
  1. After the process has hung, attach lldb.
  2. -
  3. Type in2, : -
    p (void)profiler_save_profile_to_file("somepath/profile.txt")
    -
  4. -
  5. Clone mstange’s handy profile analysis repository.
  6. -
  7. Run: -
    python symbolicate_profile.py somepath/profile.txt
    - -

    To graft symbols into the profile. mstange’s scripts do some fairly clever things to get those symbols – if your Firefox was built by Mozilla, then it will retrieve the symbols from the Mozilla symbol server. If you built Firefox yourself, it will attempt to use some cleverness3 to grab the symbols from your binary.

    - -

    Your profile will now, hopefully, be updated with symbols. Upload it for further analysis!

    - -

    I haven’t yet had the opportunity to try this, but I hope to next week. I’d be eager to hear people’s experience giving this a go – it might be a great tool in determining what’s going on in Firefox when it’s hung!

    -
  8. -
- -

Profiling Threads

- -

The Gecko Profiler has rudimentary support for profiling multiple threads. To enable it, check the 'Multi-Thread' box then enter one or more thread names into the textbox beside it. Thread names are the strings passed to the base::Thread class at initialization. At present there is no central list of these thread names, but you can find them by grepping the source.

- -

Examples: 1 2

- -

If the filter you entered is invalid, no threads will be profiled. You can identify this by hitting Analyze (Cleopatra will show you an error message). If the filter is left empty, only the main thread is captured (as if you had not enabled Multi-Thread.)

- -

Profiler Features

- -

The profiler supports several features. These are options to gather additional data in your profiles. Each option will increase the performance overhead of profiling so it's important to activate only options that will provide useful information for your particular problem to reduce the distortion.

- -

Stackwalk

- -

When taking a sample the profiler will attempt to unwind the stack using platform specific code appropriate for the ABI. This will provide an accurate callstack for most samples. On ABIs where framepointers are not avaiable this will cause a significant performance impact.

- -

JS Profiling

- -

Javascript callstacks will be generated and interleaved with the c++ callstacks. This will introduce an overhead when running JS.

- -

GC Stats

- -

Will embed GC stats from 'javascript.options.mem.notify' in the profile.

- -

Main Thread IO

- -

This will interpose file I/O and report them in the profiles.

- -

Multi-Thread

- -

This will sample other threads. This fields accept a comma seperated list of thread names. A thread can only be profiled if it is registered to the profiler.

- -

GPU

- -

This will insert a timer query during compositing and show the result in the Frames view. This will appropriate how much GPU time was spent compositing each frame.

- -

Layers & Texture

- -

The profiler can be used to view the layer tree at each composite, optionally with texture data. This can be used to debug correctness problems.

- -

Viewing the Layer Tree

- -

To view the layer tree, the layers.dump pref must be set to true in the Firefox or B2G program being profiled.

- -

In addition, both the compositor thread and the content thread (in the case of B2G, the content thread of whichever app you're interested in) must be profiled. For example, on B2G, when profiling the Homescreen app, you might start the profiler with:

- -
./profile.sh start -p b2g -t Compositor && ./profile.sh start -p Homescreen
-
- -

Having gotten a profile this way, the layer tree for a composite can be seen by clicking on a composite in the "Frames" section of Cleopatra (you may need to a sub-range of samples to make individual composites large enough to be clicked). This will activate the "LayerTree" tab:

- -

Screenshot of layer tree view in Cleopatra, with no textures.

- -

In this screenshot, Composite #143 has been selected. The layer tree structure can be seen in the left panel. It contains, for each layer, the type of the layer, and various metrics about the layer, such as the visible region and any transforms. In the right panel, a visualization of the layer tree (based entirely on the aforementioned metrics) is shown. Hovering over a layer in the left panel highlights the layer in the right panel. This is useful for identifying what content each layer corresponds to. Here, I'm hovering over the last layer in the layer tree (a PaintedLayerComposite), and a strip at the top of the right panel is highlighted, telling me that this layer is for the system notification bar in B2G.

- -

Viewing Textures

- -

Sometimes, it's useful to see not only the structure of the layer tree for each composite, but also the rendered textures for each layer. This can be achieved by additionally setting the layers.dump-texture pref to true, or by adding -f layersdump to the profiler command line (the latter implies both the layers.dump and layers.dump-texture prefs).

- -
-

Warning: Dumping texture data slows performance considerably, and requires a lot of storage for the profile files. Expect rendering to happen at a significantly reduced frame rate when profiling this way, and keep the duration of the capture short, to ensure the samples of interest aren't overwritten.

-
- -

Here's how the Layer Tree view looks in Cleopatra with texture data:

- -

Screenshot of layer tree view in Cleopatra, with textures.

- -

This time, the visualization in right panel shows the actual textures rather than just the outlines of the layers. This can be very useful for debugging correctness problems such as a temporary visual/rendering glitch, because it allows you to find the precise composite that shows the glitch, and look at the layer tree for that composite.

- -

Visualizing a layer tree without a profile

- -

If you have a layer dump from somewhere (such as from adb logcat on B2G), you can get Cleopatra to visualize it (just the structure of course, not textures) without needing a profile. To do so, paste the layer dump into the "Enter your profile data here" text field on the front page of Cleopatra:

- -

Screenshot of front page of Cleopatra, with pasted layer dump.

- -

The resulting "profile" will have the Layer Tree view enabled (but nothing else). This is useful in cases where you want to gain a quick visual understanding of a layer dump without having to take a profile.

- -
-

On B2G, each line of a layer dump in adb logcat output is prefixed with something like I/Gecko   (30593):. Cleopatra doesn't currently understand this prefix, so it needs to be removed before pasting.

-
- -

Display List

- -

Dump the display list after each refresh with the texture data. This can be used to debug correctness problems.

- -

Contribuir

- - diff --git a/files/pt-pt/mozilla/persona/index.html b/files/pt-pt/mozilla/persona/index.html deleted file mode 100644 index 12a9d58796..0000000000 --- a/files/pt-pt/mozilla/persona/index.html +++ /dev/null @@ -1,153 +0,0 @@ ---- -title: Persona -slug: Mozilla/Persona -translation_of: Archive/Mozilla/Persona ---- -
-

Acompanhe ou peça ajuda!

-

Siga nosso blog, join our mailing list, or find us in #identity on IRC.

-
-

Mozilla Persona é um sistema de autenticação completamente descentralizado e seguro para a web baseado no protocolo aberto BrowserId. Para garantir que Persona funcione em todo lugar e para todos, Mozilla atualmente opera uma pequena suíte de serviços opcionais, centralizados.

-

Por quê você e seu site deveriam usar Persona?

-
    -
  1. Persona elimina completamente senhas para sites específicos, libertando usuários e sites do fardo de criar, gerir e armazenar seguramente senhas.
  2. -
  3. Persona é fácil de usar. Com apenas dois cliques um usuário Persona pode se cadastrar em um novo site, como Voost ou The Times Crossword, ignorando o desgaste associado à criação de contas.
  4. -
  5. Persona é fácil de implementar. Desenvolvedores podem adicionar Persona à um site em uma única tarde.
  6. -
  7. Melhor de tudo, não há bloqueio. Desenvolvedores adquirem um endereço de email para todos seus usuários, e usuários podem usar qualquer endereço de email com Persona.
  8. -
  9. Persona é baseado no protocolo BrowserID. Quando os navegadores populares implementarem BrowserID, eles não irão precisar depender da Mozilla para logar.
  10. -
-

Leia e comece!

-
- Note: Persona is in active development. Follow our blog to learn about new features, or join our mailing list and offer your feedback!
-

Using Persona on your site

- - - - - - - - - - - -
-

Getting started

-
-
- Why Persona?
-
- Learn about reasons to support Persona on your site, and how it compares to other identity and authentication systems.
-
- Quick setup
-
- A quick walkthrough showing how to add Persona to your website.
-
-
-

Persona API reference

-
-
- The navigator.id API reference
-
- Reference for the navigator.id object, which web developers can use to integrate Persona into sites.
-
- Verification API reference
-
- Reference for the remote verification API hosted at https://verifier.login.persona.org/verify.
-
-
-

Guides

-
-
- Security considerations
-
- Practices and techniques to make sure your Persona deployment is secure.
-
- Browser compatibility
-
- Learn exactly which browsers support Persona.
-
- Internationalization
-
- Learn how Persona handles different languages.
-
-
-

Resources

-
-
- Libraries and plugins
-
- Find a drop-in library for your favorite programming language, web framework, blog, or content management system.
-
- The Persona cookbook
-
- Example source code for Persona sites. Includes snippets in PHP, Node.JS, and more.
-
- Branding resources
-
- Sign in buttons and other graphics to help present Persona to your users.
-
-
-

 

- - - - - - - -
-

Information for Identity Providers

-

If you're an email provider or another identity-providing service, check out the links below to learn about becoming a Persona Identity Provider.

-
-
- IdP Overview
-
- A high level view of Persona Identity Providers.
-
- Implementing an IdP
-
- A detailed guide to the technical details of becoming an IdP.
-
- Development tips
-
- A set of tips and tricks useful while developing a new Identity Provider.
-
- .well-known/browserid
-
- An overview of the structure and purpose of the .well-known/browserid file, which IdPs use to advertise their support for the protocol.
-
-
-

The Persona Project

-
-
- Glossary
-
- BrowserID and Persona terminology defined.
-
- FAQ
-
- Answers to common questions.
-
- Protocol overview
-
- A mid-level technical overview of the underlying BrowserID protocol.
-
- Crypto
-
- A look at the cryptographic concepts behind Persona and BrowserID.
-
- The Spec
-
- Deep technical details live here.
-
- The Persona Website
-
- To get Persona going, we're hosting three services at https://login.persona.org: a fallback Identity Provider, a portable implementation of the {{ domxref("navigator.id") }} APIs, and an identity assertion verification service.
-
- The Persona Source Code
-
- The code behind the Persona website lives in a repository on GitHub. Patches welcome!
-
-
-

 

diff --git a/files/pt-pt/mozilla/phishing/index.html b/files/pt-pt/mozilla/phishing/index.html deleted file mode 100644 index e553586c69..0000000000 --- a/files/pt-pt/mozilla/phishing/index.html +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: 'Phishing: uma breve definição' -slug: Mozilla/Phishing -tags: - - Segurança -translation_of: Mozilla/Phishing ---- -

Em 2014, a MSCI estimatou um impacto global anual do phishing e várias formas de roubo de identidade, chegando a US $5 bilhões. O impacto não melhorou desde então.

- -

Phishing is an attempt to collect sensitive information, such as usernames, passwords, and financial details by disguising as a trustworthy entity online.

- -

A relatively simple, yet effective, phishing scheme is sending an email with a fake invoice of a person’s favorite shopping site. This email will usually contain a link pretending to lead to the original service, but in reality, taking the victim to an attacker-controlled website. The login portal might resemble the trusted website's login page very closely, and convince users to enter their credentials, letting others hijack their account.

- -

Contramedidas passadas e atuais

- -

Various technical, and social approaches, exist to combat phishing attacks. None of these are sufficient by themselves, so we see a mix of these deployed by various services. The following is a non-exhaustive list of the most common approaches.

- -

Deitando a culpa aos utilizadores

- -

Some quick-to-implement, and cost-effective solutions, hold users accountable for their actions instead of restricting what’s technically possible. Earlier responses by affected banks, and payment providers, was to attempt educating users to not click links in emails, along with requesting to verify email legitimacy through checking for relevant personal information.

- -

Another solution is to strengthen logins with pictures, or colored words, often chosen when signing up for a service. Users look for these when logging in, and only enter their credentials when they recognize the user defined pictures or words.

- -

A study on the efficacy of security indicators, presented at the 2007 IEEE Symposium on Security and Privacy, suggests that the above countermeasures fail to protect the majority of users. This too, includes missing HTTPS or EV certificate indicators in a browser’s navigation bar.

- -

Serviços assumindo responsabilidade

- -

Technical solutions can be more efficient if implemented to protect millions of users automatically. As most phishing attacks start with unsolicited email messages, a clear starting point is improving spam filters, thus reducing the number of fraudulent messages reaching users.

- -

Web browser vendors too, are interested in protecting their users from phishing. After all, the browser plays an essential role in the scheme: a fake website is loaded in a browser and here is the maker’s last chance to preventing fraud. Since version 2.0, Firefox has used Google’s SafeBrowsing service, to detect known web forgeries, and display an alert instead of the fraudulent website.

- -

Autenticação de Dois Fatores

- -

None of the above anti-phishing measures address the basic problem: username/password combinations are often enough to impersonate users.

- -

Enter the world of second factors. A second factor is something a user possesses to further authenticate with a service. For example, a USB token, Bluetooth device, mobile phone, or simply a key stored on a separate device. The first factor is usually the password and username. If both factors don’t match, the service will reject authentication requests.

- -

Criptografia de Chave Pública

- -

Many services will soon support W3C Web Authentication, a powerful technology to evade phishing, based on public key cryptography. Web Authentication supports millions of readily avilable FIDO U2F USB security keys, and will support the more advanced FIDO 2.0 keys, once made available.

- -

Verificação via Mensagem de Texto

- -

If a service supports verification, via SMS, it sends a text message with a one-time PIN to the user’s phone number. The user then enter this PIN after the Web service verifies the username and password. This was chosen as an  early second factor 'protocol' as text messages are widely supported, however, even NIST no longer recommends SMS verification. The SS7 telephony system is vulnerable, making eavesdropping, or rerouting text messages quite trivial.

- -

Algoritmos de Palavra-passe Única

- -

A better way to use phones as second factor, are One-Time Password (OTP) protocols, like TOTP and HOTP. At service registration, the provider will often generate a QR code to be read by an OTP app. This QR code is nothing more than a random, secret key, that is stored on the user’s phone. After verifying username and password, the user is prompted to open the OTP app and enter the corresponding 6-digit code, representing a hashed version of the secret key and a nonce - potentially time-based.

- -

OTP is the most widely supported second factor schemes and can be used to secure your most important accounts. Unfortunately, some users still feel it's too tedious unlocking a phone, opening the OTP app, and manually typing a few digits each time a provider requests a new token. This can be phished by an attacker, though with TOTP apps the attacker has limited time to make their unauthorized login.

diff --git a/files/pt-pt/mozilla/projects/emscripten/index.html b/files/pt-pt/mozilla/projects/emscripten/index.html deleted file mode 100644 index c2c6e1a2dc..0000000000 --- a/files/pt-pt/mozilla/projects/emscripten/index.html +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: Emscripten -slug: Mozilla/Projects/Emscripten -tags: - - C++ - - Emscripten - - JavaScript - - LLVM -translation_of: Mozilla/Projects/Emscripten ---- -

Emscripten é um compilador LLVM para JavaScript. Este utiliza bytecode do LLVM (por exemplo, gerado a partir de C/C++, utilizando Clang, ou de outra linguagem) e o compila no JavaScript, que pode ser executado na Web.

- -
-

Importante: esta página fornece uma breve introdução sobre o que Emscripten é. Para começar com Emscripten, vá para a Wiki oficial do Emscripten.

-
- -

Ao utilizar o Emscripten, pode

- - - -

Emscripten produz código nativo imediatamente disponível na Web: uma plataforma que é padrão, tem inúmeras implementações independentes e é interpretada em todo o lado desde PC's a iPad's.

- -

Com Emscripten, programadores de C/C++ não têm o alto custo de transcrever o código manualmente para JavaScript — ou ter que aprender JavaScript sequer. Programadores web também beneficiam, dado que podem usar milhares de bibliotecas nativas já existentes nos seus sites.

- -

Praticamente qualquer base de código portátil de C ou C++ pode ser compilada para JavaScript usando Emscripten, variando desde jogos de alto performance que precisam de renderizar gráficos, tocar sons, carregar e processar ficheiros até aplicações de frameworks como Qt.

- -

Emscripten gera código rápido — o formato de saída é asm.js, um subset de JavaScript que consegue executar perto de velocidades nativas em muitos casos.

- -
-

Nota: Parece interessante? Ler mais sobre Emscripten e experimentar algumas demonstrações, e depois começar a usar.

-
- -

Outros artigos de interesse na MDN

- - diff --git a/files/pt-pt/mozilla/projects/index.html b/files/pt-pt/mozilla/projects/index.html deleted file mode 100644 index 7e832a9616..0000000000 --- a/files/pt-pt/mozilla/projects/index.html +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: Projects -slug: Mozilla/Projects -tags: - - Landing - - Mozilla - - NeedsContent - - NeedsTranslation - - Projects - - TopicStub -translation_of: Mozilla/Projects ---- -

Below you'll find links to documentation about various Mozilla projects; these are often parts of Firefox or other products, but may also be used in other projects as well.

-

{{ LandingPageListSubpages() }}

diff --git a/files/pt-pt/mozilla/projects/mailnews/index.html b/files/pt-pt/mozilla/projects/mailnews/index.html deleted file mode 100644 index 79fc847667..0000000000 --- a/files/pt-pt/mozilla/projects/mailnews/index.html +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: MailNews -slug: Mozilla/Projects/MailNews -translation_of: Mozilla/Projects/MailNews ---- -

MailNews significa "Correio e Listas de Notícias". MailNews é o back end de partes de mensagem do SeaMonkey e Thunderbird. Este fornece um número de funções e capacidades, incluindo:

- - - -

O código de MailNews reside na diretoria / mailnews/ de comm-central.

- -

 

- -
-
-
-
AsyncTestUtils extended framework
-
The AsyncTestUtils Extended Framework is one mechanism for testing the MailNews component of Thunderbird. See MailNews automated testing for a description of the other testing mechanisms.
-
Leak And Bloat Tests
-
This page describes how to perform tests that measure memory leaks and bloat for MailNews and its sub-components.
-
- -
-
-
- -
-
-
MailNews automated testing
-
Automated testing is an increasingly significant and important part of MailNews development. It allows reviewers to quickly pick up regressions in patches and helps developers to think about different cases.
-
-
-
- -

 

- -

Consulte as páginas etiquetadas de MailNews para informação additional especifica de MailNews.

diff --git a/files/pt-pt/mozilla/projects/rhino/index.html b/files/pt-pt/mozilla/projects/rhino/index.html deleted file mode 100644 index b84b26f977..0000000000 --- a/files/pt-pt/mozilla/projects/rhino/index.html +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: Rhino -slug: Mozilla/Projects/Rhino -tags: - - JavaScript - - Mozilla - - Rhino -translation_of: Mozilla/Projects/Rhino ---- -

Image:rhino.jpg

- -

Rhino é uma implementação de código fonte aberto da linguagem JavaScript inteiramente desenvolvida em Java. Tipicamente, destina-se a ser incluída em aplicações Java como forma de providenciar funcionalidades de scripting ao utilizador final. Foi incluída no pacote J2SE como o scripting engine disponível por defeito.

- -

Baixar Rhino

- -

Como obter código fonte e ficheiros binários

- -

Documentação Rhino

- -

Informação sobre Rhino para desenvolvedores de scripts.

- -

Ajuda Rhino

- -

Alguns recursos para o caso de entrar em dificuldades.

diff --git a/files/pt-pt/mozilla/projects/thunderbird/localizacao_thunderbird/index.html b/files/pt-pt/mozilla/projects/thunderbird/localizacao_thunderbird/index.html deleted file mode 100644 index b639359af3..0000000000 --- a/files/pt-pt/mozilla/projects/thunderbird/localizacao_thunderbird/index.html +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: Localização do Thunderbird -slug: Mozilla/Projects/Thunderbird/Localizacao_Thunderbird -tags: - - Localização - - Thunderbird 3 - - Tradução - - thunderbird -translation_of: Mozilla/Projects/Thunderbird/Thunderbird_Localization ---- -

Esta página é destinada aos tradutores atuais e futuros do Thunderbird, o cliente de e-mail e usenet da Mozilla Messaging. Abrange muitos aspetos que um tradutor do Thunderbird deverá conhecer como ferramentas necessárias, como obter informação sobre eventos relevantes à localização e vários outros itens de interesse.

- -

Criar uma localização do Thunderbird

- -

Creating a new localization (Mercurial) - This article describes how you can create a new localization for Thunderbird.

- -

Sobre repositórios e ramificações

- -

There are 3 active repositories for Thunderbird development. Thunderbird development work is merged from one branch to the next every six weeks.

- - - -

Most locales will being working on comm-aurora. This repository/branch is stable with respect to strings for each six week period. Completing work here means it is ready for the first beta, and you won't need to work on beta branch. Your work will also automatically be carried forward.

- -

Requisitos da Localização

- -

There are not significant restrictions on what locales can change. However, we need to work together on providing search engines for Thunderbird users to use to get the right balance of search engines and the correct options set. For further information see this page.

- -

Painel da Localização

- -

The localization dashboard for Thunderbird gives localizers a precise overview of the current status of their localization. Detailed information is available on the l10n dashboard page.

- -

A localization will added to the l10n dashboard on request when it has reached a high-level of completion (> 80%) as shown by the compare-locales output. To request the addition of your locale to the dashboard, file a bug in the Thunderbird product/Build Config component.

- -

Obter informação relevante de l10n

- -

Fóruns de Discussão e Listas de Discussão

- -

Localizers of Thunderbird should read the localization newsgroups (mozilla.dev.l10n.announce mozilla.dev.l10n) to stay informed of Thunderbird-specific and general l10n-related items of interest to them. They are further encouraged to read the Thunderbird development newsgroup (mozilla.dev.apps.thunderbird) to stay informed of recent Thunderbird-related developments.

- -

These newsgroups can also be accessed via the dev-l10n-announce@lists.mozilla.org, dev-l10n@lists.mozilla.org (localization mailinglist) or dev-apps-thunderbird@lists.mozilla.org (Thunderbird development mailinglist) mailinglists, which mirror the newsgroups mentioned above. You can subscribe to or unsubscribe from these mailinglists via the web interface at lists.mozilla.org.

- -

Bugzilla

- -

Localizers should watch the thunderbird@localization.bugs mail address (or its alias :tb-l10n) to stay current on bugs that might affect Thunderbird localizers. This can be done by adding this mail address to the "User Watching" section of your Email preferences in bugzilla.

- -

Algumas hiperligações úteis

- - - -

Tiers de Idioma

- -

Locale tiers reflect locales that we need to have in a good state for release. There are 10 locales in tier 1, which are the most important for Thunderbird, because of their number of Thunderbird users or potential for growth.

- -

These locales are being treated as first-class citizens, as important as en-US, which is to say that any Tier 1 locale that does not meet the requirements may block a final release of Thunderbird.

- -

Tier 1

- -

The following are P1 (priority 1) locales in order of priority:

- -
* de             -  alemão
-* fr             -  francês
-* ja, ja-JP-mac  -  japonês
-* en-GB          -  inglês (UK)
-* es-ES          -  espanhol (continente Europeu)
-* it             -  italiano
-* pl             -  polaco
-* ru             -  russo
-* nl             -  holandês
-* pt-BR          -  português (Brasil)
-
- -

Tier 2

- -

Todas as outras localidades suportadas que estão na categoria do Tier 2.

diff --git a/files/pt-pt/mozilla/tech/index.html b/files/pt-pt/mozilla/tech/index.html deleted file mode 100644 index 36bcd94c3a..0000000000 --- a/files/pt-pt/mozilla/tech/index.html +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: Tecnologias da Mozilla -slug: Mozilla/Tech -tags: - - Landing - - Mozilla - - Referencia - - TopicStub - - XUL -translation_of: Mozilla/Tech ---- -

A Mozilla tem várias tecnologias, utilizadas como componentes dos seus projetos. Estas estão documentadas aqui.

- -

{{LandingPageListSubpages}}

diff --git a/files/pt-pt/mozilla/tech/places/index.html b/files/pt-pt/mozilla/tech/places/index.html deleted file mode 100644 index 18e2e0cd95..0000000000 --- a/files/pt-pt/mozilla/tech/places/index.html +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: Places -slug: Mozilla/Tech/Places -tags: - - Desenvolvimento da Mozilla - - Extensões - - Extras - - Places -translation_of: Mozilla/Tech/Places ---- -

{{ Fx_minversion_header(3) }}

- -

Places é o sistema de gestão de marcadores e histórico introduzido no Firefox 3. It offers increased flexibility and complex querying to make handling the places the user goes easier and more convenient. It also includes new features including favicon storage and the ability to annotate pages with arbitrary information. It also introduces new user interfaces for managing all this information; see {{ interwiki('wikimo', 'Places', 'Places on the Mozilla wiki') }}.

- -

Places armazena os seus dados numa base de dados SQLite, utilizando as interfaces de mozStorage.

- - - - - - - - -
-

Documentação

- -
-
Places migration guide
-
Migrating existing code to use the Places API.
-
Manipulating bookmarks using Places
-
Examples for how to work with bookmarks using the Places API.
-
Using the Places tagging service
-
How to use the tagging service.
-
Using the Places history service
-
How to access history information using the Places API.
-
Using the Places favicon service
-
How to manipulate favicons using the Places API.
-
Using the Places livemark service
-
How to create and manage livemarks.
-
Using the Places annotation service
-
How to work with the annotation service.
-
Using the Places keywords API
-
How to manage Places keywords
-
- -
-
Querying Places
-
How to query the bookmarks and history system with specific parameters.
-
Retrieving part of the bookmarks tree
-
How to fetch a section of the bookmarks tree using queries.
-
Displaying Places information using views
-
How to use Places views to display Places data in your own applications or extensions.
-
Places utilities for JavaScript
-
A library of convenient routines that make it easier to work with Places.
-
Places Database troubleshooting
-
How to deal with a corrupt places.sqlite database.
-
- -

View All...

-
- - -
-
The Places database
-
High-level overview of the Places database design.
-
History Service Design
-
Design of the history service.
-
Bookmark Service Design
-
Design of the bookmarks service.
-
Annotation Service Design
-
Design of the annotation service.
-
The Places "frecency" algorithm
-
The algorithm behind the Places location bar (sometimes called the "awesomebar").
-
-
diff --git a/files/pt-pt/mozilla/tech/xpcom/armazenamento/index.html b/files/pt-pt/mozilla/tech/xpcom/armazenamento/index.html deleted file mode 100644 index 2410a763e4..0000000000 --- a/files/pt-pt/mozilla/tech/xpcom/armazenamento/index.html +++ /dev/null @@ -1,372 +0,0 @@ ---- -title: Armazenamento -slug: Mozilla/Tech/XPCOM/Armazenamento -tags: - - API de Kit de Ferramentas - - Armazenamento - - Guia(2) - - Interfaces -translation_of: Mozilla/Tech/XPCOM/Storage ---- -

Armazenamento é uma API de base de dados SQLite. Está disponível para os callers de confiança, ou seja, apenas extensões e componentes do Firefox.

- -

The API is currently "unfrozen", which means it is subject to change at any time; in fact, it has changed somewhat with each release of Firefox since it was introduced, and will likely continue to do so for a while.

- -
Nota: Storage is not the same as the DOM:Storage feature which can be used by web pages to store persistent data or the Session store API (an XPCOM storage utility for use by extensions).
- -

Iniciação

- -

This document covers the Storage API and some peculiarities of SQLite. It does not cover SQL or "regular" SQLite. You can find some very useful links in the See also section however. For Storage API help, you can post to mozilla.dev.apps.platform on the news server news.mozilla.org. To report bugs, use Bugzilla.

- -

The overall procedure for use is:

- -
    -
  1. Get the Storage service - {{ interface("mozIStorageService") }}.
  2. -
  3. Open a connection to the database of your choice - {{ interface("mozIStorageConnection") }}.
  4. -
  5. Create statements to execute on the connection - {{ interface("mozIStorageStatement") }}.
  6. -
  7. Bind parameters to a statement as necessary.
  8. -
  9. Execute the statement.
  10. -
  11. Check for errors.
  12. -
  13. Reset the statement.
  14. -
- -

Abrir uma ligação

- -

JavaScript example of opening my_db_file_name.sqlite in the profile directory:

- -
Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/FileUtils.jsm");
-
-let file = FileUtils.getFile("ProfD", ["my_db_file_name.sqlite"]);
-let dbConn = Services.storage.openDatabase(file); // Will also create the file if it does not exist
-
- -

Likewise, the C++ would look like this:

- -
nsCOMPtr<nsIFile> dbFile;
-rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,
-                            getter_AddRefs(dbFile));
-NS_ENSURE_SUCCESS(rv, rv);
-rv = dbFile->Append(NS_LITERAL_STRING("my_db_file_name.sqlite"));
-NS_ENSURE_SUCCESS(rv, rv);
-nsCOMPtr<mozIStorageService> dbService =
-  do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID, &rv);
-NS_ENSURE_SUCCESS(rv, rv);
-
-nsCOMPtr<mozIStorageConnection> dbConn;
-rv = dbService->OpenDatabase(dbFile, getter_AddRefs(dbConn));
-NS_ENSURE_SUCCESS(rv, rv);
-
- -
Note: MOZ_STORAGE_SERVICE_CONTRACTID is defined in {{ Source("storage/build/mozStorageCID.h") }}.
- -

{{ Warning("It may be tempting to give your database a name ending in '.sdb' for sqlite database, but this is not recommended. This extension is treated specially by Windows as a known extension for an 'Application Compatibility Database' and changes are backed up by the system automatically as part of system restore functionality. This can result in significantly higher overhead file operation.") }}

- -

Fechar uma ligação

- -

To close a connection on which only synchronous transactions were performed, use the mozIStorageConnection.close() method. If you performed any asynchronous transactions, you should instead use the mozIStorageConnection.asyncClose() method. The latter will allow all ongoing transactions to complete before closing the connection, and will optionally notify you via callback when the connection is closed.

- -

Statements

- -

This section demonstrates how you can execute SQL statements on your database. For a complete reference see {{ interface("mozIStorageStatement") }}.

- -

Creating a Statement

- -

There are actually two ways to execute a statement. You should choose the right one based on your needs.

- -

No Results to be Returned

- -

If you do not need to get any results back, you can use {{ ifmethod("mozIStorageConnection", "executeSimpleSQL") }} API like this in JavaScript:

- -
dbConn.executeSimpleSQL("CREATE TEMP TABLE table_name (column_name INTEGER)");
-
- -

Similarly, the C++ looks like this:

- -
rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING("CREATE TEMP TABLE table_name (column_name INTEGER)"));
-NS_ENSURE_SUCCESS(rv, rv);
- -

Results to be Returned

- -

However, if you need to get results back, you should create the statement with the {{ ifmethod("mozIStorageConnection", "createStatement") }} API like this in JavaScript:

- -
var statement = dbConn.createStatement("SELECT * FROM table_name WHERE column_name = :parameter");
-
- -

This example uses a named placeholder called "parameter" to be bound later (described in {{ anch("Binding Parameters") }}). Similarly, the C++ looks like this:

- -
nsCOMPtr<mozIStorageStatement> statement;
-rv = dbConn->CreateStatement(NS_LITERAL_CSTRING("SELECT * FROM table_name WHERE column_name = ?1"),
-                             getter_AddRefs(statement));
-NS_ENSURE_SUCCESS(rv, rv);
-
- -

This example uses the numbered placeholder indexed by zero for a parameter to be bound later (described in {{ anch("Binding Parameters") }}).

- -

{{ Note("Numerical indexes for parameters are always one less than the number you write in the SQL. The use of numerical indexes for parameters is strongly discouraged in JavaScript where named parameters are much easier to use.") }}

- -

{{ Note("If you need to execute a statement multiple times, caching the result of createStatement will give you a noticeable performance improvement because the SQL query does not need to be parsed each time.") }}

- -

Binding Parameters

- -

In order to effectively use the statements that you create, you have to bind values to the parameters you placed in the statement. A given placeholder can appear multiple times in the same statement, and all instances of it will be replaced with the bound value. If you neglect to bind a value to a parameter, it will be interpreted as NULL.

- -
You should never try to construct SQL statements on the fly with values inserted in them. By binding the parameters, you prevent possible SQL injection attacks since a bound parameter can never be executed as SQL.
- -

Binding One Set of Parameters

- -

If you only have one row to insert, or are using the synchronous API you'll need to use this method. In JavaScript, there is a useful helper object ({{ interface("mozIStorageStatementParams") }}) available ({{ gecko_minversion_inline("1.9.1") }}) that makes binding parameters much easier:

- -
var statement = dbConn.createStatement("SELECT * FROM table_name WHERE id = :row_id");
-statement.params.row_id = 1234;
-
- -

Use :boundParameterName the same way for numeric and non-numeric columns. Do not put the :boundParameterName within apostrophes, because that the binding mechanism does that for you. You can still use this helper object by manually creating the statement wrapper, {{ interface("mozIStorageStatementWrapper") }}, which is provided in Gecko 1.9.1 and later.

- -

Using named parameters in C++ is a lot more difficult, so it's generally accepted to use numerical placeholders instead. The example below uses {{ ifmethod("mozIStorageStatement", "bindInt32Parameter") }}. The full list of binding functions can be found with the {{ interface("mozIStorageStatement") }} documentation.

- -

C++ example:

- -
nsCOMPtr<mozIStorageStatement> statement;
-rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING("SELECT * FROM table_name WHERE id = ?1"),
-                              getter_AddRefs(statement));
-NS_ENSURE_SUCCESS(rv, rv);
-
-rv = statement->BindInt32Parameter(0, 1234);
-NS_ENSURE_SUCCESS(rv, rv);
-
- -

{{ Note("Numerical indexes for parameters are always one less than the number you write in the SQL. The use of numerical indexes for parameters is strongly discouraged in JavaScript where named parameters are much easier to use.") }}

- -

Binding Multiple Sets of Parameters

- -

{{ gecko_minversion_header("1.9.2") }}

- -

Starting in Gecko 1.9.2 (Firefox 3.6), there's a new, more convenient way to bind multiple sets of parameters at once prior to executing your statement asynchronously. This API is only available for asynchronous execution.

- -
let stmt = dbConn.createStatement("INSERT INTO table_name (value) VALUES(:value)");
-let params = stmt.newBindingParamsArray();
-for (let i = 0; i < 10; i++) {
-  let bp = params.newBindingParams();
-  bp.bindByName("value", i);
-  params.addParams(bp);
-}
-stmt.bindParameters(params);
-
- -

You can attach multiple sets of bindings to a statement by adding multiple {{ interface("mozIStorageBindingParams") }} objects to the array of parameter lists, adding each one through calls to the {{ ifmethod("mozIStorageBindingParamsArray", "addParams") }}. Once all the parameters are set up, a single call to {{ ifmethod("mozIStorageStatement", "bindParameters") }} will ensure that the parameters are bound before execution. You can then execute the statement asynchronously, and the statement will get each set of bindings bound to it before execution asynchronously.

- -

Executing a Statement

- -

You may execute statements either synchronously (which is supported in Firefox Gecko 1.8 and 1.9) or asynchronously (starting in Gecko 1.9.1). If your code needs to work with applications based on Gecko 1.8 or 1.9, you should the technique covered in the section {{ anch("Synchronously") }} below. Otherwise, it's strongly recommended that you use asynchronous execution, for performance reasons.

- -

Asynchronously

- -

{{ gecko_minversion_header("1.9.1") }}

- -

Gecko 1.9.1 introduced support for asynchronous execution of a statement by calling {{ ifmethod("mozIStorageStatement", "executeAsync") }} on the statement. Multiple statements can be executed in a transaction by calling {{ ifmethod("mozIStorageConnection", "executeAsync") }} on the connection and passing in an array of statements. Both of these methods have similar signatures that accept an object as input that receives notifications the execution of the statement(s). A C++ example is omitted here because it would be verbose, but real-world code can be found in the Mozilla source tree ({{ lxrsearch("ident", "i", "mozIStorageStatementCallback") }}).

- -

After you create and bind a statement, your JavaScript should look something like this to execute a statement asynchronously:

- -
statement.executeAsync({
-  handleResult: function(aResultSet) {
-    for (let row = aResultSet.getNextRow();
-         row;
-         row = aResultSet.getNextRow()) {
-
-      let value = row.getResultByName("column_name");
-    }
-  },
-
-  handleError: function(aError) {
-    print("Error: " + aError.message);
-  },
-
-  handleCompletion: function(aReason) {
-    if (aReason != Components.interfaces.mozIStorageStatementCallback.REASON_FINISHED)
-      print("Query canceled or aborted!");
-  }
-});
-
- -

The call to executeAsync takes an object that implements mozIStorageStatementCallback. See its documentation for more details on each method. The callback is optional, however, so if you do not want to receive feedback, you can pass nothing.

- -

Synchronously

- -

If you are OK with the possibility of locking up your user interface, or if you are running on a background thread, you can use {{ ifmethod("mozIStorageStatement", "executeStep") }}. This function allows you to enumerate all the results produced by the statement.

- -

As you step through each row, you can obtain each parameter by name through a helper object ({{ interface("mozIStorageStatementRow") }}) in JavaScript ( {{ gecko_minversion_inline("1.9.1") }}) like so:

- -
while (statement.executeStep()) {
-  let value = statement.row.column_name;
-}
-
- -

You can create this helper object yourself if it's not available in your version of Gecko. See {{ interface("mozIStorageStatementWrapper") }} for details.

- -

In C++, the code would look something like this:

- -
bool hasMoreData;
-while (NS_SUCCEEDED(statement->ExecuteStep(&hasMoreData)) && hasMoreData) {
-  PRInt32 value;
-  rv = statement->GetInt32(0, &value);
-  NS_ENSURE_SUCCESS(rv, rv);
-}
-
- -

You can obtain other types of data by using the various methods available on {{ interface("mozIStorageValueArray") }}.

- -

Alternatively, if you do not expect any results but still need to execute a bound statement, you can simply call {{ ifmethod("mozIStorageStatement", "execute") }}. This is equivalent to calling {{ ifmethod("mozIStorageStatement", "executeStep") }} and then {{ ifmethod("mozIStorageStatement", "reset") }}.

- -

Resetting a Statement

- -

When you execute a statement synchronously, it is important to make sure you reset your statement. You can accomplish this by calling {{ ifmethod("mozIStorageStatement", "reset") }} on the statement. If you end up finalizing the statement (see {{ ifmethod("mozIStorageStatement", "finalize") }}) you do not need to worry about calling {{ ifmethod("mozIStorageStatement", "reset") }}. You should do this before you reuse the statement.

- -

{{ Warning("If you fail to reset a write statement, it will continue to hold a lock on the database preventing future writes or reads. Additionally, if you fail to reset a read statement, it will prevent any future writes to the database.") }}

- -

In JavaScript, the language makes it pretty easy to ensure that you always reset a statement. Be aware that you should always reset even if an exception is thrown, so your code should look something like this:

- -
var statement = dbConn.createStatement("SELECT * FROM table_name");
-try {
-  while (statement.step()) {
-    // Use the results...
-  }
-}
-finally {
-  statement.reset();
-}
-
- -

In C++, Storage provides a helper object in {{ Source("storage/public/mozStorageHelper.h") }}, mozStorageStatementScoper, which ensures that the statement object is reset when the object falls out of scope. Of course, if your statement is local only to the function, you do not have to worry about calling reset since the object will be destroyed.

- -
nsresult
-myClass::myFunction()
-{
-  // mSpecialStatement is a member variable of the class that contains a statement.
-  mozStorageStatementScoper scoper(mSpecialStatement);
-  // You can use mSpecialStatement without concern now.
-
-  nsCOMPtr<mozIStorageStatement> statement;
-  // mDBConn is a database connection that is stored a member variable of the class.
-  nsresult rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING("DELETE FROM table_name"),
-                                         getter_AddRefs(statement));
-  NS_ENSURE_SUCCESS(rv, rv);
-  return statement->Execute();
-  // Once this function returns, mSpecialStatement will be reset, and statement will
-  // be destroyed.
-}
-
- -

{{ Note("Calling reset is not an expensive operation, and nothing bad happens if you call reset more than once.") }}

- -

Transações

- -

Transactions can be used to either improve performance, or group statements together as an atomic operation. In both cases, you execute more than one statement inside of a transaction.

- -

In JavaScript, managing transactions can be difficult when you are using the same connection on different threads, or are using a combination of asynchronous and synchronous statement execution. The best way to deal with this is to only execute your statements asynchronously using {{ ifmethod("mozIStorageConnection", "executeAsync") }}. This method will manage the transactions for you, so you don't have to worry about them.

- -

{{ Note("The database engine does not support nested transactions, so attempting to start a transaction when one is already active will throw an exception.") }}

- -

Transactions can be started with {{ ifmethod("mozIStorageConnection", "beginTransaction") }} or {{ ifmethod("mozIStorageConnection", "beginTransactionAs") }}. The latter takes one of three constants to describe the type of transaction:

- - - -

{{ ifmethod("mozIStorageConnection", "beginTransaction") }} is equivalent to calling {{ ifmethod("mozIStorageConnection", "beginTransactionAs") }} and passing mozIStorageConnection.TRANSACTION_DEFERRED In general, this is the method you want to use.

- -

Once you start a transaction, you can either commit the changes by calling {{ ifmethod("mozIStorageConnection", "commitTransaction") }}, or rollback the changes by calling {{ ifmethod("mozIStorageConnection", "rollbackTransaction") }}.

- -

In C++ code, there is a helper class defined in {{ Source("storage/public/mozStorageHelper.h") }}, mozStorageTransaction, that will attempt to get a transaction for you, and handle it appropriately when it falls out of scope. If a transaction is already in progress, no transaction is obtained. If your function returns without calling Commit on the helper object, the transaction will be rolled back.

- -
nsresult
-myClass::myFunction()
-{
-  // mDBConn is a member variable of our mozIStorageConnection.
-  mozStorageTransaction transaction(mDBConn);
-
-  // Execute some statements.  If we encounter an error, the transaction will
-  // be rolled back.
-
-  return transaction.Commit();
-}
-
- -

Colação (ordenação)

- -

SQLite provides several collation methods (BINARY, NOCASE, and RTRIM), but these are all very simple and have no support for various text encodings or the user's locale.

- -

{{ gecko_minversion_header("1.9.2") }}

- -

{{ Gecko("1.9.2") }} added support for several new collation methods:

- -
-
locale
-
Case- and accent-insensitive collation.
-
locale_case_sensitive
-
Case-sensitive, accent-insensitive collation.
-
locale_accent_sensitive
-
Case-insensitive, accent-sensitive collation.
-
locale_case_accent_sensitive
-
Case- and accent-sensitive collation.
-
- -

You can use them quite simply in your SELECT queries, like this:

- -
var stmt = aConn.createStatement("SELECT * FROM foo ORDER BY name COLLATE locale ASC");
-var results = [];
-
-while (stmt.executeStep()) {
-  results.push(stmt.row.t);
-}
-stmt.finalize();
-
- -

How to Corrupt a Database

- -

SQLite is very good about maintaining database integrity, but there are a few things you can do that can lead to database corruption. You can find out more by reading SQLite's documentation on this. These are a few simple things you can avoid to help make sure this doesn't happen:

- - - - - - - - - -

Thread Safety

- -

{{ interface("mozIStorageService") }} and {{ interface("mozIStorageConnection") }} are thread safe. However, no other interface or method is, so do not use them on different threads at the same time!

- -

If you want to use concurrency to work on your database, you should use the asynchronous APIs provided by Storage.

- -

Consultar também

- - - - diff --git "a/files/pt-pt/mozilla/tech/xpcom/guide/altera\303\247\303\265es_xpcom_gecko_2.0/index.html" "b/files/pt-pt/mozilla/tech/xpcom/guide/altera\303\247\303\265es_xpcom_gecko_2.0/index.html" deleted file mode 100644 index ac8d2a2583..0000000000 --- "a/files/pt-pt/mozilla/tech/xpcom/guide/altera\303\247\303\265es_xpcom_gecko_2.0/index.html" +++ /dev/null @@ -1,222 +0,0 @@ ---- -title: Alterações de XPCOM no Gecko 2.0 -slug: Mozilla/Tech/XPCOM/Guide/Alterações_XPCOM_Gecko_2.0 -tags: - - Gecko 2.0 - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Guide/Changes_in_Gecko_2.0 ---- -

{{ gecko_minversion_header("2") }}

- -

Várias alterações que afetam a compatibilidade do componente XPCOM estão a ser realizadas no Gecko 2. Este artigo detalha essas alterações, e proporciona sugestões sobre como atualizar o seu código.

- -

No more frozen interfaces

- -

There are no longer any frozen interfaces; from now on, all interfaces are subject to change. Documentation will be updated as time allows to remove references to interfaces being "frozen" or "unfrozen."

- -

Component registration

- -

The way XPCOM components are registered changed in Gecko 2. Prior to Gecko 2, during component registration, all binary and JavaScript component files were loaded and called, asking them to register themselves. If you used XPCOMUtils.jsm, some of this was hidden from you, but it was still there.

- -

Starting in Gecko 2, however, components are registered using manifest files, similarly to how chrome is registered. In fact, the same chrome manifest file will be used to register components.

- -

All existing XPCOM components will need to be updated to support this. However, it's very easy to do, and you can actually support both types of registration for backward compatibility.

- -

Component manifests

- -

All component registration is now handled through manifest files. For extensions, this is the same chrome.manifest currently used to register chrome.

- -

XPT files

- -

The path of any XPT files must be listed explicitly in a manifest using an interfaces directive:

- -
interfaces components/mycomponent.xpt
- -

JavaScript components

- -

The registration information for JavaScript components is no longer located in the component itself; instead, it's located in the manifest. The component is loaded only when the XPCOM component manager needs to create a component.

- -

chrome.manifest:

- -
# The {classID} here must match the classID in mycomponent.js
-component {e6b866e3-41b2-4f05-a4d2-3d4bde0f7ef8} components/mycomponent.js
-contract @foobar/mycomponent;1 {e6b866e3-41b2-4f05-a4d2-3d4bde0f7ef8}
-category profile-after-change MyComponent @foobar/mycomponent;1
-
- -

The JavaScript code no longer exports a NSGetModule() function. It now must export a NSGetFactory() function, which accepts a class ID (CID) as a parameter.

- -

For example, in your component's JavaScript code :

- -
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-function myComponent() {
-}
-myComponent.prototype = {
-  // this must match whatever is in chrome.manifest!
-  classID: Components.ID("{e6b866e3-41b2-4f05-a4d2-3d4bde0f7ef8}"),
-
-  QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIMyComponent]),
-
-  /* nsIMyComponent implementation goes here */
-  ...
-};
-
-// The following line is what XPCOM uses to create components. Each component prototype
-// must have a .classID which is used to create it.
-const NSGetFactory = XPCOMUtils.generateNSGetFactory([myComponent]);
-
- -

A component may implement backwards compatibility with Gecko 1.9.2 by dynamically detecting which symbols are exported by XPCOMUtils.jsm and exporting the correct function:

- -
/**
-* XPCOMUtils.generateNSGetFactory was introduced in Mozilla 2 (Firefox 4, SeaMonkey 2.1).
-* XPCOMUtils.generateNSGetModule was introduced in Mozilla 1.9 (Firefox 3.0).
-*/
-if (XPCOMUtils.generateNSGetFactory)
-    var NSGetFactory = XPCOMUtils.generateNSGetFactory([myComponent]);
-else
-    var NSGetModule = XPCOMUtils.generateNSGetModule([myComponent]);
- -

Binary components

- -

Binary components must be listed explicitly in a manifest using a binary-component directive:

- -
binary-component components/mycomponent.dll
-
- -

C++ in the component must be changed: a binary component no longer exports a NSGetModule() function. Instead, it exports an NSModule data symbol which points to a mozilla::Module structure. For more information about the mozilla::Module structure, see the Module.h header file. For an up-to-date example of implementing a dynamic modules, see nsSampleModule.cpp.

- -

Note that nsIGenericFactory.h has been removed. References to nsIGenericFactory.h should be replaced with mozilla/ModuleUtils.h.

- -

It is possible for a binary component to be compatible with Mozilla 1.9.2 and Mozilla 2.0 by using the extra macro NS_IMPL_MOZILLA192_NSGETMODULE. See nsSampleModule.cpp for more details.

- -
Note: Binary XPCOM components must be recompiled for every new major release of Firefox starting with Firefox 4. Your life would be much easier over the long term if you switch to using js-ctypes instead.
- -

Also note that extensions using binary components must now use the unpack property in the install manifest.

- -

Platform-specific directories

- -

The component/chrome system used to look in platform-specific subdirectories of an extension, such as platform/WINNT_x86-msvc/chrome.manifest on Windows. This is no longer supported. You can use the OS and ABI chrome registration directives to achieve the same effect:

- -
binary-component components/windows/mycomponent.dll ABI=WINNT_x86-msvc
-binary-component components/mac/mycomponent.dylib ABI=Darwin_x86-gcc3
-binary-component components/mac/mycomponent64.dylib ABI=Darwin_x86_64-gcc3
-binary-component components/linux/mycomponent.so ABI=Linux_x86-gcc3
-
- -

This also means that platform-specific preferences are no longer possible. If you need to adjust default preferences based on platform, you can do so at first run by looking up what platform you're on and changing the preferences at that time.

- -

Category registration

- -

Prior to Gecko 2, extensions could listen for the xpcom-startup and app-startup notifications during startup, and perform actions during those. This is no longer the case. The earliest startup notification extensions can receive now is profile-after-change, which has always been the recommended notification to observe. That's because it's among the earliest notifications that occurs after the profile folder (and therefore preferences and other services) is available.

- -

What you need to change

- -

If your extension currently observes either xpcom-startup or app-startup, you need to update your code to observe profile-after-change instead.

- -

Typically, extensions observed app-startup because in the past, you needed to load for app-startup in order to be able to register to observe profile-after-change in the first place. As of {{ gecko("1.9.1") }}, this is no longer the case, however; you can now register for profile-after-change using the Category Manager. See Receiving startup notifications for details.

- -

To add a category entry, you must insert the following line to your chrome.manifest:

- -
category profile-after-change MyComponent @foobar/mycomponent;1
-
- -
Important: Formerly, the contract id of the category entry was prefixed with "service," if the component was implemented as a service. This prefix needs to be dropped when migrating to chrome.manifest.
- -

Changed category names

- -

The XPCOM category manager is used to register certain global helper objects. Because chrome.manifest is a space-delimited format, category names with spaces cannot be registered. Therefore the following categories have changed:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Old nameNew name
JavaScript global constructorJavaScript-global-constructor
JavaScript global constructor prototype aliasJavaScript-global-constructor-prototype-alias
JavaScript global propertyJavaScript-global-property
JavaScript global privileged propertyJavaScript-global-privileged-property
JavaScript global static namesetJavaScript-global-static-nameset
JavaScript global dynamic namesetJavaScript-global-dynamic-nameset
JavaScript DOM classJavaScript-DOM-class
JavaScript DOM interfaceJavaScript-DOM-interface
XSLT extension functionsXSLT-extension-functions
- -

But why?

- -

Previously, whenever Gecko detected that the application version had changed, or one or more extensions was added, removed, enabled, or disabled, it was necessary to throw away all existing component registrations, then restart the application (what we call the "Extension Manager restart") during its startup process. This was necessary in order to ensure that any components that should no longer be available are disposed of properly, and to re-register everything, loading any new components that may be needed.

- -

In theory, this is invisible to the user, but it's a costly process, since every component needs to be loaded and executed, then unloaded, then reloaded again during the restart.

- -

On top of that, with the ongoing work to make Firefox multithreaded, content processes either need to register components on a per-process basis, or somehow share a component cache with the chrome process.

- -

The changes to the component registration model let this so-called Extension Manager restart become a thing of the past. Instead of relying on a potentially stale component cache on startup, we read the application's component registrations out of its manifest file and load those components. This gets enough of XPCOM loaded and running that we can then load the Extension Manager and perform the necessary installing, uninstalling, and updating of any installed extensions.

- -

Once that's done, the extensions can then be loaded by simply reading their manifests, loading their components, and continuing the startup process, all without having to restart the browser.

- -

Electrolysis content processes can simply read the component registrations during startup.

- -

XPCNativeWrapper changes

- -

You can't disable XPCNativeWrappers from your manifest

- -

Specifying xpcnativewrappers=no in your manifest (that is, XPCNativeWrapper automation) is no longer supported. This was always intended to be a short-term workaround to allow extensions to continue to work while their authors updated their code to use XPCNativeWrappers.

- -

If your add-on depends upon XBL bindings attached to content objects—for example, the ability to call functions or get and set properties created by the XBL binding—you will need to use the XPCNativeWrapper property wrappedJSObject to access wrapped objects.

- -

If you need to be able to call functions or access properties defined by web content, you'll need to do this as well. This may be the case if, for example, you've written an extension that adds a delete button to a web mail service, and the service defines a window.delete() function that you need to call.

- -

If, on the other hand, all you're doing with content is accessing DOM methods and properties, you've never needed to be using xpcnativewrappers=no in the first place, and should simply remove it from your manifest.

- -

Miscellaneous XPCNativeWrapper changes

- - - -

XPCOMUtils.jsm changes

- -

The XPCOMUtils.jsm code module has been updated to let you specify the application IDs of the applications you wish to register your component in.

- -

XPCOM service getters

- -

A number of commonly used XPCOM services now have service getter functions available in the mozilla::services namespace; these make it much easier to get access to these services from C++ code.

- -

See also

- - diff --git a/files/pt-pt/mozilla/tech/xpcom/guide/index.html b/files/pt-pt/mozilla/tech/xpcom/guide/index.html deleted file mode 100644 index 63fcce03c0..0000000000 --- a/files/pt-pt/mozilla/tech/xpcom/guide/index.html +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: XPCOM guide -slug: Mozilla/Tech/XPCOM/Guide -tags: - - Add-ons - - Extensions - - Guide - - Landing - - Mozilla - - NeedsTranslation - - TopicStub - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Guide ---- -

These articles provide tutorials and usage documentation for XPCOM, including how to use it in your own projects and how to build XPCOM components for your Firefox add-ons and the like.

- -
-

WebExtensions are becoming the new standard for creating add-ons. Eventually support for XPCOM add-ons will be deprecated, so you should begin to investigate porting your add-ons to use the WebExtensions API, and report any missing functionality so we can be sure to address your concerns. Work is ongoing on WebExtension capabilities, so your input will help prioritize and plan the work. To learn more about the kinds of changes that will be needed, see Comparison with XUL/XPCOM extensions. In addition, any binaries you use will then need to be converted for use with the WebExtensions native messaging API, or compiled using WebAssembly or Emscripten.

-
- -

{{LandingPageListSubpages}}

diff --git a/files/pt-pt/mozilla/tech/xpcom/index.html b/files/pt-pt/mozilla/tech/xpcom/index.html deleted file mode 100644 index 4aad9d4fe0..0000000000 --- a/files/pt-pt/mozilla/tech/xpcom/index.html +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: XPCOM -slug: Mozilla/Tech/XPCOM -tags: - - Add-ons - - Extensions - - Extensões - - Extras - - Landing - - Mozilla - - NeedsTranslation - - Precisa de Tradução - - TopicStub - - XPCOM -translation_of: Mozilla/Tech/XPCOM ---- -

XPCOM é um modelo de objeto componente de plataforma cruzada, similar a Microsoft COM. Este tem múltiplas ligações de linguagem, permitindo que os componentes XPCOM sejam utilizados e implementados no Java, JavaScript e Python, além das interfaces em C++. As interfaces no XPCOM são definidas num dialeto de IDL, nomeado de XPIDL.

- -
-

WebExtensions are becoming the new standard for creating add-ons. Eventually support for XPCOM add-ons will be deprecated, so you should begin to investigate porting your add-ons to use the WebExtensions API, and report any missing functionality so we can be sure to address your concerns. Work is ongoing on WebExtension capabilities, so your input will help prioritize and plan the work. To learn more about the kinds of changes that will be needed, see Comparison with XUL/XPCOM extensions. In addition, any binaries you use will then need to be converted for use with the WebExtensions native messaging API, or compiled using WebAssembly or Emscripten.

-
- -

XPCOM itself provides a set of core components and classes, e.g. file and memory management, threads, basic data structures (strings, arrays, variants), etc. The majority of XPCOM components are not part of this core set and are provided by other parts of the platform (e.g. Gecko or Necko) or by an application or even by an extension.

- -
-
Accessing the Windows Registry Using XPCOM
When implementing Windows-specific functionality, it is often useful to access the Windows registry for information about the environment or other installed programs. To this end, there exist XPCOM interfaces to read and write registry data. This article will show you how to use the available interfaces in several Mozilla products.
Aggregating the In-Memory Datasource
already_AddRefed
already_AddRefed in association with nsCOMPtr allows you to assign in a pointer without AddRefing it.
Binary compatibility
If Mozilla decides to upgrade to a compiler that does not have the same ABI as the current version, any built component may fail. It is a possiblity that is introduced when upgrading to a new compiler without recompiling everything. Effectively, it is a different platform.
Bundling multiple binary components
Binary XPCOM components are sometimes required to implement low-level features for extensions. Since binary components are linked against a single Gecko SDK, a dependency to a particular version of Gecko is created. If the component uses only "frozen" XPCOM interfaces, there is a good chance the same binary component will work with different versions of Gecko (version 1.8 and 1.9, for example). The more likely case is that the component uses "unfrozen" interfaces and those interfaces can change between Gecko versions. This can create a difficult situation for extension developers trying to support multiple Gecko versions (Firefox 2 and 3, for example).
Creating a Python XPCOM component
Creating Applications with Mozilla already provides a tutorial for making a simple JavaScript or C++ component (implementing the nsISimple interface). Here is how to make the same component in Python using PyXPCOM.
Fun With XBL and XPConnect
Generating GUIDs
GUIDs are used in Mozilla programming for identifying several types of entities, including XPCOM Interfaces (this type of GUIDs is callled IID), components (CID), and legacy add-ons—like extensions and themes—that were created prior to Firefox 1.5. Add-ons can (and should) be identified with IDs of the form extensionname@organization.tld since Firefox 1.5.
Generic factory
Most XPCOM factories can be very simple. Rick Potts wrote a templated-based generic factory (nsFactory<t>) that simplifies the factory creation process that just requires writing a CreateInstance() method. The new nsIGenericFactory interface takes this a step further, by providing a single interface that can be reused anytime a simple implementation of nsIFactory is needed. Here is the interface, and a description of its use.</t>
How to build a binary XPCOM component using Visual Studio
This is a simple tutorial for building XPCOM objects in C++ using Visual Studio. XPCOM is Mozilla’s cross platform component object model, similar to Microsoft’s COM technology. XPCOM components can be implemented in C, C++, and JavaScript, and can be used from C, C++, and JavaScript. That means you can call JavaScript methods from C++ and vice versa. For more information on the workings of XPCOM look elsewhere.
How To Pass an XPCOM Object to a New Window
If you want to be able to call functions within an XPCOM object from a XUL window's code, you can do so if you pass the XPCOM object as one of the arguments to the window creation method.
Interfacing with the XPCOM cycle collector
This is a quick overview of the cycle collector introduced into XPCOM for Firefox 3, including a description of the steps involved in modifying an existing C++ class to participate in XPCOM cycle collection. If you have a class that you think is involved in a cyclical-ownership leak, this page is for you.
Introduction to XPCOM for the DOM
Warning: this document has not yet been reviewed by the DOM gurus, it might contain some errors.
Language bindings
An XPCOM Language Binding is a bridge between a particular language and XPCOM to provide access to XPCOM objects from that language, and to let modules written in that language be used as XPCOM objects by all other languages for which there are XPCOM bindings.
Monitoring HTTP activity
Gecko includes the nsIHttpActivityObserver interface, which you can implement in your code to monitor HTTP transactions in real time, receiving a callback as the transactions take place.
nsCOMPtr versus RefPtr
Gecko code uses both nsCOMPtr and RefPtr as smart pointers. This guide provides some explanation and advice on how to choose between them.
Observer Notifications
The following are topics that you can observe during the course of an application. Unless otherwise noted you register for the topics using the nsIObserverService.
Setting HTTP request headers
HTTP is one of the core technologies behind the Web. In addition to the actual content, some important information is passed with HTTP headers for both HTTP requests and responses.
Storage
Storage is a SQLite database API. It is available to trusted callers, meaning extensions and Firefox components only.
The Thread Manager
The Thread Manager, introduced in Firefox 3, offers an easy to use mechanism for creating threads and dispatching events to them for processing.
-
Troubleshooting XPCOM components registration
Often the first time you create an XPCOM component, it may fail to register correctly.
Using nsCOMPtr
This document is the sum total of everything written down about nsCOMPtr. If you have a question about nsCOMPtr, and this document doesn't answer it, there probably isn't a document that answers it. You'll have to turn to the XPCOM newsgroup or another experienced nsCOMPtr user, or find the answer by experimentation.
Using nsIClassInfo
If you use a C++ class which implements nsIClassInfo from JavaScript, then you don't have to explicitly call QueryInterface on the JavaScript object to access the object's interfaces.
Using nsIDirectoryService
nsDirectoryService implements the nsIProperties interface. This implementation will allow you to Get(), Set(), Define(), and Undefine() nsIFile.
Using nsIPasswordManager
Technical review completed.
Using nsISimpleEnumerator
Using the clipboard
This section provides information about cutting, copying, and pasting to and from the clipboard.
Using the Gecko SDK
Weak reference
In XPCOM, a weak reference is a special object that contains a pointer to an XPCOM object, but doesnot keep that object alive. If the referent object is destroyed before the weak reference, the pointer inside the weak reference is set to nsnull.
Working with Multiple Versions of Interfaces
In this short note we illustrate how one can update an XPCOM module in -order for it to work in both Firefox 2 and Firefox 3, even if the interfaces have -changed in the interim.
Working with out parameters
wrappedJSObject
wrappedJSObject is a property sometimes available on XPConnect wrappers. When available, it lets you access the JavaScript object hidden by the wrapper.
XPCOM ABI
XPCOM ABI is the binary interface of XPCOM components. While XPCOM components written in a scripting language (such as JavaScript) can be moved across platforms (such as Windows and OS X) without adaptation, those written in a compiled language (such as C++) require recompilation when moving to a different platform. Often, compiled XPCOM components are called 'binary' or 'native'.
XPCOM category image-sniffing-services
In versions of Firefox prior to Firefox 3, extensions could add decoders for new image types. However, such decoders relied on servers sending correct MIME types; images sent with incorrect MIME types would not be correctly displayed.
XPCOM glue
The XPCOM Glue is a static library which component developers and embedders can link against. It allows developers to link only against the frozen XPCOM method symbols and maintain compatibility with multiple versions of XPCOM.
XPCOM guide
These articles provide tutorials and usage documentation for XPCOM, including how to use it in your own projects and how to build XPCOM components for your Firefox add-ons and the like.
XPCOM ownership guidelines
...naturally. If you create a temporary object, obviously it's up to you to destroy it. That's a sure sign of ownership. If you create an object with a longer lifespan, you will own it until you give ownership away.
XPCOM reference
This reference describes the interfaces and functions provided by the XPCOM library. In addition, it details the various helper classes and functions, as well as the components, provided by the XPCOM glue library. The contents herein are oriented primarily toward extension developers and people embedding XPCOM in other projects.
XPCOM tasks
The XPCOM module roughly parallels the C/C++ standard libraries. It overlaps them significantly, but goes beyond them in capabilities. XPCOM sits above the standard libraries. Its role is to extend them with facilities tailored to XPCOM development in general, and specifically the needs of Mozilla. Like the standard libraries, XPCOM must be a fairly self-contained library, so as not to encumber clients with any unnecessary external dependencies.
XPCOM Thread Synchronization
XPCOM thread synchronization primitives have the same semantics as those in NSPR, and each method of these synchronization objects (e.g. Mutex::Lock()) has a matching function in NSPR (PR_Lock()). This is no accident, as mozilla:: primitives are merely bare-minimum wrappers around NSPR's.
xptcall FAQ
xptcall is a small low level XPCOM method call library. It is implemented using platform specific C/C++ and assembly language code. It is used to facilitate cross language and cross thread method calls. Porting this code is required in order to make Mozilla run on any given platform.
Xptcall Porting Guide
Original Author: John Bandhauer, 31 May 1999.
Xptcall Porting Status
This is a status page for the multiplatform porting of xptcall. xptcall has a FAQ and a Porting Guide.
-
- -
- -
-

Join the XPCOM community

-
-
Choose your preferred method for joining the discussion:
- -
- -
-
- - diff --git a/files/pt-pt/mozilla/tech/xpcom/reference/glue_classes/index.html b/files/pt-pt/mozilla/tech/xpcom/reference/glue_classes/index.html deleted file mode 100644 index e98aa51571..0000000000 --- a/files/pt-pt/mozilla/tech/xpcom/reference/glue_classes/index.html +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: XPCOM glue classes -slug: Mozilla/Tech/XPCOM/Reference/Glue_classes -tags: - - Classes - - Landing - - NeedsTranslation - - TopicStub - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Reference/Glue_classes ---- -

These "glue" classes are provided to make it easier to use XPCOM from C++ code. When these classes are used by a component, you may need to link the component against the XPCOM glue library.

-

{{LandingPageListSubpages}}

diff --git a/files/pt-pt/mozilla/tech/xpcom/reference/index.html b/files/pt-pt/mozilla/tech/xpcom/reference/index.html deleted file mode 100644 index 29d07953d6..0000000000 --- a/files/pt-pt/mozilla/tech/xpcom/reference/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: XPCOM reference -slug: Mozilla/Tech/XPCOM/Reference -tags: - - Add-ons - - Extensions - - Landing - - Mozilla - - NeedsTranslation - - Reference - - TopicStub - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Reference ---- -

This reference describes the interfaces and functions provided by the XPCOM library. In addition, it details the various helper classes and functions, as well as the components, provided by the XPCOM glue library. The contents herein are oriented primarily toward extension developers and people embedding XPCOM in other projects.

- -
-

WebExtensions are becoming the new standard for creating add-ons. Eventually support for XPCOM add-ons will be deprecated, so you should begin to investigate porting your add-ons to use the WebExtensions API, and report any missing functionality so we can be sure to address your concerns. Work is ongoing on WebExtension capabilities, so your input will help prioritize and plan the work. To learn more about the kinds of changes that will be needed, see Comparison with XUL/XPCOM extensions. In addition, any binaries you use will then need to be converted for use with the WebExtensions native messaging API, or compiled using WebAssembly or Emscripten.

-
- -
-

If you're working on a module in the Mozilla codebase that's compiled with the MOZILLA_INTERNAL_API flag set, some of these APIs -- the string functions and classes in particular -- are not the ones you should be using. See the XPCOM internal string guide for documentation of the internal string API used within the Mozilla codebase.

-
- -

{{LandingPageListSubpages}}

- -

Many XPCOM pages return an nsresult. Prior to Gecko 19 {{geckoRelease(19)}}, this was an integer that simply returned an error code. It is now a strongly typed enum when XPCOM is built using a C++11 compiler. This causes compile-time errors to occur when improper values are returned as nsresult values, thereby making it easier to catch many bugs.

diff --git a/files/pt-pt/mozilla/tech/xul/attribute/textbox.type/index.html b/files/pt-pt/mozilla/tech/xul/attribute/textbox.type/index.html deleted file mode 100644 index e30799ed4b..0000000000 --- a/files/pt-pt/mozilla/tech/xul/attribute/textbox.type/index.html +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: textbox.type -slug: Mozilla/Tech/XUL/Attribute/textbox.type ---- -

no redirect

diff --git a/files/pt-pt/mozilla/thunderbird/autoconfiguration/fileformat/como/index.html b/files/pt-pt/mozilla/thunderbird/autoconfiguration/fileformat/como/index.html deleted file mode 100644 index 06056d13df..0000000000 --- a/files/pt-pt/mozilla/thunderbird/autoconfiguration/fileformat/como/index.html +++ /dev/null @@ -1,243 +0,0 @@ ---- -title: 'Configuração automática: Como criar um ficheiro de configuração' -slug: Mozilla/Thunderbird/Autoconfiguration/FileFormat/Como -tags: - - Configuração Automática - - thunderbird -translation_of: Mozilla/Thunderbird/Autoconfiguration/FileFormat/HowTo ---- -

Definição

- -

Authoritative definition

- -

Exemplo

- -

Exemplo do mundo real

- -
<?xml version="1.0" encoding="UTF-8"?>
-
-<clientConfig version="1.1">
-  <emailProvider id="freenet.de">
-    <domain>freenet.de</domain>
-    <displayName>Freenet Mail</displayName>
-    <displayShortName>Freenet</displayShortName>
-    <incomingServer type="imap">
-      <hostname>imap.freenet.de</hostname>
-      <port>993</port>
-      <socketType>SSL</socketType>
-      <authentication>password-encrypted</authentication>
-      <username>%EMAILADDRESS%</username>
-    </incomingServer>
-    <incomingServer type="imap">
-      <hostname>imap.freenet.de</hostname>
-      <port>143</port>
-      <socketType>STARTTLS</socketType>
-      <authentication>password-encrypted</authentication>
-      <username>%EMAILADDRESS%</username>
-    </incomingServer>
-    <incomingServer type="pop3">
-      <hostname>pop.freenet.de</hostname>
-      <port>995</port>
-      <socketType>SSL</socketType>
-      <authentication>password-cleartext</authentication>
-      <username>%EMAILADDRESS%</username>
-    </incomingServer>
-    <incomingServer type="pop3">
-      <hostname>pop.freenet.de</hostname>
-      <port>110</port>
-      <socketType>STARTTLS</socketType>
-      <authentication>password-cleartext</authentication>
-      <username>%EMAILADDRESS%</username>
-    </incomingServer>
-    <outgoingServer type="smtp">
-      <hostname>smtp.freenet.de</hostname>
-      <port>587</port>
-      <socketType>SSL</socketType>
-      <authentication>password-encrypted</authentication>
-      <username>%EMAILADDRESS%</username>
-    </outgoingServer>
-    <outgoingServer type="smtp">
-      <hostname>smtp.freenet.de</hostname>
-      <port>587</port>
-      <socketType>STARTTLS</socketType>
-      <authentication>password-encrypted</authentication>
-      <username>%EMAILADDRESS%</username>
-    </outgoingServer>
-    <documentation url="http://kundenservice.freenet.de/hilfe/email/programme/config/index.html">
-      <descr lang="de">Allgemeine Beschreibung der Einstellungen</descr>
-      <descr lang="en">Generic settings page</descr>
-    </documentation>
-    <documentation url="http://kundenservice.freenet.de/hilfe/email/programme/config/thunderbird/imap-thunderbird/imap/index.html">
-      <descr lang="de">TB 2.0 IMAP-Einstellungen</descr>
-      <descr lang="en">TB 2.0 IMAP settings</descr>
-    </documentation>
-  </emailProvider>
-</clientConfig>
-
- -

Como examinar os servidores de correio eletrónico

- -

To determine a server's capabilities, you can contact the server directly and talk the POP/IMAP/SMTP protocol manually (assuming you already know the hostname).
- For non-SSL, use netcat -v hostname port (preferred) or telnet hostname port as "client".

- - - -

In all cases, the server should respond with a list of capabilities.

- -

SSL / STARTTLS

- -

There are 2 SSL variants: normal SSL and STARTTLS.

- -

SSL normal

- -

The old-style SSL (including TLS, which is just the new name for SSL) has a special port:

- - - -

On Linux, you can contact the server via

- -
openssl s_client -connect hostname:port
- -

You should see output about the SSL handshake and the certificate. Important is what is listed as "CN=". This must be the same as the hostname that you contacted, otherwise the certificate is not valid (or you need to use another hostname).
- If you see nothing, then probably the server does not support SSL.
- After that, you can have the same protocol exchange as with netcat on standard ports, as listed above.

- -

STARTTLS

- -

STARTTLS is a special, new form of SSL, which works on the standard ports (e.g. port 143 for IMAP). You can contact the server via netcat as mentioned above. If you see "STARTTLS" (for IMAP, SMTP) or "STLS" (for POP) listed as one of the capabilities, the server should support STARTTLS.
- To try it out, on Linux, you can contact the server via

- -
openssl s_client -connect hostname:port -starttls proto
- -

...where "proto" is imap, pop3 or smtp. For example:

- -
openssl s_client -connect imap.example.com:143 -starttls imap
- -

You should get the same response as described above for openssl.

- -

Formato do ficheiro de configuração

- -

Add the appropriate port and socket type for each server, depending on protocol and SSL support. For example,
- for IMAP with SSL:

- -
<port>993<port>
-
-<socketType>SSL</socketType>
- -

for IMAP with STARTTLS:

- -
<port>143<port>
-<socketType>STARTTLS</socketType>
- -

for IMAP without any SSL (deprecated!):

- -
<port>143<port>
-
-<socketType>plain</socketType>
- -

Utilizar SSL

- -

Please do not submit or serve any configurations without SSL! There's no reason in 2010 why users still need to read mail entirely unprotected.
- If you are an ISP and think the server load is too high, try adding an SSL accelerator. They are cheap and widely used. In fact, even most freemail (!) providers these days support SSL, so if users pay you money for ISP service, that's all the more reason to give them proper service. But first simply try to enable software SSL - small servers may be fine with SSL and without any additional installations.

- -

Certificado válido

- -

Either way, be sure to use a valid certificate:

- - - -

Autenticação

- -

Probe the mail server, as explained above for STARTTLS. If you see CRAM-MD5 or APOP in the response, the server should support encrypted passwords. If you only see AUTH LOGIN and/or PLAIN, or no AUTH at all, the server probably does not support secure authentication. In the former case, select "Encrypted passwords" as "Authentication method" (in Thunderbird Account Settings UI, incoming server and SMTP server), and test whether you can actually log in with a real account (because some servers are unfortunately broken with regards to authentication, often due to a wrong or misconfigured SASL installation).

- -

Formato do ficheiro de configuração

- -

In the configuration file, for each IMAP, POP and SMTP server, you need to specify the authentication method.
-
- For plaintext passwords:

- -
<authentication>password-cleartext</authentication>
- -

For CRAM-MD5:

- -
<authentication>password-encrypted</authentication>
- -


- Discouraged settings (SMTP only):
- If the SMTP server can only be used after checking incoming mail, please use

- -
<authentication>smtp-after-pop</authentication>
- -

Note that RFC 4409 disallows that and requires the customer-facing SMTP server to support proper authentication via AUTH.
- If the SMTP server can only be used within the ISP's network, and requires no authentication, use:

- -
<authentication>client-IP-address</authentication>
- -

or, if it requires authentication in addition to the user being in the ISP network, use e.g.:

- -
<authentication>password-cleartext</authentication>
-
-<restriction>client-IP-address</restriction>
-
- -

However, that means that users on the road or in the office are unable to send mail, which is a real problem for many of our users. This violates RFC 4409 as well and is an outdated configuration. Please try find a configuration that works in all cases, for the sake of the users.

- -

Por favor, suporte as palavras-passe MD5

- -

Please support authentication with CRAM-MD5. It is simple to implement, and to set up, and you can still use RADIUS or a database that stores passwords in plaintext, so you don't need to make changes to your mail server or authentication infrastructure apart from installing some software and configuring it correctly. CRAM-MD5 is particularly important when no SSL is used: Never make users send their passwords in plaintext over the network! (Not even in your ISP network.) We warn users in the Mail Account Creation dialog about such insecure configurations, and we reserve the right to block them in the future.
-
- As an ISP, you should ideally store passwords in encrypted format, which removes the risk of mass password theft (and possibly reuse on other sites) if somebody hacks your servers. You can still support plaintext passwords in this case, and encrypt passwords on the fly before comparing. (Users who use plaintext passwords would still be somewhat exposed, but at least you don't have the risk of the whole plaintext password database being stolen.) You can use both plaintext and encrypted authentication transmission with plaintext or encrypted password databases - the two issues are independent.

- -

Nome de utilizador

- -

If the user's IMAP login name is the same as his email address (for example, if "fred@example.com" is the login name), add:

- -
<username>%EMAILADDRESS%</username>
- -

Note: Use %EMAILADDRESS% as literal. Thunderbird will replace it with the email address that the user entered. Same for %EMAILLOCALPART% and other placeholders.

- -

If the login name is the same as the first segment before the @ of the email address (for example, "fred" for "fred@example.com"), use:

- -
<username>%EMAILLOCALPART%</username>
- -

Pseudónimos, ou nome de utilziador não são parte do endereço de e-mail

- -

Note that the above must be true for any email address that the user would set up - even for aliases.
-
- You can ignore aliases like info@, if that's an alias for fred@ (or both fred@ and wilma@) and Fred would set up fred@example.com in Thunderbird, not info@.
-
- If, however, Fred can set up hero@example.com as alias for fred@example.com, and neither "hero" nor "hero@example.com" would work as login name on your IMAP server, you need to set up a lookup of alias -> username on your autoconfig server. So, if you get a request for <http://autoconfig.example.com/mail/c...ro@example.com>, your autconfig server must have a script which responds to /mail/config-v1.1.xml and returns the concrete username, for example:

- -
<username>fred</username>
- -

... (or <username>fred@example.com</username>, as appropriate) for hero@example.com. This is the only way to enable automatic configuration without users having to remember what their primary login name was, which is a serious problem in practical experience. Even if you have told them all the necessary information in your welcome letter, they usually cannot find the letter. That's exactly where autoconfiguration tries to help.

- -

Ativar visiturl

- -

Some providers do not provide IMAP or POP service by default, but require it to be enabled via a web UI. If that is the case, add the URL that a logged-in user would use into this field, and the application can prompt the user to visit it.

- -

This is not yet supported by Thunderbird 3.1, but should be in the future, so please add this critical information where it applies.

- -

If you are an ISP, please by all means avoid this. It's one of those "walls" against which users run the hard way.

- -

URL da documentação

- -

If the configuration is (partially) based on a help webpage of the ISP that describes the configuration that end users should use, you can record its URL here. You may add several of them, as several elements. It is for informational purposes only and mainly for the maintenance of the config file, the client currently does not use them at all.

- -
If your URL contains ampersands (&), please remember to replace them with HTML entities (&amp;). For example:
- -
<documentation url="http://example.com/help.php?client=thunderbird&amp;lang=en"/>
- -
Otherwise your XML file will be incorrect and Thunderbird will neither be able to parse it, nor to return any error message.
diff --git a/files/pt-pt/mozilla/thunderbird/autoconfiguration/fileformat/definicao/index.html b/files/pt-pt/mozilla/thunderbird/autoconfiguration/fileformat/definicao/index.html deleted file mode 100644 index 2df3fcc731..0000000000 --- a/files/pt-pt/mozilla/thunderbird/autoconfiguration/fileformat/definicao/index.html +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Definição do formato de ficheiro da configuração automática -slug: Mozilla/Thunderbird/Autoconfiguration/FileFormat/Definicao -translation_of: Mozilla/Thunderbird/Autoconfiguration/FileFormat/Definition ---- -

Por favor, consulte https://wiki.mozilla.org/Thunderbird:Autoconfiguration:ConfigFileFormat (inglês).

diff --git a/files/pt-pt/mozilla/thunderbird/autoconfiguration/fileformat/index.html b/files/pt-pt/mozilla/thunderbird/autoconfiguration/fileformat/index.html deleted file mode 100644 index 76a90f2777..0000000000 --- a/files/pt-pt/mozilla/thunderbird/autoconfiguration/fileformat/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Autoconfig file format -slug: Mozilla/Thunderbird/Autoconfiguration/FileFormat -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Thunderbird/Autoconfiguration/FileFormat ---- - diff --git "a/files/pt-pt/mozilla/thunderbird/configuracao_autom\303\241tica/index.html" "b/files/pt-pt/mozilla/thunderbird/configuracao_autom\303\241tica/index.html" deleted file mode 100644 index f0a647cc98..0000000000 --- "a/files/pt-pt/mozilla/thunderbird/configuracao_autom\303\241tica/index.html" +++ /dev/null @@ -1,162 +0,0 @@ ---- -title: Configuração Automática no Thunderbird -slug: Mozilla/Thunderbird/Configuracao_automática -tags: - - Administração - - empresa -translation_of: Mozilla/Thunderbird/Autoconfiguration ---- -

Autor: Ben Bucksch
- Por favor, não altere este documento sem consultar o autor.

- -

Thunderbird 3.1 and later (and 3.0 to some degree) includes mail account autoconfiguration functionality. The goal of autoconfiguration is to make it very easy for users to configure the connection of Thunderbird to their email servers. In many cases, people should be able to download and install Thunderbird, enter their real name, email address and password in the Account Setup Wizard and have a fully functioning mail client and get and send their mail as securely as possible.

- -

Consulte também:

- - - -

This document describes how Autoconfiguration in Thunderbird works, and what to do to allow mail servers to be autoconfigured.

- -

Mecanismos

- -

Thunderbird gets the server settings via different means, each of which is intended for different cases:

- - - -

All the lookup mechanisms use the email address domain as base for the lookup. For example, for the email address fred@example.com , the lookup is performed as (in this order):

- -
    -
  1. tb-install-dir/isp/example.com.xml on the harddisk
  2. -
  3. check for autoconfig.example.com
  4. -
  5. look up of "example.com" in the ISPDB
  6. -
  7. look up "MX example.com" in DNS, and for mx1.mail.hoster.com, look up "hoster.com" in the ISPDB
  8. -
  9. try to guess (imap.example.com, smtp.example.com etc.)
  10. -
- -

We may add DNS SRV records as supported mechanism in the future, but we currently do not.

- -

Como adicionar suporte para o seu domínio

- -

Classificação

- -

If you are a big ISP (> 100,000 users) providing email addresses solely under a few domains like "example.com" and "example.de", you may either submit the configuration to the ISPDB or set up a configuration server.
-
- If you support email aliases and the user's login name is not part of the email address (for example, users may have "hero@example.com" as email address, but the IMAP/POP/SMTP login name is neither "hero" nor "hero@example.com", but "u67578"), you need to set up a configuration server, which does the email address -> login name lookup.
-
- If you host customer domains, i.e. you are "hoster.com", but your customers have "fred@flintstone.com" and "louis@kent.com" as domains, with only a few users per domain, you need to set up a configuration server (or rely on DNS MX).
-
- If you are a small company installing Thunderbird on your employees' desktops, you can place a configuration file in the Thunderbird installation folder.

- -

ISPDB

- -

Database URL is <https://live.mozillamessaging.com/autoconfig/v1.1/>, append domain name, e.g. <https://live.mozillamessaging.com/autoconfig/v1.1/freenet.de>.
-
- Current process: File a bug in Bugzilla, Product "Webtools", Component "ISPDB Database Entries", with a configuration file that matches the requirements described below.  The component is actively watched for new bugs (as of November 2015) so there is no need to request review on the file.

- -

Configuração do servidor no ISP

- -

Given the email address "fred@example.com", Thunderbird first checks <http://autoconfig.example.com/mail/config-v1.1.xml?emailaddress=fred@example.com> and then <http://example.com/.well-known/autoconfig/mail/config-v1.1.xml>.

- -

Empresa pequena

- -

If you are a small company, you can put the XML configuration file on your web server, at URL <http://example.com/.well-known/autoconfig/mail/config-v1.1.xml>. (This is not yet finalized and subject to change.)

- -

Hospedeiro do domínio

- -

If you are an ISP that hosts domains for your customers - for example, you are hoster.com and your customer registers fancy.com or example.com, and your servers accept and serve the mail for example.com -, you should set up an autoconfig server.

- -

DNS

- -

For each customer domain, you add a DNS record (in addition to the existing MX, A www etc. DNS records):
- autoconfig IN A 10.2.3.4
- or
- autoconfig IN CNAME autoconfig.hoster.com.
- ... where 10.2.3.4 and autoconfig.hoster.com are IP addresses / hostnames you own.
- This allows Thunderbird to find you as hoster.

- -

To make the Version without an autoconfig DNS Entry work you have to make sure that example.com points to the Webserver you will place the config-v1.1.xml on.

- -

Example: example.com A 10.2.3.4

- -

Servidor da Web

- -

You set up a web server bound to a physical IP address. This may be on the same machine as other web servers, but the web server must be configured to the content to any requested domain.
-
- You must use a virtual host that match all autoconfig.* domains of your customers. In Apache terms, you can use a "ip-based virtual host". In the Apache configuration files, that means something like: Listen 10.2.3.4:80 (of course, you use a public IP address that you own)

- -
<VirtualHost 10.2.3.4:80> #Must be the first and only virtual host with this ip!
-    DocumentRoot /var/www/autoconfig/
-    ServerName autoconfig.hoster.com
-    <Directory /var/www/autoconfig>
-	Order allow,deny
-	allow from all
-    </Directory>
-</VirtualHost>
- -

Place the configuration file at the URL /mail/config-v1.1.xml on that host.

- -

All config files must be served as Content-Type: text/xml (or application/xml), otherwise the file will be ignored. Also, they must use charset UTF-8 (esp. if there are any non-ASCII-characters).

- -

If you like to use name-based virtual hosts you probably don't want to setup the autoconfig subdomain for every domain of your customers.
- You can add a Rewriterule in the default virtual host (on debian /etc/apache2/sites-enabled/000-default)  to match all autoconfig.* subdomains:

- -
<VirtualHost *:80> #Must be the first Virtual host
-	ServerAdmin webmaster@hoster.com
-	ServerName www
-	DocumentRoot /var/www
-	RewriteEngine On
-	RewriteCond %{HTTP_HOST} ^autoconfig\. [NC]
-	RewriteRule ^/(.*)	http://autoconfig.hoster.com/$1 [L,R=301,NE]
-        #...
-</VirtualHost>
-<VirtualHost *:80>
-    DocumentRoot /var/www/autoconfig/
-    ServerName autoconfig.hoster.com
-    <Directory /var/www/autoconfig>
- 	Order allow,deny
-	allow from all
-    </Directory>
-</VirtualHost>
-
- -

If you use nginx, you can easily add a subdomain to all your Domains, which does the same as above. Either, you can redirect them to a common hostname:

- -
server {
-	listen 10.2.3.4:80; #use your server's public IP here!
-	server_name autoconfig.*;
-	return 301 http://autoconfig.hoster.com$request_uri;
-}
-
- -

Or serve them directly from a common directory:

- -
server {
-	listen 10.2.3.4:80; #again, use your server's public IP here!
-	server_name autoconfig.*;
-	location / {
-		root /var/www/autoconfig;
-	}
-}
-
- -

 

- -

Ficheiro de configuração

- -

Isto é descrito em Como criar um ficheiro de configuração e definido nas sub páginas.

diff --git a/files/pt-pt/mozilla/thunderbird/index.html b/files/pt-pt/mozilla/thunderbird/index.html deleted file mode 100644 index 0ca93f176b..0000000000 --- a/files/pt-pt/mozilla/thunderbird/index.html +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: Thunderbird -slug: Mozilla/Thunderbird -tags: - - NeedsTranslation - - TopicStub - - thunderbird -translation_of: Mozilla/Thunderbird ---- -

Thunderbird is Mozilla's mail/messaging application. These pages document Thunderbird and also provide links to documentation about the MailNews backend which is also used in other projects such as Eudora/Penelope, Seamonkey, Correo, etc.

- -

Thunderbird is Firefox's kid sibling, and is built on the same technical platform as the web browser. In development for many years, and currently one of the most popular open source email clients, it is used by millions of people around the world to bring together all their email accounts, newsgroup and feed reading in a familiar high-productivity environment. (From early 2007 to early 2011 Thunderbird was developed by Mozilla Messaging, a subsidiary that was owned by Mozilla.)

- - - - - - - - -
-

Documentation

- -
-
Building Thunderbird
-
Information about building Thunderbird with the comm-central repository. There's also information about how comm-central works, how the review process works and how to use the Mozilla symbol server to help with debugging.
-
MailNews Protocols
-
Rough documentation about mail protocols..
-
Database views
-
Backend information about {{ Interface("nsIMsgDBView") }} and related interfaces..
-
Thunderbird API documentation
-
Thunderbird API documentation
-
Extension documentation
-
Tutorials and tips for building Thunderbird extensions
-
Automated Testing
-
Details of Thunderbird's automated testing facilities
-
Thunderbird in the Enterprise
-
Help with deploying Thunderbird in large organizations
-
- -

View All...

-
-

Community

- - - -

Tools

- - -
- -

 

diff --git a/files/pt-pt/mozilla/thunderbird/lancamentos/index.html b/files/pt-pt/mozilla/thunderbird/lancamentos/index.html deleted file mode 100644 index 354a6d7335..0000000000 --- a/files/pt-pt/mozilla/thunderbird/lancamentos/index.html +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: Thunderbird - Notas de lançamento de programador -slug: Mozilla/Thunderbird/Lancamentos -tags: - - Landing - - Lançamento - - Mozilla - - thunderbird -translation_of: Mozilla/Thunderbird/Releases ---- -

Esta página fornece hiperligações para os artigos do "Thunderbird X para programadores" para cada lançamento do Thunderbird. Estas notas deixam-no ver quais as funcionalidades que foram adicionadas e os erros eliminados em cada versão do Thunderbird.

- -
{{ListSubpages("/pt-PT/docs/Mozilla/Thunderbird/Releases",1,1,1)}}
- -

Ver também

- - diff --git a/files/pt-pt/mozilla/trabalhar_com_janelas_no_codigo_chrome/index.html b/files/pt-pt/mozilla/trabalhar_com_janelas_no_codigo_chrome/index.html deleted file mode 100644 index a3f012eb7a..0000000000 --- a/files/pt-pt/mozilla/trabalhar_com_janelas_no_codigo_chrome/index.html +++ /dev/null @@ -1,397 +0,0 @@ ---- -title: Trabalhar com janelas no código chrome -slug: Mozilla/trabalhar_com_janelas_no_codigo_chrome -tags: - - Add-ons - - Extensões - - Extras - - Guía -translation_of: Mozilla/Working_with_windows_in_chrome_code ---- -

Este artigo descreve o trabalho com várias janelas no código da Mozilla (aplicações XUL e Extensões). Este contém dicas e código exemplo em como abrir novas janelas, encontrar uma janela já aberta, e passar dados entre diferentes janelas.

- -

Abertura de janelas

- -

From a <script> in a window or an overlay

- -

To open a new window, we usually use a window.open or window.openDialog DOM call, like this:

- -
-
var win = window.open("chrome://myextension/content/about.xul",
-                      "aboutMyExtension", "chrome,centerscreen");
-
-
- -

The first parameter to window.open is the URI of the XUL file that describes the window and its contents.

- -

The second parameter is the window's name; the name can be used in links or forms as the target attribute. This is different from the user-visible window title, which is specified using XUL.

- -

The third, and optional, parameter is a list of special window features the window should have.

- -

The window.openDialog function works similarly, but lets you specify optional arguments that can be referenced from the JavaScript code. It also handles window features a little differently, including always assuming the dialog feature is specified.

- -

From XPCOM components and modules

- -

If the Window object is unavailable (for example, when opening a window from XPCOM component code), you might want to use nsIWindowWatcher interface. Its parameters are similar to window.open; in fact, window.open's implementation calls nsIWindowWatcher's methods.

- -
-
var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
-                   .getService(Components.interfaces.nsIWindowWatcher);
-var win = ww.openWindow(null, "chrome://myextension/content/about.xul",
-                        "aboutMyExtension", "chrome,centerscreen", null);
-
- -

Objeto de janela

- -

Note the win variable in the above section, which is assigned the return value of window.open. It can be used to access the opened window. The return value of window.open (and similar methods) is a Window object (usually ChromeWindow) – the same type as the window variable.

- -

Technically speaking, it implements a number of interfaces, including {{ interface("nsIDOMJSWindow") }} and {{ interface("nsIDOMWindow") }}, but it also contains the user-defined properties for global variables and functions of the window. So, for example, to access the DOM document corresponding to the window, you can use win.document.

- -

Note however, that the open() call returns before the window is fully loaded, so some calls, like win.document.getElementById() will fail. To overcome this difficulty, you can move the initialization code to a load handler of the window being opened or pass a callback function, as described below.

- -

You can get a Window object from a document using document.defaultView.

- -

Janelas de conteúdo

- -

When a XUL window contains a widget capable of displaying a page, such as <browser> or <iframe>, the document in that widget is, naturally, separate from the document of the chrome window itself. There also is a Window object for each sub-document, although there's no window in a common sense for the sub-document.

- -

The same holds for chrome windows opened inside a tab of <tabbrowser>. The elements above the chrome document opened in the tab are separate from your chrome document.

- -

The following two subsections describe how to cross chrome-content boundaries in either way, i.e. accessing elements which are ancestors of your chrome document, or accessing elements which are descendants of your chrome document (but nevertheless in a different context).

- -

Accessing content documents

- -

Assume you have a document loaded in a <tabbrowser>, <browser>, or <iframe> element inside your document. You can use browser.contentDocument to access that document and browser.contentWindow to access the Window object of that document.

- -

You should be aware of XPCNativeWrappers when working with untrusted content. With XPCNativeWrappers turned on (which is the default in Firefox 1.5+), your extension can safely access the DOM of the content document, but not the content JavaScript. Bypassing XPCNativeWrapper to work with content JavaScript directly can lead to security problems.

- -

See Interaction between privileged and non-privileged pages if you need to interact with the content page.

- -

The content shortcut

- -

In case of <browser type="content-primary" />, you can use the content shortcut property to accesss the Window object of the content document. For example:

- -
// alerts the title of the document displayed in the content-primary widget
-
-alert(content.document.title);
- -

For example, you can use content.document in a browser.xul overlay to access the web page in the selected tab in a Firefox window.

- -
Some examples use _content instead of content. The former has been deprecated for a while, and you should use content in the new code.
- -

Accessing a document in the sidebar

- -

Firefox has a sidebar, which is implemented as a <browser> element with id="sidebar". To access the elements and variables inside the sidebar, you need to use document.getElementById("sidebar").contentDocument or .contentWindow, like when {{ Anch("Accessing content documents") }}.

- -

For more sidebar tips, see Code snippets:Sidebar.

- -

Accessing the elements of the top-level document from a child window

- -

The opposite case is when you want to access the chrome document from a privileged script loaded in a <browser> or an <iframe>.

- -

A typical case when this can be useful is when your code runs in the sidebar in the main Firefox window and you want to access the elements in the main browser window.

- -

The DOM tree, as shown by the DOM Inspector, can look like this:

- -
#document
-  window                 main-window
-    ...
-      browser
-        #document
-          window         myExtensionWindow
-
- -

where the child window is where your code runs in.

- -

Your task is to access elements above your chrome document, i.e. to break out of your chrome window and access the ancestors. This can be done using the following statement:

- -
var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
-                   .getInterface(Components.interfaces.nsIWebNavigation)
-                   .QueryInterface(Components.interfaces.nsIDocShellTreeItem)
-                   .rootTreeItem
-                   .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
-                   .getInterface(Components.interfaces.nsIDOMWindow);
- -

This allows you to cross the chrome-content boundaries, and returns the main window object.

- -

Encontrar janelas já abertas

- -

The window mediator XPCOM component (nsIWindowMediator interface) provides information about existing windows. Two of its methods are often used to obtain information about currently open windows: getMostRecentWindow and getEnumerator. Please refer to the nsIWindowMediator page for more information and examples of using nsIWindowMediator. === Example: Opening a window only if it's not opened already === XXX TBD

- -

Passar dados entre janelas

- -

When working with multiple windows, you often need to pass information from one window to another. Since different windows have separate DOM documents and global objects for scripts, you can't just use one global JavaScript variable in scripts from different windows.

- -

There are several techniques of varying power and simplicity that can be used to share data. We'll demonstrate them from the simplest to the most complex in the next few sections.

- -

Note: if you want to pass data between privileged (chrome) and non-privileged (web page) windows, or vice-versa, read this instead.

- -

Example 1: Passing data to window when opening it with openDialog

- -

When you open a window using window.openDialog or nsIWindowWatcher.openWindow, you can pass an arbitrary number of arguments to that window. Arguments are simple JavaScript objects, accessible through window.arguments property in the opened window.

- -

In this example, we're using window.openDialog to open a progress dialog. We pass in the current status text as well as the maximum and current progress values. Note that using nsIWindowWatcher.openWindow is a bit less trivial . TODO: link to How To Pass an XPCOM Object to a New Window when it has a more useful example

- -

Opener code:

- -
window.openDialog("chrome://test/content/progress.xul",
-                  "myProgress", "chrome,centerscreen",
-                  {status: "Reading remote data", maxProgress: 50, progress: 10} );
- -

progress.xul:

- -
<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
-<window onload="onLoad();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-<script><![CDATA[
-
-var gStatus, gProgressMeter;
-var maxProgress = 100;
-
-function onLoad() {
-  gStatus = document.getElementById("status");
-  gProgressMeter = document.getElementById("progressmeter");
-
-  if("arguments" in window && window.arguments.length > 0) {
-    maxProgress = window.arguments[0].maxProgress;
-    setProgress(window.arguments[0].progress);
-    setStatus(window.arguments[0].status);
-  }
-}
-
-function setProgress(value) {
-  gProgressMeter.value = 100 * value / maxProgress;
-}
-
-function setStatus(text) {
-  gStatus.value = "Status: " + text + "...";
-}
-
-]]></script>
-
-<label id="status" value="(No status)" />
-<hbox>
-  <progressmeter id="progressmeter" mode="determined" />
-  <button label="Cancel" oncommand="close();" />
-</hbox>
-
-</window>
- -

Example 2: Interacting with the opener

- -

Sometimes an opened window needs to interact with its opener; for example, it might do so in order to give notice that the user has made changes in the window. You can find the window's opener using its window.opener property or via a callback function passed to the window in a way described in the previous section.

- -

Let's add code to the previous example to notify the opener when the user presses Cancel on the progress dialog.

- - - -

If we're sure the window that opened the progress dialog declares the cancelOperation function, we can use window.opener.cancelOperation() to notify it, like this:

- -
<button label="Cancel" oncommand="opener.cancelOperation(); close();" />
-
- - - -
function onCancel() {
-  alert("Operation canceled!");
-}
-
-...
-
-window.openDialog(
-  "chrome://test/content/progress.xul",
-  "myProgress", "chrome,centerscreen",
-  {status: "Reading remote data", maxProgress: 50, progress: 10},
-  onCancel
-);
-
- -

The progress dialog can then run the callback like this:

- -
<button label="Cancel" oncommand="window.arguments[1](); close();" />
-
- -

Example 3: Using nsIWindowMediator when opener is not enough

- -

The window.opener property is very easy to use, but it's only useful when you're sure that your window was opened from one of a few well-known places. In more complicated cases you need to use the nsIWindowMediator interface, introduced above.

- -

One case in which you might want to use nsIWindowMediator is in an extension's Options window. Suppose you're developing a browser extension that consists of a browser.xul overlay and an Options window. Suppose the overlay contains a button to open the extension's Options window which needs to read some data from the browser window. As you may remember, Firefox's Extension Manager can also be used to open your Options dialog.

- -

This means the value of window.opener in your Options dialog is not necessarily the browser window -- instead, it might be the Extension Manager window. You could check the location property of the opener and use opener.opener in case it's the Extension Manager window, but a better way is to use nsIWindowMediator:

- -
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
-                   .getService(Components.interfaces.nsIWindowMediator);
-var browserWindow = wm.getMostRecentWindow("navigator:browser");
-// read values from |browserWindow|
- -

You might be tempted to use a similar technique to apply the changes the user made in the Options dialog, but a better way to do that is to use preferences observers.

- -

Example 4: Using nsIWindowWatcher when you don't have a window (primitives only)

- -

For those times when you don't have access to a window object (such as a JavaScript XPCOM object), you can use nsIWindowWatcher.openWindow to open a XUL window. The problem is passing the data. It's a bit harder than using window.openDialog. Here is helper function that will package the data correctly and pass it to the newly opened window:

- -
function openDialog(parentWindow, url, windowName, features) {
-    var array = Components.classes["@mozilla.org/array;1"]
-                          .createInstance(Components.interfaces.nsIMutableArray);
-    for (var i = 4; i < arguments.length; i++) {
-        var variant = Components.classes["@mozilla.org/variant;1"]
-                                .createInstance(Components.interfaces.nsIWritableVariant);
-        variant.setFromVariant(arguments[i]);
-        array.appendElement(variant, false);
-    }
-
-    var watcher = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
-                            .getService(Components.interfaces.nsIWindowWatcher);
-    return watcher.openWindow(parentWindow, url, windowName, features, array);
-}
-
- -

The function almost works the same as window.openDialog but accepts an optional parent window as first parameter. The parent window can be null. The only data types that can be passed to the new window are primitives and arrays. JavaScript objects cannot be passed. All of the arguments are passed by value, that is to say that any changes made to the values in the new window will not affect the calling code.

- -

Example 5: Using nsIWindowWatcher for passing an arbritrary JavaScript object

- -

It is still possible to pass any JavaScript object using nsIWindowWatcher, it just takes a little more effort. In this example a single object is passed, though it is possible to pass multiple objects and primitives using a combination of this and the example above.

- -
// In the calling code
-var args = {
-  param1: true,
-  param2: 42
-};
-
-args.wrappedJSObject = args;
-
-var watcher = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
-                            .getService(Components.interfaces.nsIWindowWatcher);
-
-watcher.openWindow(null, url, windowName, features, args);
- -
// In the window code
-var args = window.arguments[0].wrappedJSObject;
-
- -

This uses the wrappedJSObject trick. By passing args to openWindow xpconnect will automatically wrap it as a generic nsISupports. The opened window can then just get at the underlying JavaScript object using wrappedJSObject.

- -

Partilha de dados avançada

- -

The above code is useful when you need to pass data from one window to another or to a set of windows, but sometimes you just want to share a JavaScript variable in common between different windows. You could declare a local variable in each window along with corresponding setter functions to keep the "instances" of the variable in sync across windows, but fortunately, there's a better way.

- -

To declare a shared variable, we need to find a place that exists while the application is running and is easily accessible from the code in different chrome windows. There are actually a few such places.

- -

Using JavaScript code modules

- -

JavaScript code modules {{ Fx_minversion_inline(3) }} is a simple method for creating shared global singleton objects that can be imported into any other JavaScript scope. The importing scope will have access to the objects and data in the code module. Since the code module is cached, all scopes get the same instance of the code module and can share the data in the module. See Components.utils.import for more information.

- - - -

Using an XPCOM singleton component

- -

The cleanest and most powerful way to share data is to define your own XPCOM component (you can write one in JavaScript) and access it from anywhere using a getService call:

- -
Components.classes["@domain.org/mycomponent;1"].getService();
-
- - - -

There are several articles and books about creating XPCOM components online.

- -

Using FUEL Application object

- -
-

The FUEL library has been deprecated as of Firefox 41

-
- -

The FUEL JavaScript library {{ Fx_minversion_inline(3) }} has a simple method for sharing data between windows. The Application object supports a storage property which can be used to store data globally. This method is a simplified form of the XPCOM singleton method.

- -
Application.storage.set(keyname, data);
-
-var data = Application.storage.get(keyname, default);
-
-where: keyname is a string used to identify the data
-       data is the data
-       default is the data value to return if keyname does not exists
-
- - - -

Storing shared data in preferences

- -

If you just need to store a string or a number, writing a whole XPCOM component may be an unnecessary complication. You can use the preferences service in such cases.

- - - -

See Code snippets:Preferences for detailed description of the preferences system and example code.

- -

Example:

- -
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
-                      .getService(Components.interfaces.nsIPrefService);
-var branch = prefs.getBranch("extensions.myext.");
-var var1 = branch.getBoolPref("var1"); // get a pref
- -

Consulte também

- - diff --git "a/files/pt-pt/mozilla/utiliza\303\247\303\243o_cxx_no_c\303\263digo_da_mozilla/index.html" "b/files/pt-pt/mozilla/utiliza\303\247\303\243o_cxx_no_c\303\263digo_da_mozilla/index.html" deleted file mode 100644 index 02ec29e2a2..0000000000 --- "a/files/pt-pt/mozilla/utiliza\303\247\303\243o_cxx_no_c\303\263digo_da_mozilla/index.html" +++ /dev/null @@ -1,552 +0,0 @@ ---- -title: Utilização de C++ no código da Mozilla -slug: Mozilla/Utilização_CXX_no_código_da_Mozilla -translation_of: Mozilla/Using_CXX_in_Mozilla_code ---- -

Caraterísticas da linguagem C++

- -

Mozilla code only uses a subset of C++. Runtime type information (RTTI) is disabled, as it tends to cause a very large increase in codesize. This means that dynamic_cast, typeid() and <typeinfo> cannot be used in Mozilla code. Also disabled are exceptions; do not use try/catch or throw any exceptions. Libraries that throw exceptions may be used if you are willing to have the throw instead be treated as an abort.

- -

As of Mozilla 25, C++11 mode is required to build Mozilla. As of Mozilla 37, MSVC 2013 Update 3 is required on Windows; as of Mozilla 38, gcc 4.7 is required on all platforms. As of Mozilla 48, gcc 4.8 is required on all platforms. This means that C++11 can be used where supported on all platforms. The list of acceptable features is given below:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 MSVCGCCClang 
Requisito mínimo atual20134.83.4 
FuncionalidadeMSVCGCCClangPode ser utilizada no código
type_t &&20104.32.9Sim (consultar notas)
ref qualifiers on methods20154.8.12.9Não
member initializers20134.73.0Sim
variadic templates20134.32.9Sim
Initializer lists20134.43.1Sim
static_assert20104.32.9Sim
auto20104.42.9Sim
lambdas20104.53.1Sim
decltype20104.32.9Sim
Foo<Bar<T>>20104.32.9Sim
auto func() -> int20104.43.1Sim
Templated aliasing20134.73.0Sim
nullptr20104.63.0Yes, but use decltype(nullptr) instead of std::nullptr_t.
enum foo : int16_t {};20084.42.9Sim
enum class foo {};20124.42.9Sim
enum foo;20124.63.1Sim
[[attributes]]20154.83.3Não (consultar notas)
constexpr20154.63.1Use MOZ_CONSTEXPR from mozilla/Attributes.h
alignof/alignas20154.83.3No (see notes) ; only clang 3.6 claims __has_feature(cxx_alignof)
Delegated constructors20134.73.0Sim
Inherited constructors20154.83.3Não
explicit operator bool()20134.53.0Sim
char16_t/u"string"20154.43.0Use MOZ_UTF16("string") instead of u"string".
R"(string)"20134.53.0Sim
operator""()20154.73.1Não
=delete20134.42.9Sim
=default20134.43.0Sim
unrestricted unions20154.63.1Não
for (auto x : vec)20124.63.0Yes (be careful about the type of the iterator)
override/final20124.73.0Sim
thread_local20154.83.3Não (consultar notas)
function template default arguments20134.32.9Sim
local structs as template parameters20104.52.9Sim
extended friend declarations20104.72.9Sim
0b100 (C++14)20154.92.9Não
Return type deduction (C++14)20154.93.4Não
Generic lambdas (C++14)20154.93.4Não
Initialized lambda captures (C++14)20154.93.4Não
Digit separator (C++14)20154.93.4Não
Variable templates (C++14)5.03.4Não
Relaxed constexpr (C++14)5.03.4Não
Concepts (Concepts TS)6.0Não
Inline variables (C++17)Não
constexpr_if (C++17)Não
constexpr lambdas (C++17)Não
- -

Notas

- -

rvalue references: Implicit move method generation cannot be used.

- -

Attributes: Several common attributes are defined in mozilla/Attributes.h or nscore.h.

- -

Alignment: Some alignment utilities are defined in mozilla/Alignment.h.

- -

Thread locals: There is a thread-local variable helper in mozilla/ThreadLocal.h. In addition, the native thread_local of MSVC2015 may break Windows XP support. See bug 1204752. The native thread_local of clang may break OSX 10.6, too, but support for OSX 10.6 has been retired.

- -

C++14: C++14 is not enabled on compilers that support it.

- -

Blibliotecas padrão de C++ e Mozilla

- -

The Mozilla codebase contains within it several subprojects which follow different rules for which libraries can and can't be used it. The rules listed here apply to normal platform code, and assume unrestricted usability of MFBT or XPCOM APIs.

- -
-

The rest of this section is a draft for expository and exploratory purposes. Do not trust the information listed here.

-
- -

What follows is a list of standard library components provided by Mozilla or the C++ standard. If an API is not listed here, then it is not permissible to use it in Mozilla code. Deprecated APIs are not listed here. In general, prefer Mozilla variants of data structures to standard C++ ones, even when permitted to use the latter, since Mozilla variants tend to have features not found in the standard library (e.g., memory size tracking) or have more controllable performance characteristics.

- -

Estruturas de dados

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NomeCabeçalhoSTL equivalenteNotes
nsAutoTArraynsTArray.h Like nsTArray, but will store a small amount as stack storage
nsAutoTObserverArraynsTObserverArray.h Like nsTObserverArray, but will store a small amount as stack storage
mozilla::BloomFiltermozilla/BloomFilter.h Probabilistic set membership (see Wikipedia)
nsClassHashtablensClassHashtable.h Adaptation of nsTHashtable, see XPCOM hashtable guide
nsCOMArraynsCOMArray.h Like nsTArray<nsCOMPtr<T>>
nsDataHashtablensClassHashtable.hstd::unordered_mapAdaptation of nsTHashtable, see XPCOM hashtable guide
nsDequensDeque.hstd::deque 
mozilla::EnumSetmozilla/EnumSet.h Like std::set, but for enum classes.
nsInterfaceHashtablensInterfaceHashtable.hstd::unordered_mapAdaptation of nsTHashtable, see XPCOM hashtable guide
nsJSThingHashtablensJSThingHashtable.h Adaptation of nsTHashtable, see XPCOM hashtable guide
mozilla::LinkedListmozilla/LinkedList.hstd::listDoubly-linked list
nsRefPtrHashtablensRefPtrHashtable.hstd::unordered_mapAdaptation of nsTHashtable, see XPCOM hashtable guide
mozilla::SegmentedVectormozilla/SegmentedVector.hstd::dequeDoubly-linked list of vector elements
mozilla::SplayTreemozilla/SplayTree.h Quick access to recently-accessed elements (see Wikipedia)
nsTArraynsTArray.hstd::vector 
nsTHashtablensTHashtable.hstd::unordered_mapSee XPCOM hashtable guide, you probably want a subclass
nsTObserverArraynsTObserverArray.h Like nsTArray, but iteration is stable even through mutation
nsTPriorityQueuensTPriorityQueue.hstd::priority_queueUnlike the STL class, not a container adapter
mozilla::Vectormozilla/Vector.hstd::vector 
- -

Untranslated notes:

- -

ns*String - too complicated to explain

- -

Safety utilities:
- mozilla::Array mfbt/Array.h (safe array index)
- mozilla::AssertedCast mfbt/Casting.h (casts)
- mozilla::CheckedInt mfbt/CheckedInt.h (avoids overflow)
- nsCOMPtr xpcom/glue/nsCOMPtr.h (~= std::shared_ptr)
- mozilla::EnumeratedArray mfbt/EnumeratedArray.h (mozilla::Array, for enum types)
- mozilla::RangedPtr mfbt/RangedPtr.h (prevents out-of-bounds)
- mozilla::RefPtr mfbt/RefPtr.h (~= std::shared_ptr)
- nsRefPtr xpcom/base/nsRefPtr.h (~= std::shared_ptr)
- StaticRefPtr xpcom/base/StaticPtr.h (nsRefPtr w/o static constructor)
- mozilla::UniquePtr mfbt/UniquePtr.h (~= std::unique_ptr)
- mozilla::WeakPtr mfbt/WeakPtr.h (~= std::weak_ptr)
- nsWeakPtr xpcom/base/nsWeakPtr.h (~= std::weak_ptr)

- -

Algos:
- mozilla::BinarySearch mfbt/BinarySearch.h
- mozilla::BitwiseCast mfbt/Casting.h (strict aliasing-safe cast)
- mozilla/MathAlgorithms.h (rotate, ctlz, popcount, gcd, abs, lcm)
- mozilla::RollingMean mfbt/RollingMean.h ()

- -

Misc:
- mozilla::AlignedStorage mfbt/Alignment.h (replacement for std::aligned_storage)
- mozilla::Atomic mfbt/Atomic.h (replacement for std::atomic)
- mozilla::CondVar xpcom/glue/CondVar.h
- mozilla::Maybe mfbt/Maybe.h (std::optional)
- mozilla::MaybeOneOf mfbt/MaybeOneOf.h (~mozilla::Maybe<union {T1, T2}>)
- mozilla::Monitor xpcom/glue/Monitor.h
- mozilla::Mutex xpcom/glue/Mutex.h
- mozilla::Pair mfbt/Pair.h (~= std::tuple<T1, T2> -- minimal space!)
- mozilla::ReentrantMonitor xpcom/glue/ReentrantMonitor.h
- mozilla::StaticMutex xpcom/base/StaticMutex.h
- mozilla::TimeStamp xpcom/ds/TimeStamp.h (~= std::chrono::time_point)

- -

mozilla/ArrayUtils.h
- mozilla/Compression.h
- mozilla/Endian.h
- mozilla/FloatingPoint.h
- mozilla/HashFunctions.h (~= std::hash)
- mozilla/Move.h (std::move, std::swp, std::Forward)
- mozilla/PodOperations.h (C++ versions of memset, memcpy, etc.)
- mozilla/TypeTraits.h (replacement for <type_traits>)

- -

(TODO: make list of STL usability here)

-- cgit v1.2.3-54-g00ecf