diff options
author | Ryan Johnson <rjohnson@mozilla.com> | 2021-04-29 16:16:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-29 16:16:42 -0700 |
commit | 95aca4b4d8fa62815d4bd412fff1a364f842814a (patch) | |
tree | 5e57661720fe9058d5c7db637e764800b50f9060 /files/pt-pt/mozilla | |
parent | ee3b1c87e3c8e72ca130943eed260ad642246581 (diff) | |
download | translated-content-95aca4b4d8fa62815d4bd412fff1a364f842814a.tar.gz translated-content-95aca4b4d8fa62815d4bd412fff1a364f842814a.tar.bz2 translated-content-95aca4b4d8fa62815d4bd412fff1a364f842814a.zip |
remove retired locales (#699)
Diffstat (limited to 'files/pt-pt/mozilla')
56 files changed, 0 insertions, 8213 deletions
diff --git a/files/pt-pt/mozilla/add-ons/index.html b/files/pt-pt/mozilla/add-ons/index.html deleted file mode 100644 index 2b69084b27..0000000000 --- a/files/pt-pt/mozilla/add-ons/index.html +++ /dev/null @@ -1,111 +0,0 @@ ---- -title: Extras (Add-ons) -slug: Mozilla/Add-ons -tags: - - Extensões - - Extras - - Landing - - Mozilla - - extensão -translation_of: Mozilla/Add-ons ---- -<div>{{AddonSidebar}}</div> - -<p><span class="seoSummary">Os extras permitem que os responsáveis pelo desenvolvimento estendam e modifiquem a funcionalidade do Firefox. As mesmas são criadas utilizando as tecnologias da Web padrão - CSS, HTML e JavaScript - mais algumas APIs de JavaScript dedicadas. Entre outras coisas, um extra poderia:</span></p> - -<ul> - <li>Modificar e alterar a aparência ou conteúdo de um site em particualr</li> - <li>Modificar a interface de utilizador do Firefox</li> - <li>Adicionar novas funcionalidades ao Firefox</li> -</ul> - -<h2 id="Desenvolver_extras">Desenvolver extras</h2> - -<p>Existem, de momento, vários conjuntos de ferramentas utilizadas para desenvolver Aplicações Complementares mas as chamadas <a href="/en-US/Add-ons/WebExtensions">Extensões da Web</a> vão tornar-se o padrão pelo final de 2017. Das restantes a expectativa é de que se tornem <a href="/en-US/Add-ons/Overlay_Extensions">obsoletas</a> dentro do mesmo periodo de tempo.</p> - -<p>Neste documento vai encontrar informação sobre as opções disponíveis para desenvolver aplicações complementares para que possa decidir qual a melhor para si agora e no futuro.</p> - -<h3 id="Criar_um_Novo_Extra">Criar um Novo Extra</h3> - -<p>Se está a desenvolver uma nova aplicação complementar recomendamos que escolha entre um dos dois seguintes métodos. Até que a transição para as Extensões da Web esteja finalizada, existirão prós e contras em relação a ambos os métodos. Por favor leia atentamente as opções para decidir qual a melhor para funcionar com a sua aplicação.</p> - -<ul class="card-grid"> - <li style="position: relative; max-width: 400px;"> - <div style="margin-bottom: 70px;"> - <h4 id="Extensões_da_Web"><a href="pt-PT/Add-ons/WebExtensions">Extensões da Web</a></h4> - - <p>As Extensões da Web são o futuro das Aplicações Complementares para o Firefox. Se a puder utilizar, a API das Extensões da Web será a melhor escolha. Pode começar a desenvolver e publicar Extensões da Web imediatamente, mas as mesmas ainda estão num estado embrionário.<br> - <br> - A maioria das funcionalidades da API Extensões da Web estão também disponíveis no <a href="/en-US/Add-ons/WebExtensions/Browser_support_for_JavaScript_APIs">Firefox para Android</a>.</p> - - <p>We're preparing a first full release for <a href="https://wiki.mozilla.org/RapidRelease/Calendar">Firefox 48</a>.</p> - </div> - <a class="card-grid-button" href="/en-US/Add-ons/WebExtensions">Saber mais</a></li> - <li style="position: relative; max-width: 400px;"> - <div style="margin-bottom: 70px;"> - <h4 id="SDK_de_Extras"><a href="/en-US/Add-ons/SDK">SDK de Extras</a></h4> - - <p>O SDK de Extra proporcina várias APIs para desenvolvimento de extras para o Firefox, e uma ferramenta para desenvolvimento, teste e finalização.</p> - - <p>Também pode executar as extensões de SDK de Extras no<a href="/en-US/Add-ons/SDK/Tutorials/Mobile_development"> Firefox para Android</a>.</p> - - <p>We encourage you to use only <a href="/en-US/Add-ons/SDK/High-Level_APIs">high-level APIs</a> because this will make it easier to migrate to WebExtensions down the road.</p> - </div> - <a class="card-grid-button" href="/en-US/Add-ons/SDK">Learn more</a></li> -</ul> - -<h3 id="Migrar_um_Extra_Existente">Migrar um Extra Existente</h3> - -<p>There are changes coming to Firefox in the next year that will make browsing more reliable for users, and creating add-ons easier for developers. Your add-on may require updating to maintain its compatibility, but once this is done and the transition is complete, your add-on will be more interoperable, secure, and future-proof than ever.</p> - -<p>We've created <a href="https://wiki.mozilla.org/Add-ons/developer/communication">resources, migration paths, office hours, and more</a>, to ensure you have the support you need to get through the transition.</p> - -<p>To get started, use the <a href="https://compatibility-lookup.services.mozilla.com/">add-on compatibility checker</a> to see if your add-on will be affected.</p> - -<h2 id="Publicação_de_extras">Publicação de extras</h2> - -<p><a href="https://addons.mozilla.org">Addons.mozilla.org</a>, commonly known as "AMO," is Mozilla's official site for developers to list add-ons, and for users to discover them. By uploading your add-on to AMO, you can participate in our community of users and creators, and find an audience for your add-on.</p> - -<p>You are not required to list your add-on on AMO, but starting with Firefox 40, your code must be signed by Mozilla or users won't be able to install it.</p> - -<p>For an overview of the process of publishing your add-on, see <a href="https://developer.mozilla.org/en-US/Add-ons/Distribution">Signing and distributing your add-on</a>.</p> - -<h2 id="Outros_tipos_de_extras">Outros tipos de extras</h2> - -<p>Generally, when people speak of add-ons they're referring to extensions, but there are a few other add-on types that allow users to customize Firefox. Those add-ons include:</p> - -<ul> - <li><a href="https://developer.mozilla.org/Add-ons/Themes/Background">Lightweight themes</a> are a simple way to provide limited customization for Firefox.</li> - <li><a href="/en-US/Add-ons/Firefox_for_Android">Mobile add-ons</a> are add-ons for Firefox for Android. Note, though, that we intend to deprecate some of the technology underlying these APIs. In the future, WebExtensions will be fully supported on Firefox for Android.</li> - <li><a href="/en-US/docs/Creating_OpenSearch_plugins_for_Firefox">Search engine plugins</a> add new search engines to the browser's search bar.</li> - <li><a href="/pt-PT/docs/Mozilla/Criação_de_um_complemento_de_dicionário_de_verificação_ortográfica">Dicionários do utilizador</a> são complementos que o deixam verificar a ortografia em diferentes idiomas.</li> - <li><a href="https://support.mozilla.org/pt-PT/kb/use-firefox-interface-other-languages-language-pack">Pacotes de idioma </a>são complementos que o deixam ter mais idiomas disponíveis para a interface do utilizador do Firefox.</li> -</ul> - -<hr> -<h2 id="Contacte-nos">Contacte-nos</h2> - -<p>Pode utilizar as hiperligações abaixo para obetr ajuda, manter-se atualizado com as notícias relacionadas com os complementos, e dar-nos a sua opinião/comentário.</p> - -<h3 id="Fórum_de_extras">Fórum de extras</h3> - -<p>Utilize o <a href="https://discourse.mozilla-community.org/c/add-ons">fórum de conversação sobre os complementos</a> para discutir todos aspetos do desenvolvimento de complementos e obter ajuda.</p> - -<h3 id="Listas_de_endereçosdiscussão">Listas de endereços/discussão</h3> - -<p>Use the <strong>dev-addons</strong> list to discuss development of the add-ons ecosystem, including the development of the WebExtensions system and of AMO:</p> - -<ul> - <li><a href="https://mail.mozilla.org/listinfo/dev-addons">dev-addons list info</a></li> - <li><a href="https://mail.mozilla.org/pipermail/dev-addons/">dev-addons archives</a></li> -</ul> - -<h3 id="IRC">IRC</h3> - -<p>If you're a fan of IRC, you can get in touch at:</p> - -<ul> - <li><a href="irc://irc.mozilla.org/addons">#addons</a> (discussion of the add-ons ecosystem)</li> - <li><a href="irc://irc.mozilla.org/extdev">#extdev</a> (general discussion of add-on development)</li> - <li><a href="irc://irc.mozilla.org/webextensions">#webextensions</a> (discussion of WebExtensions in particular)</li> -</ul> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/anatomy_of_a_webextension/index.html b/files/pt-pt/mozilla/add-ons/webextensions/anatomy_of_a_webextension/index.html deleted file mode 100644 index 3dfff5adde..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/anatomy_of_a_webextension/index.html +++ /dev/null @@ -1,136 +0,0 @@ ---- -title: Anatomia de uma extensão -slug: Mozilla/Add-ons/WebExtensions/Anatomy_of_a_WebExtension -tags: - - Extensões da Web -translation_of: Mozilla/Add-ons/WebExtensions/Anatomy_of_a_WebExtension -original_slug: Mozilla/Add-ons/WebExtensions/Anatomia_de_uma_extensao ---- -<div>{{AddonSidebar}}</div> - -<p>Uma extensão consiste numa coleção de ficheiros, empacotados para distribuição e instalação. Neste artigo, nós passaremos rapidamente pelos ficheiros que podem estar presentes numa extensão.</p> - -<h2 id="manifest.json">manifest.json</h2> - -<p>This is the only file that must be present in every extension. It contains basic metadata such as its name, version and the permissions it requires. It also provides pointers to other files in the extension.</p> - -<p>This manifest can also contain pointers to several other types of files:</p> - -<ul> - <li><a href="/en-US/Add-ons/WebExtensions/Anatomy_of_a_WebExtension#Background_scripts">Background pages</a>: Implement long-running logic.</li> - <li>Icons for the extension and any buttons it might define.</li> - <li><a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Anatomy_of_a_WebExtension#Sidebars_popups_options_pages">Sidebars, popups, and options pages</a>: HTML documents that provide content for various user interface components.</li> - <li><a href="/en-US/Add-ons/WebExtensions/Anatomy_of_a_WebExtension#Content_scripts">Content scripts</a>: JavaScript included with your extension, that you will inject into web pages.</li> -</ul> - -<p><img alt="" src="https://mdn.mozillademos.org/files/13669/webextension-anatomy.png" style="display: block; height: 581px; margin-left: auto; margin-right: auto; width: 600px;"></p> - -<p>See the <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json">manifest.json</a> reference page for all the details.</p> - -<p>Other than those referenced from the manifest, an extension can include additional <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Anatomy_of_a_WebExtension#Extension_pages">Extension pages</a> with supporting files.</p> - -<h2 id="Scripts_de_fundo_(segundo_plano)"><em>Scripts</em> de fundo (segundo plano)</h2> - -<p>Extensions often need to maintain long-term state or perform long-term operations independently of the lifetime of any particular web page or browser window. That is what background scripts are for.</p> - -<p>Background scripts are loaded as soon as the extension is loaded and stay loaded until the extension is disabled or uninstalled. You can use any of the <a href="/en-US/Add-ons/WebExtensions/API">WebExtension APIs</a> in the script, as long as you have requested the necessary <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions">permissions</a>.</p> - -<h3 id="Especificar_os_scripts_de_fundo">Especificar os <em>scripts</em> de fundo</h3> - -<p>You can include a background script using the <code>background</code> key in "manifest.json":</p> - -<pre class="brush: json">// manifest.json - -"background": { - "scripts": ["background-script.js"] -}</pre> - -<p>You can specify multiple background scripts: if you do, they run in the same context, just like multiple scripts that are loaded into a single web page.</p> - -<h3 id="Ambiente_de_script_de_fundo">Ambiente de <em>script</em> de fundo</h3> - -<h4 id="APIS_de_DOM">APIS de DOM</h4> - -<p>Background scripts run in the context of special pages called background pages. This gives them a <code><a href="/en-US/docs/Web/API/Window">window</a></code> global, along with all the standard DOM APIs provided by that object.</p> - -<p>You do not have to supply your background page. If you include a background script, an empty background page will be created for you.</p> - -<p>However, you can choose to supply your background page as a separate HTML file:</p> - -<pre class="brush: json">// manifest.json - -"background": { - "page": "background-page.html" -}</pre> - -<h4 id="APIs_da_Extensão_da_Web">APIs da Extensão da Web</h4> - -<p>Background scripts can use any of the <a href="/en-US/Add-ons/WebExtensions/API">WebExtension APIs</a> in the script, as long as their extension has the necessary <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions">permissions</a>.</p> - -<h4 id="Acesso_cruzado_da_origem">Acesso cruzado da origem</h4> - -<p>Background scripts can make XHR requests to any hosts for which they have <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions">host permissions</a>.</p> - -<h4 id="Conteúdo_da_Web">Conteúdo da Web</h4> - -<p>Background scripts do not get direct access to web pages. However, they can load <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_scripts">content scripts</a> into web pages and can <a href="/en-US/Add-ons/WebExtensions/Content_scripts#Communicating_with_background_scripts">communicate with these content scripts using a message-passing API</a>.</p> - -<h4 id="Política_de_segurança_do_conteúdo">Política de segurança do conteúdo</h4> - -<p>Background scripts are restricted from certain potentially dangerous operations, like the use of <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval">eval()</a></code>, through a Content Security Policy. See <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_Security_Policy">Content Security Policy</a> for more details on this.</p> - -<h2 id="Barras_laterais_janelas_(popups)_opções_de_páginas">Barras laterais, janelas (popups), opções de páginas</h2> - -<p>A sua extensão pode inclur vários componentes da interface do utilizador cujo conteúdo é definido utilizando um documento HTML:</p> - -<ul> - <li>uma <a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/Barras_laterais">barra lateral</a> é um painel que é exibido no lado esquerdo da janela do navegador, junto à página da <em>web</em></li> - <li>uma <a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/Popups">janela (popup</a>) é uma janela que pode exibir quando o utilizador clica num <a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/A%C3%A7%C3%A3o_navegador">botão da barra de ferramentas</a> ou <a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/Acoes_pagina">botão da barra de endereço</a></li> - <li>uma <a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/Options_pages">página de opções </a>é uma página que é mostrada quando o utilizador acede ao seu extra de preferências no gestor de extras nativo do navegador</li> -</ul> - -<p>For each of these components, you create an HTML file and point to it using a specific property in <a href="/pt-PT/Add-ons/WebExtensions/manifest.json">manifest.json</a>. The HTML file can include CSS and JavaScript files, just like a normal web page.</p> - -<p>All of these are a type of <a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/Paginas_de_extens%C3%A3o">Extension pages</a>, and unlike a normal web page, your JavaScript can use all the same privileged WebExtension APIs as your background script. They can even directly access variables in the background page using {{WebExtAPIRef("runtime.getBackgroundPage()")}}.</p> - -<h2 id="Páginas_de_extensão">Páginas de extensão</h2> - -<p>You can also include HTML documents in your extension which are not attached to some predefined user interface component. Unlike the documents you might provide for sidebars, popups, or options pages, these don't have an entry in manifest.json. However, they do also get access to all the same privileged WebExtension APIs as your background script.</p> - -<p>You'd typically load a page like this using {{WebExtAPIRef("windows.create()")}} or {{WebExtAPIRef("tabs.create()")}}.</p> - -<p>See <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Extension_pages">Extension pages</a> to learn more.</p> - -<h2 id="Scripts_de_conteúdo"><em>Scripts</em> de conteúdo</h2> - -<p>Use content scripts to access and manipulate web pages. Content scripts are loaded into web pages and run in the context of that particular page.</p> - -<p>Content scripts are extension-provided scripts which run in the context of a web page; this differs from scripts which are loaded by the page itself, including those which are provided in {{HTMLElement("script")}} elements within the page.</p> - -<p>Content scripts can see and manipulate the page's DOM, just like normal scripts loaded by the page.</p> - -<p>Unlike normal page scripts, they can:</p> - -<ul> - <li>Make cross-domain XHR requests.</li> - <li>Use a small subset of the <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API">WebExtension APIs</a>.</li> - <li>Exchange messages with their background scripts and can in this way indirectly access all the WebExtension APIs.</li> -</ul> - -<p>Content scripts cannot directly access normal page scripts but can exchange messages with them using the standard <code><a href="/en-US/docs/Web/API/Window/postMessage">window.postMessage()</a></code> API.</p> - -<p>Usually, when we talk about content scripts, we are referring to JavaScript, but you can inject CSS into web pages using the same mechanism.</p> - -<p>See the <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_scripts">content scripts</a> article to learn more.</p> - -<h2 id="Recursos_de_acessibilidade_da_Web">Recursos de acessibilidade da Web</h2> - -<p>Web accessible resources are resources such as images, HTML, CSS, and JavaScript that you include in the extension and want to make accessible to content scripts and page scripts. Resources which are made web-accessible can be referenced by page scripts and content scripts using a special URI scheme.</p> - -<p>For example, if a content script wants to insert some images into web pages, you could include them in the extension and make them web accessible. Then the content script could create and append <code><a href="/en-US/docs/Web/HTML/Element/img">img</a></code> tags which reference the images via the <code>src</code> attribute.</p> - -<p>To learn more, see the documentation for the <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/web_accessible_resources">web_accessible_resources</a> manifest.json key.</p> - -<p> </p> - -<p> </p> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/api/browseraction/index.html b/files/pt-pt/mozilla/add-ons/webextensions/api/browseraction/index.html deleted file mode 100644 index 2b520684db..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/api/browseraction/index.html +++ /dev/null @@ -1,127 +0,0 @@ ---- -title: Ação do navegador -slug: Mozilla/Add-ons/WebExtensions/API/browserAction -tags: - - API - - Ação do navegador - - Extensões - - Extensões da Web - - Extras - - Interface - - Não Padrão - - Referencia -translation_of: Mozilla/Add-ons/WebExtensions/API/browserAction ---- -<div>{{AddonSidebar}}</div> - -<p>Adiciona um botão à barra de ferramentas do navegador.</p> - -<p>Uma <a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/Ação_navegador">ação do navegador </a>é um botão na barra de ferramentas do navegador.</p> - -<p>You can associate a popup with the button. The popup is specified using HTML, CSS and JavaScript, just like a normal web page. JavaScript running in the popup gets access to all the same WebExtension APIs as your background scripts, but its global context is the popup, not the current page displayed in the browser. To affect web pages you need to communicate with them via <a href="/en-US/Add-ons/WebExtensions/Modify_a_web_page#Messaging">messages</a>.</p> - -<p>If you specify a popup, it will be shown — and the content will be loaded — when the user clicks the icon. If you do not specify a popup, then when the user clicks the icon an event is dispatched to your extension.</p> - -<p>You can define most of a browser action's properties declaratively using the <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_action">browser_action</a></code> key in the manifest.json.</p> - -<p>With the <code>browserAction</code> API, you can:</p> - -<ul> - <li>use {{WebExtAPIRef("browserAction.onClicked")}} to listen for clicks on the icon.</li> - <li>get and set the icon's properties — icon, title, popup, and so on. You can get and set these globally across all tabs, or for a specific tab by passing the tab ID as an additional argument.</li> -</ul> - -<h2 id="Tipos">Tipos</h2> - -<dl> - <dt>{{WebExtAPIRef("browserAction.ColorArray")}}</dt> - <dd>An array of four integers in the range 0-255 defining an RGBA color.</dd> - <dt>{{WebExtAPIRef("browserAction.ImageDataType")}}</dt> - <dd>Pixel data for an image. Must be an <code><a href="/en-US/docs/Web/API/ImageData">ImageData</a></code> object (for example, from a {{htmlelement("canvas")}} element).</dd> -</dl> - -<h2 id="Funções">Funções</h2> - -<dl> - <dt>{{WebExtAPIRef("browserAction.setTitle()")}}</dt> - <dd>Sets the browser action's title. This will be displayed in a tooltip.</dd> - <dt>{{WebExtAPIRef("browserAction.getTitle()")}}</dt> - <dd>Gets the browser action's title.</dd> - <dt>{{WebExtAPIRef("browserAction.setIcon()")}}</dt> - <dd>Sets the browser action's icon.</dd> - <dt>{{WebExtAPIRef("browserAction.setPopup()")}}</dt> - <dd>Sets the HTML document to be opened as a popup when the user clicks on the browser action's icon.</dd> - <dt>{{WebExtAPIRef("browserAction.getPopup()")}}</dt> - <dd>Gets the HTML document set as the browser action's popup.</dd> - <dt>{{WebExtAPIRef("browserAction.openPopup()")}}</dt> - <dd>Open the browser action's popup.</dd> - <dt>{{WebExtAPIRef("browserAction.setBadgeText()")}}</dt> - <dd>Sets the browser action's badge text. The badge is displayed on top of the icon.</dd> - <dt>{{WebExtAPIRef("browserAction.getBadgeText()")}}</dt> - <dd>Gets the browser action's badge text.</dd> - <dt>{{WebExtAPIRef("browserAction.setBadgeBackgroundColor()")}}</dt> - <dd>Sets the badge's background color.</dd> - <dt>{{WebExtAPIRef("browserAction.getBadgeBackgroundColor()")}}</dt> - <dd>Gets the badge's background color.</dd> - <dt>{{WebExtAPIRef("browserAction.enable()")}}</dt> - <dd>Enables the browser action for a tab. By default, browser actions are enabled for all tabs.</dd> - <dt>{{WebExtAPIRef("browserAction.disable()")}}</dt> - <dd>Disables the browser action for a tab, meaning that it cannot be clicked when that tab is active.</dd> -</dl> - -<h2 id="Eventos">Eventos</h2> - -<dl> - <dt>{{WebExtAPIRef("browserAction.onClicked")}}</dt> - <dd>Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup.</dd> -</dl> - -<h2 id="Compatibilidade_de_navegador">Compatibilidade de navegador</h2> - -<p>{{Compat("webextensions.api.browserAction")}}</p> - -<div class="hidden note"> -<p>The "Chrome incompatibilities" section is included from <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Chrome_incompatibilities"> https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Chrome_incompatibilities</a> using the <a href="/en-US/docs/Template:WebExtChromeCompat">WebExtChromeCompat</a> macro.</p> - -<p>If you need to update this content, edit <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Chrome_incompatibilities">https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Chrome_incompatibilities</a>, then shift-refresh this page to see your changes.</p> -</div> - -<p>{{WebExtExamples("h2")}}</p> - -<div class="note"><strong>Reconhecimentos</strong> - -<p>This API is based on Chromium's <a href="https://developer.chrome.com/extensions/browserAction"><code>chrome.browserAction</code></a> API. This documentation is derived from <a href="https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json"><code>browser_action.json</code></a> in the Chromium code.</p> - -<p>Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.</p> -</div> - -<div class="hidden"> -<pre>// Copyright 2015 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -</pre> -</div> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/api/browsingdata/index.html b/files/pt-pt/mozilla/add-ons/webextensions/api/browsingdata/index.html deleted file mode 100644 index 14dbd68d3a..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/api/browsingdata/index.html +++ /dev/null @@ -1,130 +0,0 @@ ---- -title: browsingData -slug: Mozilla/Add-ons/WebExtensions/API/browsingData -tags: - - API - - Add-ons - - Extensions - - NeedsTranslation - - Non-standard - - Reference - - TopicStub - - WebExtensions - - browsingData -translation_of: Mozilla/Add-ons/WebExtensions/API/browsingData ---- -<div>{{AddonSidebar}}</div> - -<p>Enables extensions to clear the data that is accumulated while the user is browsing.</p> - -<p>In the <code>browsingData</code> API, browsing data is divided into types:</p> - -<ul> - <li>browser cache</li> - <li>cookies</li> - <li>downloads</li> - <li>history</li> - <li>local storage</li> - <li>plugin data</li> - <li>saved form data</li> - <li>saved passwords</li> -</ul> - -<p>You can use the {{WebExtAPIRef("browsingData.remove()")}} function to remove any combination of these types. There are also dedicated functions to remove each particular type of data, such as {{WebExtAPIRef("browsingData.removePasswords()", "removePasswords()")}}, {{WebExtAPIRef("browsingData.removeHistory()", "removeHistory()")}} and so on.</p> - -<p>All the <code>browsingData.remove[X]()</code> functions take a {{WebExtAPIRef("browsingData.RemovalOptions")}} object, which you can use to control two further aspects of data removal:</p> - -<ul> - <li>how far back in time to remove data</li> - <li>whether to remove data only from normal web pages, or also from hosted web apps and add-ons. Note that this option is not yet supported in Firefox.</li> -</ul> - -<p>Finally, this API gives you a {{WebExtAPIRef("browsingData.settings()")}} function that gives you the current value of the settings for the browser's built-in "Clear History" feature.</p> - -<p>To use this API you must have the "browsingData" <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/permissions#API_permissions">API permission</a>.</p> - -<h2 id="Types">Types</h2> - -<dl> - <dt>{{WebExtAPIRef("browsingData.DataTypeSet")}}</dt> - <dd>Object used to specify the type of data to remove: for example, history, downloads, passwords, and so on.</dd> - <dt>{{WebExtAPIRef("browsingData.RemovalOptions")}}</dt> - <dd>Object used to specify how far back in time to remove data, and whether to remove data added through normal web browsing, by hosted apps, or by add-ons.</dd> -</dl> - -<h2 id="Methods">Methods</h2> - -<dl> - <dt>{{WebExtAPIRef("browsingData.remove()")}}</dt> - <dd>Removes browsing data for the data types specified.</dd> - <dt>{{WebExtAPIRef("browsingData.removeCache()")}}</dt> - <dd>Clears the browser's cache.</dd> - <dt>{{WebExtAPIRef("browsingData.removeCookies()")}}</dt> - <dd>Removes cookies.</dd> - <dt>{{WebExtAPIRef("browsingData.removeDownloads()")}}</dt> - <dd>Removes the list of downloaded files.</dd> - <dt>{{WebExtAPIRef("browsingData.removeFormData()")}}</dt> - <dd>Clears saved form data.</dd> - <dt>{{WebExtAPIRef("browsingData.removeHistory()")}}</dt> - <dd>Clears the browser's history.</dd> - <dt>{{WebExtAPIRef("browsingData.removeLocalStorage()")}}</dt> - <dd>Clears any <a href="/en-US/docs/Web/API/Window/localStorage">local storage</a> created by websites.</dd> - <dt>{{WebExtAPIRef("browsingData.removePasswords()")}}</dt> - <dd>Clears saved passwords.</dd> - <dt>{{WebExtAPIRef("browsingData.removePluginData()")}}</dt> - <dd>Clears data associated with plugins.</dd> - <dt>{{WebExtAPIRef("browsingData.settings()")}}</dt> - <dd>Gets the current value of settings in the browser's "Clear History" feature.</dd> -</dl> - -<h2 id="Browser_compatibility">Browser compatibility</h2> - - - -<p>{{Compat("webextensions.api.browsingData", 2)}}</p> - -<div class="note hidden"> -<p>The "Chrome incompatibilities" section is included from <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Chrome_incompatibilities"> https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Chrome_incompatibilities</a> using the <a href="/en-US/docs/Template:WebExtChromeCompat">WebExtChromeCompat</a> macro.</p> - -<p>If you need to update this content, edit <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Chrome_incompatibilities">https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Chrome_incompatibilities</a>, then shift-refresh this page to see your changes.</p> -</div> - -<p>{{WebExtExamples("h2")}}</p> - -<div class="note"><strong>Acknowledgements</strong> - -<p>This API is based on Chromium's <a href="https://developer.chrome.com/extensions/browsingData"><code>chrome.browsingData</code></a> API.</p> - -<p>Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.</p> -</div> - -<div class="hidden"> -<pre>// Copyright 2015 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -</pre> -</div> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/api/browsingdata/removeplugindata/index.html b/files/pt-pt/mozilla/add-ons/webextensions/api/browsingdata/removeplugindata/index.html deleted file mode 100644 index e67f9b8c70..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/api/browsingdata/removeplugindata/index.html +++ /dev/null @@ -1,124 +0,0 @@ ---- -title: browsingData.removePluginData() -slug: Mozilla/Add-ons/WebExtensions/API/browsingData/removePluginData -tags: - - API - - Dados de navegação - - Extensões - - Extensões da Web - - Extras - - Referencia - - metodo - - remover Dados do Plug-in -translation_of: Mozilla/Add-ons/WebExtensions/API/browsingData/removePluginData ---- -<div>{{AddonSidebar()}}</div> - -<p>Limpa dados guardados nos plug-ins do navegador.</p> - -<p>Pode utilizar o parâmetro <code>removalOptions</code>, que é um objeto {{WebExtAPIRef("browsingData.RemovalOptions")}}, para:</p> - -<ul> - <li>limpar apenas os dados do plug-in guardados depois de algum tempo</li> - <li>controlar se deve limpar apenas os dados guardados pelos plug-ins em execução nas páginas da Web normais ou limpar os dados guardados pelos plug-ins em execução nas aplicações hospedadas e também nas extensões.</li> -</ul> - -<p>Esta é uma função assíncrona que retorna um <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>.</p> - -<h2 id="Sintaxe">Sintaxe</h2> - -<pre class="syntaxbox brush:js">var removing = browser.browsingData.removePluginData( - removalOptions // RemovalOptions object -) -</pre> - -<h3 id="Parâmetros">Parâmetros</h3> - -<dl> - <dt><code>removalOptions</code></dt> - <dd><code>object</code>. A {{WebExtAPIRef("browsingData.RemovalOptions")}} object, which may be used to clear only plugin data stored after a given time, and whether to clear only data stored by plugins running in normal web pages or to clear data stored by plugins running in hosted apps and extensions as well.</dd> -</dl> - -<h3 id="Devolver_valor">Devolver valor</h3> - -<p>A <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code> that will be fulfilled with no arguments when the removal has finished. If any error occurs, the promise will be rejected with an error message.</p> - -<h2 id="Compatibilidade_de_navegador">Compatibilidade de navegador</h2> - -<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> - -<p>{{Compat("webextensions.api.browsingData.removePluginData")}}</p> - -<h2 id="Exemplos">Exemplos</h2> - -<p>Remove data stored by plugins in the last week:</p> - -<pre class="brush: js">function onRemoved() { - console.log("removed"); -} - -function onError(error) { - console.error(error); -} - -function weekInMilliseconds() { - return 1000 * 60 * 60 * 24 * 7; -} - -var oneWeekAgo = (new Date()).getTime() - weekInMilliseconds(); - -browser.browsingData.removePluginData({since: oneWeekAgo}). -then(onRemoved, onError);</pre> - -<p>Remove all data stored by plugins:</p> - -<pre class="brush: js">function onRemoved() { - console.log("removed"); -} - -function onError(error) { - console.error(error); -} - -browser.browsingData.removePluginData({}). -then(onRemoved, onError);</pre> - -<p>{{WebExtExamples}}</p> - -<div class="note"><strong>Reconhecimentos</strong> - -<p>This API is based on Chromium's <a href="https://developer.chrome.com/extensions/browsingData"><code>chrome.browsingData</code></a> API.</p> - -<p>Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.</p> -</div> - -<div class="hidden"> -<pre>// Copyright 2015 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -</pre> -</div> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/api/devtools/panels/index.html b/files/pt-pt/mozilla/add-ons/webextensions/api/devtools/panels/index.html deleted file mode 100644 index 2d7cb8839d..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/api/devtools/panels/index.html +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: devtools.panels -slug: Mozilla/Add-ons/WebExtensions/API/devtools/panels -tags: - - API - - Extensões - - Extensões da Web - - Extras - - Referencia - - devtools.panels -translation_of: Mozilla/Add-ons/WebExtensions/API/devtools.panels -original_slug: Mozilla/Add-ons/WebExtensions/API/devtools.panels ---- -<div>{{AddonSidebar}}</div> - -<div class="note"> -<p>Embora as APIs sejam baseadas no <a href="https://developer.chrome.com/extensions/devtools">Chrome devtools APIs</a>, ainda existem muitas funcionalidades que ainda não estão implementadas no Firefox, e por isso, não estão documentadas aqui. Para ver quais as funcionalidades que estão atualmente em falta, por favor, consulte <a href="/pt-PT/Add-ons/WebExtensions/Extensão_das_ferramentas_de_desenvolvimento#Limitações_das_APIs_de_devtools">Limitações das APIs de devtools</a>.</p> -</div> - -<p>The <code>devtools.panels</code> API lets a devtools extension define its user interface inside the devtools window.</p> - -<p>The devtools window hosts a number of separate tools - the JavaScript Debugger, Network Monitor, and so on. A row of tabs across the top lets the user switch between the different tools. The window hosting each tool's user interface is called a "panel".</p> - -<p>With the <code>devtools.panels</code> API you can create new panels in the devtools window.</p> - -<p>Like all the <code>devtools</code> APIs, this API is only available to code running in the document defined in the <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/devtools_page">devtools_page</a> manifest.json key, or in other devtools documents created by the extension (such as the panel's own document). See <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Extending_the_developer_tools">Extending the developer tools</a> for more.</p> - -<h2 id="Tipos">Tipos</h2> - -<dl> - <dt><code><a href="/en-US/Add-ons/WebExtensions/API/devtools.panels/ElementsPanel">devtools.panels.ElementsPanel</a></code></dt> - <dd>Represents the HTML/CSS inspector in the browser's devtools.</dd> - <dt><code><a href="/en-US/Add-ons/WebExtensions/API/devtools.panels/ExtensionPanel">devtools.panels.ExtensionPanel</a></code></dt> - <dd>Represents a devtools panel created by the extension.</dd> - <dt><code><a href="/en-US/Add-ons/WebExtensions/API/devtools.panels/ExtensionSidebarPane">devtools.panels.ExtensionSidebarPane</a></code></dt> - <dd>Represents a pane that an extension has added to the HTML/CSS inspector in the browser's devtools.</dd> -</dl> - -<h2 id="Propriedades">Propriedades</h2> - -<dl> - <dt><code><a href="/en-US/Add-ons/WebExtensions/API/devtools.panels/elements">devtools.panels.elements</a></code></dt> - <dd>A reference to an <code><a href="/en-US/Add-ons/WebExtensions/API/devtools.panels/ElementsPanel">ElementsPanel</a></code> object.</dd> - <dt><code><a href="/en-US/Add-ons/WebExtensions/API/devtools.panels/themeName">devtools.panels.themeName</a></code></dt> - <dd>The name of the current devtools theme.</dd> -</dl> - -<h2 id="Funções">Funções</h2> - -<dl> - <dt><code><a href="/en-US/Add-ons/WebExtensions/API/devtools.panels/create">devtools.panels.create()</a></code></dt> - <dd>Creates a new devtools panel.</dd> -</dl> - -<h2 id="Eventos">Eventos</h2> - -<dl> - <dt><code><a href="/en-US/Add-ons/WebExtensions/API/devtools.panels/onThemeChanged">devtools.panels.onThemeChanged</a></code></dt> - <dd>Fired when the devtools theme changes.</dd> -</dl> - -<h2 id="Compatibilidade_do_navegador">Compatibilidade do navegador</h2> - -<p>{{Compat("webextensions.api.devtools.panels", 2)}}</p> - -<p>{{WebExtExamples("h2")}}</p> - -<div class="note"><strong>Reconhecimentos</strong> - -<p>This API is based on Chromium's <a href="https://developer.chrome.com/extensions/devtools_panels"><code>chrome.devtools.panels</code></a> API.</p> - -<p>Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.</p> -</div> - -<div class="hidden"> -<pre>// Copyright 2015 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -</pre> -</div> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/api/i18n/index.html b/files/pt-pt/mozilla/add-ons/webextensions/api/i18n/index.html deleted file mode 100644 index 824e2eb308..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/api/i18n/index.html +++ /dev/null @@ -1,93 +0,0 @@ ---- -title: i18n -slug: Mozilla/Add-ons/WebExtensions/API/i18n -tags: - - API - - Extensões - - Extensões da Web - - Extras - - Não Padrão - - Referencia - - i18n -translation_of: Mozilla/Add-ons/WebExtensions/API/i18n ---- -<div>{{AddonSidebar}}</div> - -<p>Funções para a internationalizar a sua extensão. Pode utilizar estas APIs para ter as suas <em>strings</em> traduzidas dos ficheiros de localização empacotados com a sua extensão, descubra o idioma atual do navegador e descubra o valor do seu <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation#The_Accept-Language_header">cabeçalho Accept-Language</a>.</p> - -<p id="See_also">Para mais detalhes em como utilizar i18n para sua extensão, consulte:</p> - -<ul> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Internationalization">Internationalization</a>: a guide to using the WebExtension i18n system.</li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/i18n/Locale-Specific_Message_reference">Locale-Specific Message reference</a>: extensions supply locale-specific strings in files called <code>messages.json</code>. This page describes the format of <code>messages.json</code>.</li> -</ul> - -<h2 id="Tipos">Tipos</h2> - -<dl> - <dt>{{WebExtAPIRef("i18n.LanguageCode")}}</dt> - <dd>A <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.10">language tag</a> such as <code>"en-US"</code> or "<code>fr</code>".</dd> -</dl> - -<h2 id="Funções">Funções</h2> - -<dl> - <dt>{{WebExtAPIRef("i18n.getAcceptLanguages()")}}</dt> - <dd>Gets the <a href="/en-US/docs/Web/HTTP/Content_negotiation#The_Accept-Language_header">accept-languages</a> of the browser. This is different from the locale used by the browser. To get the locale, use {{WebExtAPIRef('i18n.getUILanguage')}}.</dd> - <dt>{{WebExtAPIRef("i18n.getMessage()")}}</dt> - <dd>Gets the localized string for the specified message.</dd> - <dt>{{WebExtAPIRef("i18n.getUILanguage()")}}</dt> - <dd>Gets the UI language of the browser. This is different from {{WebExtAPIRef('i18n.getAcceptLanguages')}} which returns the preferred user languages.</dd> - <dt>{{WebExtAPIRef("i18n.detectLanguage()")}}</dt> - <dd>Detects the language of the provided text using the <a href="https://github.com/CLD2Owners/cld2">Compact Language Detector</a>.</dd> -</dl> - -<dl> -</dl> - -<h2 id="Compatibilidade_de_navegador">Compatibilidade de navegador</h2> - -<p>{{Compat("webextensions.api.i18n")}}</p> - -<p>{{WebExtExamples("h2")}}</p> - -<dl> -</dl> - -<div class="note"><strong>Agradecimentos</strong> - -<p>This API is based on Chromium's <a href="https://developer.chrome.com/extensions/i18n"><code>chrome.i18n</code></a> API. This documentation is derived from <a href="https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/i18n.json"><code>i18n.json</code></a> in the Chromium code.</p> - -<p>Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.</p> -</div> - -<div class="hidden"> -<pre>// Copyright 2015 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -</pre> -</div> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/api/index.html b/files/pt-pt/mozilla/add-ons/webextensions/api/index.html deleted file mode 100644 index 24e8c119a7..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/api/index.html +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: APIs de JavaScript -slug: Mozilla/Add-ons/WebExtensions/API -translation_of: Mozilla/Add-ons/WebExtensions/API ---- -<div>{{AddonSidebar}}</div> - -<div>{{SubpagesWithSummaries}}</div> - -<div class="note"><strong>Agradecimentos</strong> - -<p>Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.</p> -</div> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/api/pageaction/index.html b/files/pt-pt/mozilla/add-ons/webextensions/api/pageaction/index.html deleted file mode 100644 index 1453336c6c..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/api/pageaction/index.html +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Ação de página -slug: Mozilla/Add-ons/WebExtensions/API/pageAction -tags: - - API - - Ação de página - - Extensões - - Extensões da Web - - Extras - - Interface - - Não Padrão - - Referencia -translation_of: Mozilla/Add-ons/WebExtensions/API/pageAction ---- -<div>{{AddonSidebar}}</div> - -<p>Uma <a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/Acoes_pagina">ação de página</a> é ícone clicável dentro da barra de endereço do navegador.</p> - -<p> </p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/12960/page-action.png" style="display: block; height: 262px; margin-left: auto; margin-right: auto; width: 850px;"></p> - -<p>Pode ouvir cliques no ícone, ou especificar uma <a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/Popups">janela (<em>popup</em>)</a> que será aberta quando o ícone for clicado.</p> - -<p>If you specify a popup, you can define its contents and behavior using HTML, CSS, and JavaScript, just like a normal web page. JavaScript running in the popup gets access to all the same WebExtension APIs as your background scripts.</p> - -<p>You can define most of a page action's properties declaratively using the <a href="/en-US/Add-ons/WebExtensions/manifest.json/page_action">page_action key</a> in your <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json">manifest.json</a>, but can also redefine them programmatically using this API.</p> - -<p>Page actions are for actions that are only relevant to particular pages. If your icon should always be available, use a <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Browser_action">browser action</a> instead.</p> - -<h2 id="Tipos">Tipos</h2> - -<dl> - <dt>{{WebExtAPIRef("pageAction.ImageDataType")}}</dt> - <dd>Dados de píxel para uma imagem.</dd> -</dl> - -<h2 id="Funções">Funções</h2> - -<dl> - <dt>{{WebExtAPIRef("pageAction.show()")}}</dt> - <dd>Shows the page action for a given tab.</dd> - <dt>{{WebExtAPIRef("pageAction.hide()")}}</dt> - <dd>Hides the page action for a given tab.</dd> - <dt>{{WebExtAPIRef("pageAction.setTitle()")}}</dt> - <dd>Sets the page action's title. This is displayed in a tooltip over the page action.</dd> - <dt>{{WebExtAPIRef("pageAction.getTitle()")}}</dt> - <dd>Gets the page action's title.</dd> - <dt>{{WebExtAPIRef("pageAction.setIcon()")}}</dt> - <dd>Sets the page action's icon.</dd> - <dt>{{WebExtAPIRef("pageAction.setPopup()")}}</dt> - <dd>Sets the URL for the page action's popup.</dd> - <dt>{{WebExtAPIRef("pageAction.getPopup()")}}</dt> - <dd>Gets the URL for the page action's popup.</dd> - <dt>{{WebExtAPIRef("pageAction.openPopup()")}}</dt> - <dd>Opens the page action's popup.</dd> -</dl> - -<h2 id="Eventos">Eventos</h2> - -<dl> - <dt>{{WebExtAPIRef("pageAction.onClicked")}}</dt> - <dd>Fired when a page action icon is clicked. This event will not fire if the page action has a popup.</dd> -</dl> - -<h2 id="Compatibilidade_de_navegador">Compatibilidade de navegador</h2> - -<p>{{Compat("webextensions.api.pageAction")}}</p> - -<p>{{WebExtExamples("h2")}}</p> - -<div class="note"><strong>Reconhecimentos</strong> - -<p>This API is based on Chromium's <a href="https://developer.chrome.com/extensions/pageAction"><code>chrome.pageAction</code></a> API. This documentation is derived from <a href="https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/page_action.json"><code>page_action.json</code></a> in the Chromium code.</p> - -<p>Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.</p> -</div> - -<div class="hidden"> -<pre>// Copyright 2015 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -</pre> -</div> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/api/sidebaraction/index.html b/files/pt-pt/mozilla/add-ons/webextensions/api/sidebaraction/index.html deleted file mode 100644 index beb8c1c54f..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/api/sidebaraction/index.html +++ /dev/null @@ -1,182 +0,0 @@ ---- -title: sidebarAction -slug: Mozilla/Add-ons/WebExtensions/API/sidebarAction -tags: - - API - - Barra Lateral - - Extensões - - Extensões da Web - - Não Padrão - - Referencia - - sidebarAction -translation_of: Mozilla/Add-ons/WebExtensions/API/sidebarAction ---- -<div>{{AddonSidebar}}</div> - -<p>Obtém e define as propriedades da barra lateral de uma extensão.</p> - -<p>Uma <a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/Barras_laterais">barra lateral</a> é um painel que é exibido no lado esquerdo ou direito da janela do navegador, ao lado da página da <em>web</em>. O navegador fornece uma interface do utilizador que permite ao utilizador ver as barras laterais disponíveis no momento e selecionar uma barra lateral para exibir. Utilizando a chave de manifest.json <code><a href="/en-US/Add-ons/WebExtensions/manifest.json/sidebar_action">sidebar_action</a></code> , uma extensão pdoe definir a sua própria barra lateral. Utilizando a API <code>sidebarAction</code> descrita aqui, uma extension pode obter um conjunto de propriedades da barra lateral.</p> - -<p>A API <code>sidebarAction</code> é modelada de perto na API {{WebExtAPIRef("browserAction")}}.</p> - -<p>A API sidebarAction é baseada na API <a href="https://dev.opera.com/extensions/sidebar-action-api/">sidebarAction d</a>o Opera. Contudo, note que o seguinte ainda não é suportado: <code>setBadgeText()</code>, <code>getBadgeText()</code>, <code>setBadgeBackgroundColor()</code>, <code>getBadgeBackgroundColor()</code>, <code>onFocus</code>, <code>onBlur</code>.</p> - -<h2 id="Tipos">Tipos</h2> - -<dl> - <dt>{{WebExtAPIRef("sidebarAction.ImageDataType")}}</dt> - <dd>Dados de pixel para uma imagem. Deve ser um objeto <code><a href="/en-US/docs/Web/API/ImageData">ImageData</a></code> (por exemplo, de um elemento {{htmlelement("canvas")}}).</dd> -</dl> - -<h2 id="Funções">Funções</h2> - -<dl> - <dt>{{WebExtAPIRef("sidebarAction.setPanel()")}}</dt> - <dd>Define o painel da barra lateral.</dd> - <dt>{{WebExtAPIRef("sidebarAction.getPanel()")}}</dt> - <dd>Obtém o painel da barra lateral.</dd> - <dt>{{WebExtAPIRef("sidebarAction.setTitle()")}}</dt> - <dd>Definie o título da barra lateral. Isto será exibido em qualquer IU fornecida pelo navegador para listar as barras de ferrramentas, tal como um menu.</dd> - <dt>{{WebExtAPIRef("sidebarAction.getTitle()")}}</dt> - <dd>Obtém o título da barra lateral.</dd> - <dt>{{WebExtAPIRef("sidebarAction.setIcon()")}}</dt> - <dd>Define o ícone da barra lateral.</dd> - <dt>{{WebExtAPIRef("sidebarAction.open()")}}</dt> - <dd>Abre a abarra lateral.</dd> - <dt>{{WebExtAPIRef("sidebarAction.close()")}}</dt> - <dd>fecha a barra lateral.</dd> - <dt>{{WebExtAPIRef("sidebarAction.isOpen()")}}</dt> - <dd>Verifica sebarra lateral está ou não aberta.</dd> -</dl> - -<h2 id="Compatibilidade_de_navegador">Compatibilidade de navegador</h2> - -<p>{{Compat("webextensions.api.sidebarAction")}}</p> - -<h2 id="Exemplo_de_extras_(add-ons)">Exemplo de extras (add-ons)</h2> - -<ul> - <li><a class="external external-icon" href="https://github.com/mdn/webextensions-examples/tree/master/annotate-page">página de notas (annotate-page</a>)</li> -</ul> - -<div class="note"><strong>Reconhecimentos</strong> - -<p>Esta API é baseada na API <a href="https://dev.opera.com/extensions/sidebar-action-api/"><code>chrome.sidebarAction</code></a> do Opera.</p> - -<p>Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.</p> -</div> - -<div class="hidden"> -<pre>// Copyright 2015 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -</pre> -</div> - -<div id="SL_balloon_obj" style="display: block;"> -<div class="SL_ImTranslatorLogo" id="SL_button" class="hidden"> </div> - -<div id="SL_shadow_translation_result2" class="hidden"> </div> - -<div id="SL_shadow_translator" class="hidden"> -<div id="SL_planshet"> -<div id="SL_arrow_up" style=""> </div> - -<div id="SL_Bproviders"> -<div class="SL_BL_LABLE_ON" id="SL_P0" title="Google">G</div> - -<div class="SL_BL_LABLE_ON" id="SL_P1" title="Microsoft">M</div> - -<div class="SL_BL_LABLE_ON" id="SL_P2" title="Translator">T</div> -</div> - -<div id="SL_alert_bbl" class="hidden"> -<div id="SLHKclose" style=""> </div> - -<div id="SL_alert_cont"> </div> -</div> - -<div id="SL_TB"> -<table id="SL_tables"> - <tbody> - <tr> - <td class="SL_td"><input></td> - <td class="SL_td"><select><option value="auto">Detect language</option><option value="af">Afrikaans</option><option value="sq">Albanian</option><option value="am">Amharic</option><option value="ar">Arabic</option><option value="hy">Armenian</option><option value="az">Azerbaijani</option><option value="eu">Basque</option><option value="be">Belarusian</option><option value="bn">Bengali</option><option value="bs">Bosnian</option><option value="bg">Bulgarian</option><option value="ca">Catalan</option><option value="ceb">Cebuano</option><option value="ny">Chichewa</option><option value="zh-CN">Chinese (Simplified)</option><option value="zh-TW">Chinese (Traditional)</option><option value="co">Corsican</option><option value="hr">Croatian</option><option value="cs">Czech</option><option value="da">Danish</option><option value="nl">Dutch</option><option value="en">English</option><option value="eo">Esperanto</option><option value="et">Estonian</option><option value="tl">Filipino</option><option value="fi">Finnish</option><option value="fr">French</option><option value="fy">Frisian</option><option value="gl">Galician</option><option value="ka">Georgian</option><option value="de">German</option><option value="el">Greek</option><option value="gu">Gujarati</option><option value="ht">Haitian Creole</option><option value="ha">Hausa</option><option value="haw">Hawaiian</option><option value="iw">Hebrew</option><option value="hi">Hindi</option><option value="hmn">Hmong</option><option value="hu">Hungarian</option><option value="is">Icelandic</option><option value="ig">Igbo</option><option value="id">Indonesian</option><option value="ga">Irish</option><option value="it">Italian</option><option value="ja">Japanese</option><option value="jw">Javanese</option><option value="kn">Kannada</option><option value="kk">Kazakh</option><option value="km">Khmer</option><option value="ko">Korean</option><option value="ku">Kurdish</option><option value="ky">Kyrgyz</option><option value="lo">Lao</option><option value="la">Latin</option><option value="lv">Latvian</option><option value="lt">Lithuanian</option><option value="lb">Luxembourgish</option><option value="mk">Macedonian</option><option value="mg">Malagasy</option><option value="ms">Malay</option><option value="ml">Malayalam</option><option value="mt">Maltese</option><option value="mi">Maori</option><option value="mr">Marathi</option><option value="mn">Mongolian</option><option value="my">Myanmar (Burmese)</option><option value="ne">Nepali</option><option value="no">Norwegian</option><option value="ps">Pashto</option><option value="fa">Persian</option><option value="pl">Polish</option><option value="pt">Portuguese</option><option value="pa">Punjabi</option><option value="ro">Romanian</option><option value="ru">Russian</option><option value="sm">Samoan</option><option value="gd">Scots Gaelic</option><option value="sr">Serbian</option><option value="st">Sesotho</option><option value="sn">Shona</option><option value="sd">Sindhi</option><option value="si">Sinhala</option><option value="sk">Slovak</option><option value="sl">Slovenian</option><option value="so">Somali</option><option value="es">Spanish</option><option value="su">Sundanese</option><option value="sw">Swahili</option><option value="sv">Swedish</option><option value="tg">Tajik</option><option value="ta">Tamil</option><option value="te">Telugu</option><option value="th">Thai</option><option value="tr">Turkish</option><option value="uk">Ukrainian</option><option value="ur">Urdu</option><option value="uz">Uzbek</option><option value="vi">Vietnamese</option><option value="cy">Welsh</option><option value="xh">Xhosa</option><option value="yi">Yiddish</option><option value="yo">Yoruba</option><option value="zu">Zulu</option></select></td> - <td class="SL_td"> - <div id="SL_switch_b" style="" title="Switch languages"> </div> - </td> - <td class="SL_td"><select><option value="af">Afrikaans</option><option value="sq">Albanian</option><option value="am">Amharic</option><option value="ar">Arabic</option><option value="hy">Armenian</option><option value="az">Azerbaijani</option><option value="eu">Basque</option><option value="be">Belarusian</option><option value="bn">Bengali</option><option value="bs">Bosnian</option><option value="bg">Bulgarian</option><option value="ca">Catalan</option><option value="ceb">Cebuano</option><option value="ny">Chichewa</option><option value="zh-CN">Chinese (Simplified)</option><option value="zh-TW">Chinese (Traditional)</option><option value="co">Corsican</option><option value="hr">Croatian</option><option value="cs">Czech</option><option value="da">Danish</option><option value="nl">Dutch</option><option value="en">English</option><option value="eo">Esperanto</option><option value="et">Estonian</option><option value="tl">Filipino</option><option value="fi">Finnish</option><option value="fr">French</option><option value="fy">Frisian</option><option value="gl">Galician</option><option value="ka">Georgian</option><option value="de">German</option><option value="el">Greek</option><option value="gu">Gujarati</option><option value="ht">Haitian Creole</option><option value="ha">Hausa</option><option value="haw">Hawaiian</option><option value="iw">Hebrew</option><option value="hi">Hindi</option><option value="hmn">Hmong</option><option value="hu">Hungarian</option><option value="is">Icelandic</option><option value="ig">Igbo</option><option value="id">Indonesian</option><option value="ga">Irish</option><option value="it">Italian</option><option value="ja">Japanese</option><option value="jw">Javanese</option><option value="kn">Kannada</option><option value="kk">Kazakh</option><option value="km">Khmer</option><option value="ko">Korean</option><option value="ku">Kurdish</option><option value="ky">Kyrgyz</option><option value="lo">Lao</option><option value="la">Latin</option><option value="lv">Latvian</option><option value="lt">Lithuanian</option><option value="lb">Luxembourgish</option><option value="mk">Macedonian</option><option value="mg">Malagasy</option><option value="ms">Malay</option><option value="ml">Malayalam</option><option value="mt">Maltese</option><option value="mi">Maori</option><option value="mr">Marathi</option><option value="mn">Mongolian</option><option value="my">Myanmar (Burmese)</option><option value="ne">Nepali</option><option value="no">Norwegian</option><option value="ps">Pashto</option><option value="fa">Persian</option><option value="pl">Polish</option><option value="pt">Portuguese</option><option value="pa">Punjabi</option><option value="ro">Romanian</option><option value="ru">Russian</option><option value="sm">Samoan</option><option value="gd">Scots Gaelic</option><option value="sr">Serbian</option><option value="st">Sesotho</option><option value="sn">Shona</option><option value="sd">Sindhi</option><option value="si">Sinhala</option><option value="sk">Slovak</option><option value="sl">Slovenian</option><option value="so">Somali</option><option selected value="es">Spanish</option><option value="su">Sundanese</option><option value="sw">Swahili</option><option value="sv">Swedish</option><option value="tg">Tajik</option><option value="ta">Tamil</option><option value="te">Telugu</option><option value="th">Thai</option><option value="tr">Turkish</option><option value="uk">Ukrainian</option><option value="ur">Urdu</option><option value="uz">Uzbek</option><option value="vi">Vietnamese</option><option value="cy">Welsh</option><option value="xh">Xhosa</option><option value="yi">Yiddish</option><option value="yo">Yoruba</option><option value="zu">Zulu</option></select></td> - <td class="SL_td"> </td> - <td class="SL_td"> - <div id="SL_TTS_voice" style="" title="English"> </div> - </td> - <td class="SL_td"> - <div class="SL_copy" id="SL_copy" style="" title="Copy translation"> </div> - </td> - <td class="SL_td"> - <div id="SL_bbl_font_patch"> </div> - - <div class="SL_bbl_font" id="SL_bbl_font" style="" title="Font size"> </div> - </td> - <td class="SL_td"> - <div id="SL_bbl_help" style="" title="Help"> </div> - </td> - <td class="SL_td"> - <div class="SL_pin_off" id="SL_pin" style="" title="Pin pop-up bubble"> </div> - </td> - </tr> - </tbody> -</table> -</div> -</div> - -<div id="SL_shadow_translation_result" style=""> </div> - -<div class="SL_loading" id="SL_loading" style=""> </div> - -<div id="SL_player2"> </div> - -<div id="SL_alert100">Text-to-speech function is limited to 200 characters</div> - -<div id="SL_Balloon_options" style="background: rgb(255, 255, 255);"> -<div id="SL_arrow_down" style=""> </div> - -<table id="SL_tbl_opt" style="width: 100%;"> - <tbody> - <tr> - <td><input></td> - <td> - <div id="SL_BBL_IMG" style="" title="Show Translator's button 3 second(s)"> </div> - </td> - <td><a class="SL_options" title="Show options">Options</a> : <a class="SL_options" title="Translation History">History</a> : <a class="SL_options" title="ImTranslator Feedback">Feedback</a> : <a class="SL_options" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GD9D8CPW8HFA2" title="Make a small contribution">Donate</a></td> - <td><span id="SL_Balloon_Close" title="Close">Close</span></td> - </tr> - </tbody> -</table> -</div> -</div> -</div> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/api/storage/index.html b/files/pt-pt/mozilla/add-ons/webextensions/api/storage/index.html deleted file mode 100644 index f4551690f3..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/api/storage/index.html +++ /dev/null @@ -1,106 +0,0 @@ ---- -title: Armazenamento -slug: Mozilla/Add-ons/WebExtensions/API/storage -tags: - - API - - Armazenamento - - Extensões - - Extensões da Web - - Extras - - Interface - - Não Padrão - - Referencia -translation_of: Mozilla/Add-ons/WebExtensions/API/storage -original_slug: Mozilla/Add-ons/WebExtensions/API/Armazenamento ---- -<div>{{AddonSidebar}}</div> - -<p>Permite que as extensões armazenem e recuperem dados, e escutem as alterações aos itens armazenados.</p> - -<p>O sistema de armazenamento é baseado na <a href="/pt-PT/docs/Web/API/API_de_Armazenamento_da_Web">API de Armazenamento da Web</a>, com algumas diferenças. Entre outras diferençãs, estas incluem:</p> - -<ul> - <li>It's asynchronous.</li> - <li>Values are scoped to the extension, not to a specific domain (i.e. the same set of key/value pairs are available to all scripts in the background context and content scripts).</li> - <li>The values stored can be any JSON-ifiable value, not just <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></code>. Among other things, this includes: <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></code> and <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></code>, but only when their contents can can be represented as JSON, which does not include DOM nodes. You don't need to convert your values to JSON <code>Strings</code> prior to storing them, but they are represented as JSON internally, thus the requirement that they be JSON-ifiable.</li> - <li>Multiple key/value pairs can be set or retrieved in the same API call.</li> -</ul> - -<p>To use this API you need to include the "storage" <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions">permission</a> in your <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json">manifest.json</a> file.</p> - -<p>Each extension has its own storage area, which can be split into different types of storage.</p> - -<p>Although this API is similar to {{domxref("Window.localStorage")}} it is recommended that you don't use <code>Window.localStorage</code> in the extension code to store extension-related data. Firefox will clear data stored by extensions using the localStorage API in various scenarios where users clear their browsing history and data for privacy reasons, while data saved using the <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/local">storage.local</a></code> API will be correctly persisted in these scenarios.</p> - -<h2 id="Tipos">Tipos</h2> - -<dl> - <dt>{{WebExtAPIRef("storage.StorageArea")}}</dt> - <dd>An object representing a storage area.</dd> - <dt>{{WebExtAPIRef("storage.StorageChange")}}</dt> - <dd>An object representing a change to a storage area.</dd> -</dl> - -<h2 id="Propriedades">Propriedades</h2> - -<p><code>storage</code> has three properties, which represent the different types of available storage area.</p> - -<dl> - <dt>{{WebExtAPIRef("storage.sync")}}</dt> - <dd>Represents the <code>sync</code> storage area. Items in <code>sync</code> storage are synced by the browser, and are available across all instances of that browser that the user is logged into, across different devices.</dd> - <dt>{{WebExtAPIRef("storage.local")}}</dt> - <dd>Represents the <code>local</code> storage area. Items in <code>local</code> storage are local to the machine the extension was installed on.</dd> - <dt>{{WebExtAPIRef("storage.managed")}}</dt> - <dd>Represents the <code>managed</code> storage area. Items in <code>managed</code> storage are set by the domain administrator and are read-only for the extension. Trying to modify this namespace results in an error.</dd> -</dl> - -<h2 id="Eventos">Eventos</h2> - -<dl> - <dt>{{WebExtAPIRef("storage.onChanged")}}</dt> - <dd>Fired when one or more items change in a storage area.</dd> -</dl> - -<h2 id="Compatibilidade_do_navegador">Compatibilidade do navegador</h2> - -<p>{{Compat("webextensions.api.storage")}}</p> - -<p>{{WebExtExamples("h2")}}</p> - -<div class="note"><strong>Reconehcimentos</strong> - -<p>This API is based on Chromium's <a href="https://developer.chrome.com/extensions/storage"><code>chrome.storage</code></a> API. This documentation is derived from <a href="https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/storage.json"><code>storage.json</code></a> in the Chromium code.</p> - -<p>Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.</p> -</div> - -<div class="hidden"> -<pre>// Copyright 2015 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -</pre> -</div> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/browser_support_for_javascript_apis/index.html b/files/pt-pt/mozilla/add-ons/webextensions/browser_support_for_javascript_apis/index.html deleted file mode 100644 index 4f5f3b176e..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/browser_support_for_javascript_apis/index.html +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: Suporte de navegador para as APIs de JavaScript -slug: Mozilla/Add-ons/WebExtensions/Browser_support_for_JavaScript_APIs -tags: - - Extensões da Web -translation_of: Mozilla/Add-ons/WebExtensions/Browser_support_for_JavaScript_APIs -original_slug: Mozilla/Add-ons/WebExtensions/Suporte_navegador_APIs_JavaScript ---- -<div>{{AddonSidebar}}</div> - -<p>{{WebExtAllCompatTables}}</p> - -<div>A tabela de compatibilidade nesta página é gerada a partir de dados estruturados. Se quiser contribuir para os dados, verifique por favor, consulte https://github.com/mdn/browser-compat-data e envie-nos um pedido de submissão.</div> - -<div> </div> - -<div class="note"><strong>Agradecimentos</strong> - -<p>Os dados de compatibilidade do Microsoft Edge são fornecidos pela Corporação Microsoft e estão incluídos aqui sob a Licença de Creative Commons Attribution 3.0 - Estado Unidos.</p> -</div> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/content_scripts/index.html b/files/pt-pt/mozilla/add-ons/webextensions/content_scripts/index.html deleted file mode 100644 index 13daea5bbf..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/content_scripts/index.html +++ /dev/null @@ -1,447 +0,0 @@ ---- -title: Scripts de Conteúdo -slug: Mozilla/Add-ons/WebExtensions/Content_scripts -tags: - - Extensões da Web -translation_of: Mozilla/Add-ons/WebExtensions/Content_scripts -original_slug: Mozilla/Add-ons/WebExtensions/Scripts_Conteudo ---- -<div>{{AddonSidebar}}</div> - -<p>Um <em>script</em> de conteúdo é uma parte da sua extensão que é executada no contexto de uma determinada página da Web (em oposição aos <em>scripts</em> de segundo plano que são parte da própria extensão, ou <em>scripts</em> que são parte do próprio site da Web, tal como aqueles carregados utilizando o {{HTMLElement("script")}} elemento.</p> - -<p><a href="/en-US/Add-ons/WebExtensions/Background_scripts">Background scripts</a> can access all the <a href="/en-US/Add-ons/WebExtensions/API">WebExtension JavaScript APIs</a>, but they can't directly access the content of web pages. So if your extension needs to do that, you need content scripts.</p> - -<p>Just like the scripts loaded by normal web pages, content scripts can read and modify the content of their pages using the standard DOM APIs.</p> - -<p>Content scripts can only access <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Content_scripts#WebExtension_APIs">a small subset of the WebExtension APIs</a>, but they can <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Content_scripts#Communicating_with_background_scripts">communicate with background scripts</a> using a messaging system, and thereby indirectly access the WebExtension APIs.</p> - -<div class="note"> -<p>Note that content scripts are blocked on the following domains: accounts-static.cdn.mozilla.net, accounts.firefox.com, addons.cdn.mozilla.net, addons.mozilla.org, api.accounts.firefox.com, content.cdn.mozilla.net, content.cdn.mozilla.net, discovery.addons.mozilla.org, input.mozilla.org, install.mozilla.org, oauth.accounts.firefox.com, profile.accounts.firefox.com, support.mozilla.org, sync.services.mozilla.com, and testpilot.firefox.com. If you try to inject a content script into a page in these domains, it will fail and the page will log a <a href="/en-US/docs/Web/HTTP/CSP">CSP</a> error.</p> - -<p>As these restrictions include addons.mozilla.org, users may attempt to use your extension immediately after installation and find it doesn't work. You may want to add an appropriate warning or an <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/onboarding_upboarding_offboarding_best_practices">onboarding page</a> that moves users away from addons.mozilla.org.</p> -</div> - -<div class="note"> -<p>Values added to the global scope of a content script with <code>var foo</code> or <code>window.foo = "bar"</code> may disappear due to bug <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1408996">1408996</a>.</p> -</div> - -<h2 id="Carregar_scripts_de_conteúdo">Carregar <em>scripts</em> de conteúdo</h2> - -<p>You can load a content script into a web page in one of three ways:</p> - -<ol> - <li><strong>at install time, into pages that match URL patterns:</strong> using the <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts">content_scripts</a></code> key in your manifest.json, you can ask the browser to load a content script whenever the browser loads a page whose URL <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Match_patterns">matches a given pattern</a>.</li> - <li><strong>at runtime, into pages that match URL patterns:</strong> using the {{WebExtAPIRef("contentScripts")}} API, you can ask the browser to load a content script whenever the browser loads a page whose URL <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Match_patterns">matches a given pattern</a>. This is just like method (1), except you can add and remove content scripts at runtime.</li> - <li><strong>at runtime, into specific tabs:</strong> using the <code><a href="/en-US/Add-ons/WebExtensions/API/Tabs/executeScript">tabs.executeScript()</a></code> API, you can load a content script into a specific tab whenever you want: for example, in response to the user clicking on a <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Browser_action">browser action</a>.</li> -</ol> - -<p>There is only one global scope per frame per extension, so variables from one content script can directly be accessed by another content script, regardless of how the content script was loaded.</p> - -<p>Using methods (1) and (2) you can only load scripts into pages whose URLs can be represented using a <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns">match pattern</a>. Using method (3), you can also load scripts into pages packaged with your extension, but you can't load scripts into privileged browser pages like "about:debugging" or "about:addons".</p> - -<h2 id="Ambiente_de_script_de_conteúdo">Ambiente de <em>script</em> de conteúdo</h2> - -<h3 id="Acesso_DOM">Acesso DOM</h3> - -<p>Content scripts can access and modify the page's DOM, just like normal page scripts can. They can also see any changes that were made to the DOM by page scripts.</p> - -<p>However, content scripts get a "clean view of the DOM". This means:</p> - -<ul> - <li>content scripts cannot see JavaScript variables defined by page scripts</li> - <li>if a page script redefines a built-in DOM property, the content script will see the original version of the property, not the redefined version.</li> -</ul> - -<p>In Firefox, this behavior is called <a href="/en-US/docs/Xray_vision">Xray vision</a>.</p> - -<p>For example, consider a web page like this:</p> - -<pre class="brush: html"><!DOCTYPE html> -<html> - <head> - <meta http-equiv="content-type" content="text/html; charset=utf-8" /> - </head> - - <body> - <script src="page-scripts/page-script.js"></script> - </body> -</html></pre> - -<p>The script "page-script.js" does this:</p> - -<pre class="brush: js">// page-script.js - -// add a new element to the DOM -var p = document.createElement("p"); -p.textContent = "This paragraph was added by a page script."; -p.setAttribute("id", "page-script-para"); -document.body.appendChild(p); - -// define a new property on the window -window.foo = "This global variable was added by a page script"; - -// redefine the built-in window.confirm() function -window.confirm = function() { - alert("The page script has also redefined 'confirm'"); -}</pre> - -<p>Now an extension injects a content script into the page:</p> - -<pre class="brush: js">// content-script.js - -// can access and modify the DOM -var pageScriptPara = document.getElementById("page-script-para"); -pageScriptPara.style.backgroundColor = "blue"; - -// can't see page-script-added properties -console.log(window.foo); // undefined - -// sees the original form of redefined properties -window.confirm("Are you sure?"); // calls the original window.confirm()</pre> - -<p>The same is true in reverse: page scripts can't see JavaScript properties added by content scripts.</p> - -<p>All this means that the content script can rely on DOM properties behaving predictably, and doesn't have to worry about variables it defines clashing with variables defined in the page script.</p> - -<p>One practical consequence of this behavior is that a content script won't have access to any JavaScript libraries loaded by the page. So for example, if the page includes jQuery, the content script won't be able to see it.</p> - -<p>If a content script does want to use a JavaScript library, then the library itself should be injected as a content script alongside the content script that wants to use it:</p> - -<pre class="brush: json">"content_scripts": [ - { - "matches": ["*://*.mozilla.org/*"], - "js": ["jquery.js", "content-script.js"] - } -]</pre> - -<p>Note that Firefox provides some APIs that enable content scripts to access JavaScript objects created by page scripts and to expose their own JavaScript objects to page scripts. See <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Sharing_objects_with_page_scripts">Sharing objects with page scripts</a> for more details.</p> - -<h3 id="APIs_da_Extensão_da_Web">APIs da Extensão da Web</h3> - -<p>In addition to the standard DOM APIs, content scripts can use the following WebExtension APIs:</p> - -<p>From <code><a href="/en-US/Add-ons/WebExtensions/API/extension">extension</a></code>:</p> - -<ul> - <li><code><a href="/en-US/Add-ons/WebExtensions/API/extension#getURL()">getURL()</a></code></li> - <li><code><a href="/en-US/Add-ons/WebExtensions/API/extension#inIncognitoContext">inIncognitoContext</a></code></li> -</ul> - -<p>From <code><a href="/en-US/Add-ons/WebExtensions/API/runtime">runtime</a></code>:</p> - -<ul> - <li><code><a href="/en-US/Add-ons/WebExtensions/API/runtime#connect()">connect()</a></code></li> - <li><code><a href="/en-US/Add-ons/WebExtensions/API/runtime#getManifest()">getManifest()</a></code></li> - <li><code><a href="/en-US/Add-ons/WebExtensions/API/runtime#getURL()">getURL()</a></code></li> - <li><code><a href="/en-US/Add-ons/WebExtensions/API/runtime#onConnect">onConnect</a></code></li> - <li><code><a href="/en-US/Add-ons/WebExtensions/API/runtime#onMessage">onMessage</a></code></li> - <li><code><a href="/en-US/Add-ons/WebExtensions/API/runtime#sendMessage()">sendMessage()</a></code></li> -</ul> - -<p>From <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/i18n">i18n</a></code>:</p> - -<ul> - <li><code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/i18n/getMessage">getMessage()</a></code></li> - <li><code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/i18n/getAcceptLanguages">getAcceptLanguages()</a></code></li> - <li><code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/i18n/getUILanguage">getUILanguage()</a></code></li> - <li><code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/i18n/detectLanguage">detectLanguage()</a></code></li> -</ul> - -<p>From <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/menus">menus</a></code>:</p> - -<ul> - <li><code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/menus/getTargetElement">getTargetElement</a></code></li> -</ul> - -<p>Everything from <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage">storage</a></code>.</p> - -<h3 id="XHR_e_Fetch">XHR e <em>Fetch</em></h3> - -<p>Content scripts can make requests using the normal <code><a href="/en-US/docs/Web/API/XMLHttpRequest">window.XMLHttpRequest</a></code> and <code><a href="/en-US/docs/Web/API/Fetch_API">window.fetch()</a></code> APIs.</p> - -<p>Content scripts get the same cross-domain privileges as the rest of the extension: so if the extension has requested cross-domain access for a domain using the <code><a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/permissions">permissions</a></code> key in manifest.json, then its content scripts get access that domain as well.</p> - -<p>This is accomplished by exposing more privileged XHR and fetch instances in the content script, which has the side-effect of not setting the <code><a href="/en-US/docs/Web/HTTP/Headers/Origin">Origin</a></code> and <code><a href="/en-US/docs/Web/HTTP/Headers/Referer">Referer</a></code> headers like a request from the page itself would, this is often preferable to prevent the request from revealing its cross-orign nature. From version 58 onwards extensions that need to perform requests that behave as if they were sent by the content itself can use <code>content.XMLHttpRequest</code> and <code>content.fetch()</code> instead. For cross-browser extensions their presence must be feature-detected.</p> - -<h2 id="Comunicar_com_scripts_de_segundo_plano">Comunicar com <em>scripts</em> de segundo plano</h2> - -<p>Although content scripts can't directly use most of the WebExtension APIs, they can communicate with the extension's background scripts using the messaging APIs, and can therefore indirectly access all the same APIs that the background scripts can.</p> - -<p>There are two basic patterns for communicating between the background scripts and content scripts: you can send one-off messages, with an optional response, or you can set up a longer-lived connection between the two sides, and use that connection to exchange messages.</p> - -<h3 id="One-off_messages">One-off messages</h3> - -<p>To send one-off messages, with an optional response, you can use the following APIs:</p> - -<table class="fullwidth-table standard-table"> - <thead> - <tr> - <th scope="row"></th> - <th scope="col">In content script</th> - <th scope="col">In background script</th> - </tr> - </thead> - <tbody> - <tr> - <th scope="row">Send a message</th> - <td><code><a href="/en-US/Add-ons/WebExtensions/API/runtime/sendMessage">browser.runtime.sendMessage()</a></code></td> - <td><code><a href="/en-US/Add-ons/WebExtensions/API/Tabs/sendMessage">browser.tabs.sendMessage()</a></code></td> - </tr> - <tr> - <th scope="row">Receive a message</th> - <td><code><a href="/en-US/Add-ons/WebExtensions/API/runtime/onMessage">browser.runtime.onMessage</a></code></td> - <td><code><a href="/en-US/Add-ons/WebExtensions/API/runtime/onMessage">browser.runtime.onMessage</a></code></td> - </tr> - </tbody> -</table> - -<p>For example, here's a content script which listens for click events in the web page. If the click was on a link, it messages the background page with the target URL:</p> - -<pre class="brush: js">// content-script.js - -window.addEventListener("click", notifyExtension); - -function notifyExtension(e) { - if (e.target.tagName != "A") { - return; - } - browser.runtime.sendMessage({"url": e.target.href}); -}</pre> - -<p>The background script listens for these messages and displays a notification using the <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/notifications">notifications</a></code> API:</p> - -<pre class="brush: js">// background-script.js - -browser.runtime.onMessage.addListener(notify); - -function notify(message) { - browser.notifications.create({ - "type": "basic", - "iconUrl": browser.extension.getURL("link.png"), - "title": "You clicked a link!", - "message": message.url - }); -} -</pre> - -<p>This example code is lightly adapted from the <a href="https://github.com/mdn/webextensions-examples/tree/master/notify-link-clicks-i18n">notify-link-clicks-i18n</a> example on GitHub.</p> - -<h3 id="Connection-based_messaging">Connection-based messaging</h3> - -<p>Sending one-off messages can get cumbersome if you are exchanging a lot of messages between a background script and a content script. So an alternative pattern is to establish a longer-lived connection between the two contexts, and use this connection to exchange messages.</p> - -<p>Each side has a <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/Port">runtime.Port</a></code> object, which they can use to exchange messages.</p> - -<p>To create the connection:</p> - -<ul> - <li>one side listens for connections using <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onConnect">runtime.onConnect</a></code></li> - <li>the other side calls either <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/connect">tabs.connect()</a></code> (if connecting to a content script) or <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/connect">runtime.connect()</a></code> (if connecting to a background script). This returns a <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/Port">runtime.Port</a></code> object.</li> - <li>the <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onConnect">runtime.onConnect</a></code> listener gets passed its own <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/Port">runtime.Port</a></code> object.</li> -</ul> - -<p>Once each side has a port, the two sides can exchange messages using <code>runtime.Port.postMessage()</code> to send a message, and <code>runtime.Port.onMessage</code> to receive messages.</p> - -<p>For example, as soon as it loads, this content script:</p> - -<ul> - <li>connects to the background script, and stores the <code>Port</code> in a variable <code>myPort</code></li> - <li>listens for messages on <code>myPort</code>, and logs them</li> - <li>sends messages to the background script, using <code>myPort</code>, when the user clicks the document</li> -</ul> - -<pre class="brush: js">// content-script.js - -var myPort = browser.runtime.connect({name:"port-from-cs"}); -myPort.postMessage({greeting: "hello from content script"}); - -myPort.onMessage.addListener(function(m) { - console.log("In content script, received message from background script: "); - console.log(m.greeting); -}); - -document.body.addEventListener("click", function() { - myPort.postMessage({greeting: "they clicked the page!"}); -});</pre> - -<p>The corresponding background script:</p> - -<ul> - <li>listens for connection attempts from the content script</li> - <li>when it receives a connection attempt: - <ul> - <li>stores the port in a variable named <code>portFromCS</code></li> - <li>sends the content script a message using the port</li> - <li>starts listening to messages received on the port, and logs them</li> - </ul> - </li> - <li>sends messages to the content script, using <code>portFromCS</code>, when the user clicks the extension's browser action</li> -</ul> - -<pre class="brush: js">// background-script.js - -var portFromCS; - -function connected(p) { - portFromCS = p; - portFromCS.postMessage({greeting: "hi there content script!"}); - portFromCS.onMessage.addListener(function(m) { - console.log("In background script, received message from content script") - console.log(m.greeting); - }); -} - -browser.runtime.onConnect.addListener(connected); - -browser.browserAction.onClicked.addListener(function() { - portFromCS.postMessage({greeting: "they clicked the button!"}); -}); -</pre> - -<h4 id="Multiple_content_scripts">Multiple content scripts</h4> - -<p>If you have multiple content scripts communicating at the same time, you might want to store each connection in an array.</p> - - - -<ul> -</ul> - -<pre class="brush: js">// background-script.js - -var ports = [] - -function connected(p) { - ports[p.sender.tab.id] = p - //... -} - -browser.runtime.onConnect.addListener(connected) - -browser.browserAction.onClicked.addListener(function() { - ports.forEach(p => { - p.postMessage({greeting: "they clicked the button!"}) - }) -});</pre> - - - -<ul> -</ul> - -<h2 id="Comunicar_com_a_página_da_Web">Comunicar com a página da Web</h2> - -<p>Although content scripts don't by default get access to objects created by page scripts, they can communicate with page scripts using the DOM <code><a href="/en-US/docs/Web/API/Window/postMessage">window.postMessage</a></code> and <code><a href="/en-US/docs/Web/API/EventTarget/addEventListener">window.addEventListener</a></code> APIs.</p> - -<p>For example:</p> - -<pre class="brush: js">// page-script.js - -var messenger = document.getElementById("from-page-script"); - -messenger.addEventListener("click", messageContentScript); - -function messageContentScript() { - window.postMessage({ - direction: "from-page-script", - message: "Message from the page" - }, "*");</pre> - -<pre class="brush: js">// content-script.js - -window.addEventListener("message", function(event) { - if (event.source == window && - event.data && - event.data.direction == "from-page-script") { - alert("Content script received message: \"" + event.data.message + "\""); - } -});</pre> - -<p>For a complete working example of this, <a href="https://mdn.github.io/webextensions-examples/content-script-page-script-messaging.html">visit the demo page on GitHub</a> and follow the instructions.</p> - -<div class="warning"> -<p>Note that any time you interact with untrusted web content on this way, you need to be very careful. Extensions are privileged code which can have powerful capabilities, and hostile web pages can easily trick them into accessing those capabilities.</p> - -<p>To make a trivial example, suppose the content script code that receives the message does something like this:</p> - -<pre class="brush: js">// content-script.js - -window.addEventListener("message", function(event) { - if (event.source == window && - event.data.direction && - event.data.direction == "from-page-script") { - eval(event.data.message); - } -});</pre> - -<p>Now the page script can run any code with all the privileges of the content script.</p> -</div> - -<h2 id="Using_eval()_in_content_scripts">Using eval() in content scripts</h2> - -<p>In Chrome, <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval">eval()</a></code> always runs code in the context of the content script, not in the context of the page.</p> - -<p>In Firefox:</p> - -<ul> - <li>if you call <code>eval()</code>, it runs code in the context of the content script</li> - <li>if you call <code>window.eval()</code>, it runs code in the context of the page.</li> -</ul> - -<p>For example, consider a content script like this:</p> - -<pre class="brush: js">// content-script.js - -window.eval('window.x = 1;'); -eval('window.y = 2'); - -console.log(`In content script, window.x: ${window.x}`); -console.log(`In content script, window.y: ${window.y}`); - -window.postMessage({ - message: "check" -}, "*");</pre> - -<p>This code just creates some variables x and y using <code>window.eval()</code> and <code>eval()</code>, then logs their values, then messages the page.</p> - -<p>On receiving the message, the page script logs the same variables:</p> - -<pre class="brush: js">window.addEventListener("message", function(event) { - if (event.source === window && event.data && event.data.message === "check") { - console.log(`In page script, window.x: ${window.x}`); - console.log(`In page script, window.y: ${window.y}`); - } -});</pre> - -<p>In Chrome, this will produce output like this:</p> - -<pre>In content script, window.x: 1 -In content script, window.y: 2 -In page script, window.x: undefined -In page script, window.y: undefined</pre> - -<p>In Firefox the following output is produced:</p> - -<pre>In content script, window.x: undefined -In content script, window.y: 2 -In page script, window.x: 1 -In page script, window.y: undefined</pre> - -<p>The same applies to <code><a href="/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout">setTimeout()</a></code>, <code><a href="/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval">setInterval()</a></code>, and <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function()</a></code>.</p> - -<p>When running code in the context of the page, be very careful. The page's environment is controlled by potentially malicious web pages, which can redefine objects you interact with to behave in unexpected ways:</p> - -<pre class="brush: js">// page.js redefines console.log - -var original = console.log; - -console.log = function() { - original(true); -} -</pre> - -<pre class="brush: js">// content-script.js calls the redefined version - -window.eval('console.log(false)'); -</pre> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/examples/index.html b/files/pt-pt/mozilla/add-ons/webextensions/examples/index.html deleted file mode 100644 index 9e00250f9f..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/examples/index.html +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: Exemplos de extensões -slug: Mozilla/Add-ons/WebExtensions/Examples -tags: - - Extensões da Web -translation_of: Mozilla/Add-ons/WebExtensions/Examples -original_slug: Mozilla/Add-ons/WebExtensions/Exemplos_extensoes ---- -<div>{{AddonSidebar}}</div> - -<p>Para ajudar a ilustrar como desenvolver extensões, nós mantemos um repositório de exemplos de extensões simples em <a href="https://github.com/mdn/webextensions-examples">https://github.com/mdn/webextensions-examples</a>. Este artigo descreve as APIs de Extensão da Web utilizadas nesse repositório.</p> - -<p>Estes exemplos funcionam no Firefox Nightly: a maioria funciona nas versões anteriores do Firefox, mas verifique a chave <a href="/pt-PT/docs/Mozilla/Add-ons/WebExtensions/manifest.json/applications">strict_min_version</a> em manifest.json da extensão para se certificar.</p> - -<p>Se quiser experimentar estes exemplos, tem três opções principais:</p> - -<ol> - <li>Clone o repositório, depois carregue a extensão diretamente da sua diretoria fonte, utilizando a funcionalidade <a href="/pt-PT/Add-ons/WebExtensions/Instalacao_temporaria_no_Firefox">"Carregar Temporariamente os Extras"</a>. A extensão permanecerá carregada até que reinicie o Firefox.</li> - <li>Clone o repositório, depois utilize a ferramenta de linha de comando <a href="/pt-PT/docs/Mozilla/Add-ons/WebExtensions/Primeiros_passos_com_web-ext">web-ext</a> para executar o Firefox com a extensão instalada.</li> - <li>Clone o repositório, depois vá para a diretoria de <em><a href="https://github.com/mdn/webextensions-examples/tree/master/build">build</a></em>. Esta contém as versões criadas e assinadas de todos os exemplos, e assim pode abri-las no Firefox (utilizando Ficheiro/Abrir Ficheiro) e instale-as permanentemente, tal como uma extensão que instalaria a partir de <a href="https://addons.mozilla.org/en-US/firefox/">addons.mozilla.org</a>.</li> -</ol> - -<div class="warning"> -<p><strong>Importante</strong>: Por favor, não submeta estes exemplos dos exemplos da 'Extensão da Web' para AMO (addons.mozilla.org), não precisa de assinar o extra para executar os exemplos da 'Extensão da Web'. Basta seguir os passos acima.</p> -</div> - -<p>Se desejar contribuir para o repositório, <a href="https://github.com/mdn/webextensions-examples/blob/master/CONTRIBUTING.md">envie-nos um pedido de submissão!</a></p> - -<p>{{WebExtAllExamples}}</p> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/extending_the_developer_tools/index.html b/files/pt-pt/mozilla/add-ons/webextensions/extending_the_developer_tools/index.html deleted file mode 100644 index ac5e8d664e..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/extending_the_developer_tools/index.html +++ /dev/null @@ -1,157 +0,0 @@ ---- -title: Extensão das ferramentas de desenvolvimento -slug: Mozilla/Add-ons/WebExtensions/Extending_the_developer_tools -translation_of: Mozilla/Add-ons/WebExtensions/Extending_the_developer_tools -original_slug: Mozilla/Add-ons/WebExtensions/Extensão_das_ferramentas_de_desenvolvimento ---- -<div>{{AddonSidebar}}</div> - -<div class="note"> -<p>Esta página descreve as APIs das <em>devtools</em> que existem no Firefox 55. Embora as APIs sejam baseadas nas <a href="https://developer.chrome.com/extensions/devtools">APIs de devtools do Chrome</a>, ainda existem muitas funcionalidades que ainda não estão implementadas no Firefox, e por isso, não estão documentadas aqui. Para ver quais as funcionalidades que estão atualmente em falta, por favor, consulte <a href="/pt-PT/Add-ons/WebExtensions/Extensão_das_ferramentas_de_desenvolvimento#Limitações_das_APIs_de_devtools">Limitações das APIs de devtools</a>.</p> -</div> - -<p>Pode utilizar as APIs das Extensões da Web para ampliar as ferramentas de desenvollvimento integradas no navegador. Para criar a extensão <em>devtools</em>, inclua a chave "<a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/devtools_page">devtools_page</a>" no <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json">manifest.json</a>:</p> - -<pre class="brush: json">"devtools_page": "devtools/devtools-page.html"</pre> - -<p>O valor desta chave é um URL a apontar para um ficheiro HTML que foi incorporado com a sua extensão. O URL deverá ser relativo ao próprio ficheiro manifest.json.</p> - -<p>O ficheiro HTML define uma página especial na extensão, chamada de página <em>devtools</em>.</p> - -<h2 id="A_página_devtools">A página devtools</h2> - -<p>The devtools page is loaded when the browser devtools are opened, and unloaded when it is closed. Note that because the devtools window is associated with a single tab, it's quite possible for more than one devtools window - hence more than one devtools page - to exist at the same time.</p> - -<p>The devtools page doesn't have any visible DOM, but can include JavaScript sources using <code><a href="/en-US/docs/Web/HTML/Element/script"><script></a></code> tags. The sources must be bundled with the extension itself. The sources get access to:</p> - -<ul> - <li>the normal DOM APIs accessible through the global <code><a href="/en-US/docs/Web/API/Window">window</a></code> object</li> - <li>the same <a href="/en-US/Add-ons/WebExtensions/Content_scripts#WebExtension_APIs">WebExtension APIs as in Content Scripts</a></li> - <li>the devtools APIs: - <ul> - <li><code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/devtools.inspectedWindow">devtools.inspectedWindow</a></code></li> - <li><code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/devtools.network">devtools.network</a></code></li> - <li><code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/devtools.panels">devtools.panels</a></code></li> - </ul> - </li> -</ul> - -<p>Note that the devtools page does not get access to any other WebExtension APIs, and the background page doesn't get access to the devtools APIs. Instead, the devtools page and the background page must communicate using the <code>runtime</code> messaging APIs.</p> - -<h2 id="Criar_painéis">Criar painéis</h2> - -<p>The devtools window hosts a number of separate tools - the JavaScript Debugger, Network Monitor, and so on. A row of tabs across the top lets the user switch between the different tools. The window hosting each tool's user interface is called a "panel".</p> - -<p>Using the <code>devtools.panels.create()</code> API, you can create your own panel in the devtools window:</p> - -<pre class="brush: js">browser.devtools.panels.create( - "My Panel", // title - "icons/star.png", // icon - "devtools/panel/panel.html" // content -).then((newPanel) => { - newPanel.onShown.addListener(initialisePanel); - newPanel.onHidden.addListener(unInitialisePanel); -});</pre> - -<p>This takes three mandatory arguments: the panel's title, icon, and content. It returns a <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code> which resolves to a <code>devtools.panels.ExtensionPanel</code> object representing the new panel.</p> - -<h2 id="Interagir_com_a_janela_de_destino">Interagir com a janela de destino</h2> - -<p>The developer tools are always attached to a particular browser tab. This is referred to as the "target" for the developer tools, or the "inspected window". You can interact with the inspected window using the <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/devtools.inspectedWindow">devtools.inspectedWindow</a></code> API.</p> - -<h3 id="Executar_código_na_janela_de_destino">Executar código na janela de destino</h3> - -<p>The <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/devtools.inspectedWindow/eval">devtools.inspectedWindow.eval()</a></code> provides one way to run code in the inspected window.</p> - -<p>This is somewhat like using {{WebExtAPIRef("tabs.executeScript()")}} to inject a content script, but with one important difference:</p> - -<ul> - <li>unlike content scripts, scripts loaded using <code>devtools.inspectedWindow.eval()</code><strong> do not</strong> get <a href="/en-US/Add-ons/WebExtensions/Content_scripts#DOM_access">a "clean view of the DOM"</a>: that is, they can see changes to the page made by page scripts.</li> -</ul> - -<div class="note"> -<p>Note that a clean view of the DOM is a security feature, intended to help prevent hostile pages from tricking extensions by redefining the behavior of native DOM functions. This means you need to be very careful using eval(), and should use a normal content script if you can.</p> -</div> - -<p>Scripts loaded using <code>devtools.inspectedWindow.eval()</code> also don't see any JavaScript variables defined by content scripts.</p> - -<h3 id="Trabalhar_com_scripts_de_conteúdo">Trabalhar com <em>scripts</em> de conteúdo</h3> - -<p>A devtools document doesn't have direct access to {{WebExtAPIRef("tabs.executeScript()")}}, so if you need to inject a content script, the devtools document must send a message to the background script asking it to inject the script. The <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/devtools.inspectedWindow/tabId">devtools.inspectedWindow.tabId</a></code> provides the ID of the target tab: the devtools document can pass this to the background script, and the background script can in turn pass it into {{WebExtAPIRef("tabs.executeScript()")}}:</p> - -<pre class="brush: js">// devtools-panel.js - -const scriptToAttach = "document.body.innerHTML = 'Hi from the devtools';"; - -window.addEventListener("click", () => { - browser.runtime.sendMessage({ - tabId: browser.devtools.inspectedWindow.tabId, - script: scriptToAttach - }); -});</pre> - -<pre class="brush: js">// background.js - -function handleMessage(request, sender, sendResponse) { - browser.tabs.executeScript(request.tabId, { - code: request.script - }); -} - -browser.runtime.onMessage.addListener(handleMessage);</pre> - -<p>If you need to exchange messages between the content scripts running in the target window and a devtools document, it's a good idea to use the {{WebExtAPIRef("runtime.connect()")}} and {{WebExtAPIRef("runtime.onConnect")}} to set up a connection between the background page and the devtools document. The background page can then maintain a mapping between tab IDs and {{WebExtAPIRef("runtime.Port")}} objects, and use this to route messages between the two scopes.</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/14923/devtools-content-scripts.png" style="display: block; height: 416px; margin-left: auto; margin-right: auto; width: 600px;"></p> - -<h2 id="Limitações_das_APIs_de_devtools">Limitações das APIs de devtools</h2> - -<p>These APIs are based on the Chrome devtools APIs, but many features are still missing, compared with Chrome. This section lists the features that are still not implemented, as of Firefox 54. Note that the devtools APIs are under active development and we expect to add support for most of them in future releases.</p> - -<h3 id="devtools.inspectedWindow">devtools.inspectedWindow</h3> - -<p>The following are not supported:</p> - -<ul> - <li><code>inspectedWindow.getResources()</code></li> - <li><code>inspectedWindow.onResourceAdded</code></li> - <li><code>inspectedWindow.onResourceContentCommitted</code></li> -</ul> - -<p>None of the options to <code>inspectedWindow.eval()</code> are supported.</p> - -<p>Scripts injected using <code>inspectedWindow.eval()</code> can't use any of the Console's command-line helper functions, like $0.</p> - -<h3 id="devtools.network">devtools.network</h3> - -<p>The following are not supported:</p> - -<ul> - <li><code>network.getHAR()</code></li> - <li><code>network.onRequestFinished</code></li> -</ul> - -<h3 id="devtools.panels">devtools.panels</h3> - -<p>O seguinte não é suportado:</p> - -<ul> - <li><code>panels.elements</code></li> - <li><code>panels.sources</code></li> - <li><code>panels.setOpenResourceHandler()</code></li> - <li><code>panels.openResource()</code></li> - <li><code>panels.ExtensionPanel.createStatusBarButton()</code></li> - <li><code>panels.Button</code></li> - <li><code>panels.ElementsPanel</code></li> - <li><code>panels.SourcesPanel</code></li> -</ul> - -<h2 id="Exemplos">Exemplos</h2> - -<p>The <a href="https://github.com/mdn/webextensions-examples">webextensions-examples</a> repo on GitHub, contains several examples of extensions that use devtools panels:</p> - -<ul> - <li> - <p><a href="https://github.com/mdn/webextensions-examples/blob/master/devtools-panels/">devtools-panels</a> utiliza painéis de <em>devtools</em>:</p> - </li> -</ul> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/index.html b/files/pt-pt/mozilla/add-ons/webextensions/index.html deleted file mode 100644 index 4c894e2cf1..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/index.html +++ /dev/null @@ -1,135 +0,0 @@ ---- -title: Extensões de Navegador -slug: Mozilla/Add-ons/WebExtensions -tags: - - Extensões da Web - - Extras - - Landing -translation_of: Mozilla/Add-ons/WebExtensions ---- -<div>{{AddonSidebar}}</div> - -<p>As extensões podem ampliar e modificar a capacidade de um navegador. As extensões para Firefox são criadas utilizando a API de WebExtensions, um sistema de navegador cruzado para desenvolver extensões. Em grande medida, o sistema é compatível com a <a class="external-icon external" href="https://developer.chrome.com/extensions">API de extensão</a> suportada pelo Google Chrome, Opera e <a href="https://browserext.github.io/browserext/">W3C Draft Community Group</a>.</p> - -<p>As extensões escritas para estes navegadores irão na maioria dos casos ser executadas no Firefox ou <a href="https://docs.microsoft.com/pt-pt/microsoft-edge/extensions">Microsoft Edge</a> com <a href="/pt-PT/Add-ons/WebExtensions/Trasnsferir_extensao_Google_Chrome">apenas algumas alterações</a>. A API também é totalmente compatível com <a href="/pt-PT/Firefox/Multiprocess_Firefox">os multiprocessos do Firefox</a>.</p> - -<p>Se tiver ideias ou questões, ou precisar de ajuda para migrar um extra legado para utilizar as APIs de WebExtensions, pode contactar-nos em <a href="https://mail.mozilla.org/listinfo/dev-addons">lista de discussões dev-addons</a> ou <a href="irc://irc.mozilla.org/webextensions">#webextensions</a> no <a href="https://wiki.mozilla.org/IRC">IRC</a></p> - -<div class="row topicpage-table"> -<div class="section"> -<h2 id="Começar">Começar</h2> - -<ul> - <li><a href="/pt-PT/Add-ons/WebExtensions/O_que_sao_WebExtensions">O que são extensões?</a></li> - <li><a href="/pt-PT/Add-ons/WebExtensions/A_sua_primeira_extensao">A sua primeira extensão</a></li> - <li><a href="/pt-PT/Add-ons/WebExtensions/A_sua_segunda_extensao">A sua seguna extensão</a></li> - <li><a href="/pt-PT/Add-ons/WebExtensions/Anatomia_de_uma_extensao">Anatomia de uma extensã</a>o</li> - <li><a href="/pt-PT/docs/Mozilla/Add-ons/WebExtensions/Exemplos_extensoes">Exemplos de Extensões</a></li> - <li><a href="/pt-PT/docs/Mozilla/Add-ons/WebExtensions/E_a_seguir">E a seguir?</a></li> -</ul> - -<h2 id="Conceitos">Conceitos</h2> - -<ul> - <li><a href="/pt-PT/docs/Mozilla/Add-ons/WebExtensions/API">Resumo da API de JavaScript</a></li> - <li><a href="/pt-PT/docs/Mozilla/Add-ons/WebExtensions/Scripts_Conteudo">Scripts de Conteúdo</a></li> - <li><a href="/en-US/Add-ons/WebExtensions/Match_patterns">Match patterns</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Working_with_files">Working with files</a></li> - <li><a href="/pt-PT/docs/Mozilla/Add-ons/WebExtensions/Internationalization">Internationalização</a> (Tradução)</li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Security_best_practices">Security best practices</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_Security_Policy">Content Security Policy</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_messaging">Native messaging</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Using_the_devtools_APIs">Using the devtools APIs</a></li> - <li><a href="/en-US/Add-ons/WebExtensions/User_experience_best_practices">User experience best practices</a></li> - <li><a href="/en-US/Add-ons/WebExtensions/Native_manifests">Native manifests</a></li> -</ul> - -<h2 id="Interface_do_utilizador">Interface do utilizador</h2> - -<ul> - <li><a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador">Introdução</a></li> - <li><a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/Ação_navegador">Botão da barra de ferramentas do navegador</a></li> - <li><a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/Popups">Botão da barra de ferramentas do navegador com uma janela (<em>popup</em>)</a></li> - <li><a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/Acoes_pagina">Botão da barra de endereço</a></li> - <li><a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/Popups">Botão da barra de endereço com uma janela (<em>popup</em>)</a></li> - <li><a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/Itens_do_menu_de_contexto">Itens do menu de contexto</a></li> - <li><a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/Barras_laterais">Barras laterais</a></li> - <li><a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/Options_pages">Página de opções</a></li> - <li><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Add-ons/WebExtensions/interface_do_utilizador/Paginas_de_extens%C3%A3o">Páginas de extensão</a></li> - <li><a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/Notificacoes">Notificações</a></li> - <li><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Add-ons/WebExtensions/interface_do_utilizador/Omnibox">Sugestões da barra de endereço</a></li> - <li><a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/devtools_panels">Painés das ferramentas de desenvolvimento</a></li> - <li><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Add-ons/WebExtensions/interface_do_utilizador/Estilos_de_navegador">Estilos de navegador</a></li> -</ul> - -<h2 id="Como...">Como...</h2> - -<ul> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Intercept_HTTP_requests">Intercept HTTP requests</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Modify_a_web_page">Modify a web page</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Add_a_button_to_the_toolbar">Add a button to the toolbar</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Implement_a_settings_page">Implement a settings page</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Interact_with_the_clipboard">Interact with the clipboard</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Working_with_the_Tabs_API">Work with the Tabs API</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Work_with_the_Bookmarks_API">Work with the Bookmarks API</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Work_with_the_Cookies_API">Work with the Cookies API</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Work_with_contextual_identities">Work with contextual identities</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Safely_inserting_external_content_into_a_page">Insert external content</a></li> -</ul> - -<ul> -</ul> - -<h2 id="Porting">Porting</h2> - -<ul> - <li><a href="/pt-PT/docs/Mozilla/Add-ons/WebExtensions/Trasnsferir_extensao_Google_Chrome">Conversão de uma extensão do Google Chrome</a></li> - <li><a href="/pt-PT/docs/Mozilla/Add-ons/WebExtensions/Conversao_de_uma_extensao_legada_do_firefox">Conversão de uma extensão legada do Firefox</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Developing_WebExtensions_for_Firefox_for_Android">Developing for Firefox for Android</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Embedded_WebExtensions">Embedded WebExtensions</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Comparison_with_the_Add-on_SDK">Comparison with the Add-on SDK</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Comparison_with_XUL_XPCOM_extensions">Comparison with XUL/XPCOM extensions</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Chrome_incompatibilities">Chrome incompatibilities</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Differences_between_desktop_and_Android">Differences between desktop and Android</a></li> -</ul> - -<h2 id="Fluxo_de_trabalho_do_Firefox">Fluxo de trabalho do Firefox</h2> - -<ul> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/User_experience_best_practices">User experience</a></li> - <li><a href="/en-US/Add-ons/WebExtensions/Temporary_Installation_in_Firefox">Installation</a></li> - <li><a href="/en-US/Add-ons/WebExtensions/Debugging">Debugging</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Testing_persistent_and_restart_features">Testing persistent and restart features</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Getting_started_with_web-ext">Getting started with web-ext</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/web-ext_command_reference">web-ext command reference</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/WebExtensions_and_the_Add-on_ID">Extensions and the Add-on ID</a></li> - <li><a href="/en-US/Add-ons/WebExtensions/Alternative_distribution_options">Alternative distribution options</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Request_the_right_permissions">Request the right permissions</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Sharing_objects_with_page_scripts">Sharing objects with page scripts</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Retiring_your_extension">Retiring your extension</a></li> - <li><a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Tips">Tips and Tricks</a></li> -</ul> -</div> - -<div class="section"> -<h2 id="Referência">Referência</h2> - -<h3 id="APIS_de_JavaScript">APIS de JavaScript</h3> - -<ul> - <li><a href="/pt-PT/Add-ons/WebExtensions/API">Sinopse de API de JavaScript API</a></li> - <li><a href="/pt-PT/Add-ons/WebExtensions/Suporte_navegador_APIs_JavaScript">Tabelas de compatibilidade de navegador para as APIs de JavaScript</a></li> -</ul> - -<div class="twocolumns">{{ ListSubpages ("/en-US/Add-ons/WebExtensions/API") }}</div> - -<h3 id="idManifest_keys>Manifest_keys">id="Manifest_keys">Manifest keys</h3> - -<ul> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json">manifest.json overview</a></li> - <li><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Browser_compatibility_for_manifest.json">Browser compatibility for manifest.json</a></li> -</ul> - -<div class="twocolumns">{{ ListSubpages ("/en-US/Add-ons/WebExtensions/manifest.json") }}</div> -</div> -</div> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/intercept_http_requests/index.html b/files/pt-pt/mozilla/add-ons/webextensions/intercept_http_requests/index.html deleted file mode 100644 index fef2c0534f..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/intercept_http_requests/index.html +++ /dev/null @@ -1,161 +0,0 @@ ---- -title: Interceptar Pedidos HTTP -slug: Mozilla/Add-ons/WebExtensions/Intercept_HTTP_requests -tags: - - Add-ons - - Como-fazer - - Extensões - - ExtensõesWeb -translation_of: Mozilla/Add-ons/WebExtensions/Intercept_HTTP_requests -original_slug: Mozilla/Add-ons/WebExtensions/Interceptar_Pedidos_HTTP ---- -<div>{{AddonSidebar}}</div> - -<p>Para interceptar pedidos HTTP, use a {{WebExtAPIRef("webRequest")}} API. Esta API permite que você adicione ouvintes para várias etapas ao fazer uma solicitação HTTP. Nos ouvintes, você pode:</p> - -<ul> - <li>obter acesso para solicitar cabeçalhos e corpos e cabeçalhos de resposta.</li> - <li>pedidos de cancelamento e redirecionamento</li> - <li>modificar pedidos e cabeçalhos de resposta</li> -</ul> - -<p>Neste articulo nós vamos dar uma olhada a tres usos diferentes para o modulo <code>webRequest</code>:</p> - -<ul> - <li>Logar pedidos URLs quando eles são feitos.</li> - <li>Redirecionar pedidos.</li> - <li>Modificar cabeçalhos de pedidos.</li> -</ul> - -<h2 id="Loggar_pedidos_URLs">Loggar pedidos URLs</h2> - -<p>Crie um diretorio chamado "requests". Nesse diretorio crie um ficheiro chamado "manifest.json" com o seguinte conteudo:</p> - -<pre class="brush: json">{ - "description": "Demonstração webRequests", - "manifest_version": 2, - "name": "webRequest-demo", - "version": "1.0", - - "permissions": [ - "webRequest", - "<all_urls>" - ], - - "background": { - "scripts": ["background.js"] - } -}</pre> - -<p>De seguida, crie um ficheiro chamado "background.js" com o seguinte conteudo:</p> - -<pre class="brush: js">function logURL(requestDetails) { - console.log("A carregar: " + requestDetails.url); -} - -browser.webRequest.onBeforeRequest.addListener( - logURL, - {urls: ["<all_urls>"]} -); - -</pre> - -<p>Here we use {{WebExtAPIRef("webRequest.onBeforeRequest", "onBeforeRequest")}} to call the <code>logURL()</code> function just before starting the request. The <code>logURL()</code> function grabs the URL of the request from the event object and logs it to the browser console. The <code>{urls: ["<all_urls>"]}</code> <a href="/en-US/Add-ons/WebExtensions/Match_patterns">pattern</a> means we will intercept HTTP requests to all URLs.</p> - -<p>To test it out, <a href="/en-US/Add-ons/WebExtensions/Temporary_Installation_in_Firefox">install the extension</a>, <a href="/en-US/docs/Tools/Browser_Console">open the Browser Console</a>, and open some Web pages. In the Browser Console, you should see the URLs for any resources that the browser requests:</p> - -<p>{{EmbedYouTube("X3rMgkRkB1Q")}}</p> - -<h2 id="Redirecting_requests">Redirecting requests</h2> - -<p>Now let's use <code>webRequest</code> to redirect HTTP requests. First, replace manifest.json with this:</p> - -<pre class="brush: json">{ - - "description": "Demonstrating webRequests", - "manifest_version": 2, - "name": "webRequest-demo", - "version": "1.0", - - "permissions": [ - "webRequest", - "webRequestBlocking", - "https://developer.mozilla.org/", - "https://mdn.mozillademos.org/" - ], - - "background": { - "scripts": ["background.js"] - } - -}</pre> - -<p>The only change here is to add the <code>"webRequestBlocking"</code> <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions">permission</a></code>. We need to ask for this extra permission whenever we are actively modifying a request.</p> - -<p>Next, replace "background.js" with this:</p> - -<pre class="brush: js">var pattern = "https://mdn.mozillademos.org/*"; - -function redirect(requestDetails) { - console.log("Redirecting: " + requestDetails.url); - return { - redirectUrl: "https://38.media.tumblr.com/tumblr_ldbj01lZiP1qe0eclo1_500.gif" - }; -} - -browser.webRequest.onBeforeRequest.addListener( - redirect, - {urls:[pattern], types:["image"]}, - ["blocking"] -);</pre> - -<p>Again, we use the {{WebExtAPIRef("webRequest.onBeforeRequest", "onBeforeRequest")}} event listener to run a function just before each request is made. This function will replace the target URL with the <code>redirectUrl</code> specified in the function.</p> - -<p>This time we are not intercepting every request: the <code>{urls:[pattern], types:["image"]}</code> option specifies that we should only intercept requests (1) to URLs residing under "https://mdn.mozillademos.org/" (2) for image resources. See {{WebExtAPIRef("webRequest.RequestFilter")}} for more on this.</p> - -<p>Also note that we're passing an option called <code>"blocking"</code>: we need to pass this whenever we want to modify the request. It makes the listener function block the network request, so the browser waits for the listener to return before continuing. See the {{WebExtAPIRef("webRequest.onBeforeRequest")}} documentation for more on <code>"blocking"</code>.</p> - -<p>To test it out, open a page on MDN that contains a lot of images (for example <a href="https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor">https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor</a>), <a href="/en-US/Add-ons/WebExtensions/Temporary_Installation_in_Firefox#Reloading_a_temporary_add-on">reload the extension</a>, and then reload the MDN page:</p> - -<p>{{EmbedYouTube("ix5RrXGr0wA")}}</p> - -<h2 id="Modifying_request_headers">Modifying request headers</h2> - -<p>Finally we'll use <code>webRequest</code> to modify request headers. In this example we'll modify the "User-Agent" header so the browser identifies itself as Opera 12.16, but only when visiting pages under http://useragentstring.com/".</p> - -<p>The "manifest.json" can stay the same as in the previous example.</p> - -<p>Replace "background.js" with code like this:</p> - -<pre class="brush: js">var targetPage = "http://useragentstring.com/*"; - -var ua = "Opera/9.80 (X11; Linux i686; Ubuntu/14.10) Presto/2.12.388 Version/12.16"; - -function rewriteUserAgentHeader(e) { - for (var header of e.requestHeaders) { - if (header.name.toLowerCase() == "user-agent") { - header.value = ua; - } - } - return {requestHeaders: e.requestHeaders}; -} - -browser.webRequest.onBeforeSendHeaders.addListener( - rewriteUserAgentHeader, - {urls: [targetPage]}, - ["blocking", "requestHeaders"] -);</pre> - -<p>Here we use the {{WebExtAPIRef("webRequest.onBeforeSendHeaders", "onBeforeSendHeaders")}} event listener to run a function just before the request headers are sent.</p> - -<p>The listener function will be called only for requests to URLs matching the <code>targetPage</code> <a href="/en-US/Add-ons/WebExtensions/Match_patterns">pattern</a>. Also note that we've again passed <code>"blocking"</code> as an option. We've also passed <code>"requestHeaders"</code>, which means that the listener will be passed an array containing the request headers that we expect to send. See {{WebExtAPIRef("webRequest.onBeforeSendHeaders")}} for more information on these options.</p> - -<p>The listener function looks for the "User-Agent" header in the array of request headers, replaces its value with the value of the <code>ua</code> variable, and returns the modified array. This modified array will now be sent to the server.</p> - -<p>To test it out, open <a href="http://useragentstring.com/">useragentstring.com</a> and check that it identifies the browser as Firefox. Then reload the extension, reload <a href="http://useragentstring.com/">useragentstring.com</a>, and check that Firefox is now identified as Opera:</p> - -<p>{{EmbedYouTube("SrSNS1-FIx0")}}</p> - -<h2 id="Learn_more">Learn more</h2> - -<p>To learn about all the things you can do with the <code>webRequest</code> API, see its <a href="/en-US/Add-ons/WebExtensions/API/WebRequest">reference documentation</a>.</p> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/internationalization/index.html b/files/pt-pt/mozilla/add-ons/webextensions/internationalization/index.html deleted file mode 100644 index 4892048ba8..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/internationalization/index.html +++ /dev/null @@ -1,417 +0,0 @@ ---- -title: Internationalization -slug: Mozilla/Add-ons/WebExtensions/Internationalization -tags: - - Artigo - - Extensões da Web - - Guía - - Internacionalização - - Localização - - Tradução - - i18n - - mensagens predefinidas - - messages.json - - placeholders - - símbolos -translation_of: Mozilla/Add-ons/WebExtensions/Internationalization ---- -<div>{{AddonSidebar}}</div> - -<p>A API das <a href="/pt-PT/docs/Mozilla/Add-ons/WebExtensions">Extensões da Web</a> tem um módulo bastante útil disponível para a internacionalização das extensões — <a href="/pt-PT/docs/Mozilla/Add-ons/WebExtensions/API/i18n">i18n</a>. Neste artigo, nós iremos explorar as suas funcionaldiades e fornecemos um exemplo prático de como este funciona. O sistema i18n para as extensões criadas utilizando as APIs da Extensão da Web é semelhante às bibliotecas de JavaScript comuns do i18n, tal como <a href="http://i18njs.com/">i18n.js</a>.</p> - -<div class="note"> -<p>The example extension featured in this article — <a href="https://github.com/mdn/webextensions-examples/tree/master/notify-link-clicks-i18n">notify-link-clicks-i18n</a> — is available on GitHub. Follow along with the source code as you go through the sections below.</p> -</div> - -<h2 id="Anatomia_de_uma_extensão_internacionalizada">Anatomia de uma extensão internacionalizada</h2> - -<p>An internationalized extension can contain the same features as any other extension — <a href="/en-US/Add-ons/WebExtensions/Anatomy_of_a_WebExtension#Background_scripts">background scripts</a>, <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_scripts">content scripts</a>, etc. — but it also has some extra parts to allow it to switch between different locales. These are summarized in the following directory tree:</p> - -<ul class="directory-tree"> - <li>extension-root-directory/ - <ul> - <li>_locales - <ul> - <li>en - <ul> - <li>messages.json - <ul> - <li>English messages (strings)</li> - </ul> - </li> - </ul> - </li> - <li>de - <ul> - <li>messages.json - <ul> - <li>German messages (strings)</li> - </ul> - </li> - </ul> - </li> - <li>etc.</li> - </ul> - </li> - <li>manifest.json - <ul> - <li>locale-dependent metadata</li> - </ul> - </li> - <li>myJavascript.js - <ul> - <li>JavaScript for retrieving browser locale, locale-specific messages, etc.</li> - </ul> - </li> - <li>myStyles.css - <ul> - <li>locale-dependent CSS</li> - </ul> - </li> - </ul> - </li> -</ul> - -<p>Let's explore each of the new features in turn — each of the below sections represents a step to follow when internationalizing your extension.</p> - -<h2 id="Fornecer_strings_traduzidas_em__locales">Fornecer <em>strings</em> traduzidas em _locales</h2> - -<div class="pull-aside"> -<div class="moreinfo">You can look up language subtags using the <em>Find</em> tool on the <a href="https://r12a.github.io/app-subtags/">Language subtag lookup page</a>. Note that you need to search for the English name of the language.</div> -</div> - -<p>Every i18n system requires the provision of strings translated into all the different locales you want to support. In extensions, these are contained within a directory called <code>_locales</code>, placed inside the extension root. Each individual locale has its strings (referred to as messages) contained within a file called <code>messages.json</code>, which is placed inside a subdirectory of <code>_locales</code>, named using the language subtag for that locale's language.</p> - -<p>Note that if the subtag includes a basic language plus a regional variant, then the language and variant are conventionally separated using a hyphen: for example, "en-US". However, in the directories under <code>_locales</code>, <strong>the separator must be an underscore</strong>: "en_US".</p> - -<p>So <a href="https://github.com/mdn/webextensions-examples/tree/master/notify-link-clicks-i18n/_locales">for example, in our sample app</a> we have directories for "en" (English), "de" (German), "nl" (Dutch), and "ja" (Japanese). Each one of these has a <code>messages.json</code> file inside it.</p> - -<p>Let's now look at the structure of one of these files (<a href="https://github.com/mdn/webextensions-examples/blob/master/notify-link-clicks-i18n/_locales/en/messages.json">_locales/en/messages.json</a>):</p> - -<pre class="brush: json">{ - "extensionName": { - "message": "Notify link clicks i18n", - "description": "Name of the extension." - }, - - "extensionDescription": { - "message": "Shows a notification when the user clicks on links.", - "description": "Description of the extension." - }, - - "notificationTitle": { - "message": "Click notification", - "description": "Title of the click notification." - }, - - "notificationContent": { - "message": "You clicked $URL$.", - "description": "Tells the user which link they clicked.", - "placeholders": { - "url" : { - "content" : "$1", - "example" : "https://developer.mozilla.org" - } - } - } -}</pre> - -<p>This file is standard JSON — each one of its members is an object with a name, which contains a <code>message</code> and a <code>description</code>. All of these items are strings; <code>$URL$</code> is a placeholder, which is replaced with a substring at the time the <code>notificationContent</code> member is called by the extension. You'll learn how to do this in the {{anch("Retrieving message strings from JavaScript")}} section.</p> - -<div class="note"> -<p><strong>Note</strong>: You can find much more information about the contents of <code>messages.json</code> files in our <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/i18n/Locale-Specific_Message_reference">Locale-Specific Message reference</a>.</p> -</div> - -<h2 id="Internacionalizar_manifest.json">Internacionalizar manifest.json</h2> - -<p>There are a couple of different tasks to carry out to internationalize your manifest.json.</p> - -<h3 id="Obter_as_strings_traduzidas_em_manifests">Obter as <em>strings</em> traduzidas em <em>manifests</em></h3> - -<p>Your <a href="https://github.com/mdn/webextensions-examples/blob/master/notify-link-clicks-i18n/manifest.json">manifest.json</a> includes strings that are displayed to the user, such as the extension's name and description. If you internationalize these strings and put the appropriate translations of them in messages.json, then the correct translation of the string will be displayed to the user, based on the current locale, like so.</p> - -<p>To internationalize strings, specify them like this:</p> - -<pre class="brush: json">"name": "__MSG_extensionName__", -"description": "__MSG_extensionDescription__",</pre> - -<p>Here, we are retrieving message strings dependant on the browser's locale, rather than just including static strings.</p> - -<p>To call a message string like this, you need to specify it like this:</p> - -<ol> - <li>Two underscores, followed by</li> - <li>The string "MSG", followed by</li> - <li>One underscore, followed by</li> - <li>The name of the message you want to call as defined in <code>messages.json</code>, followed by</li> - <li>Two underscores</li> -</ol> - -<pre><strong>__MSG_</strong> + <em>messageName</em> + <strong>__</strong></pre> - -<h3 id="Especificar_uma_locale_predefinida">Especificar uma <em>locale</em> predefinida</h3> - -<p>Another field you should specify in your manifest.json is <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/default_locale">default_locale</a>:</p> - -<pre class="brush: json">"default_locale": "en"</pre> - -<p>This specifies a default locale to use if the extension doesn't include a localized string for the browser's current locale. Any message strings that are not available in the browser locale are taken from the default locale instead. There are some more details to be aware of in terms of how the browser selects strings — see {{anch("Localized string selection")}}.</p> - -<h2 id="Locale-dependent_CSS">Locale-dependent CSS</h2> - -<p>Note that you can also retrieve localized strings from CSS files in the extension. For example, you might want to construct a locale-dependent CSS rule, like this:</p> - -<pre class="brush: css">header { - background-image: url(../images/__MSG_extensionName__/header.png); -}</pre> - -<p>This is useful, although you might be better off handling such a situation using {{anch("Predefined messages")}}.</p> - -<h2 id="Obter_strings_a_partir_de_JavaScript">Obter <em>strings</em> a partir de JavaScript</h2> - -<p>So, you've got your message strings set up, and your manifest. Now you just need to start calling your message strings from JavaScript so your extension can talk the right language as much as possible. The actual <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/i18n">i18n API</a> is pretty simple, containing just four main methods:</p> - -<ul> - <li>You'll probably use {{WebExtAPIRef("i18n.getMessage()")}} most often — this is the method you use to retrieve a specific language string, as mentioned above. We'll see specific usage examples of this below.</li> - <li>The {{WebExtAPIRef("i18n.getAcceptLanguages()")}} and {{WebExtAPIRef("i18n.getUILanguage()")}} methods could be used if you needed to customize the UI depending on the locale — perhaps you might want to show preferences specific to the users' preferred languages higher up in a prefs list, or display cultural information relevant only to a certain language, or format displayed dates appropriately according to the browser locale.</li> - <li>The {{WebExtAPIRef("i18n.detectLanguage()")}} method could be used to detect the language of user-submitted content, and format it appropriately.</li> -</ul> - -<p>In our <a href="https://github.com/mdn/webextensions-examples/tree/master/notify-link-clicks-i18n">notify-link-clicks-i18n</a> example, the<a href="https://github.com/mdn/webextensions-examples/blob/master/notify-link-clicks-i18n/background-script.js"> background script</a> contains the following lines:</p> - -<pre class="brush: js">var title = browser.i18n.getMessage("notificationTitle"); -var content = browser.i18n.getMessage("notificationContent", message.url);</pre> - -<p>The first one just retrieves the <code>notificationTitle message</code> field from the available <code>messages.json</code> file most appropriate for the browser's current locale. The second one is similar, but it is being passed a URL as a second parameter. What gives? This is how you specify the content to replace the <code>$URL$</code> placeholder we see in the <code>notificationContent message</code> field:</p> - -<pre class="brush: json">"notificationContent": { - "message": "You clicked $URL$.", - "description": "Tells the user which link they clicked.", - "placeholders": { - "url" : { - "content" : "$1", - "example" : "https://developer.mozilla.org" - } - } -} -</pre> - -<p>The <code>"placeholders"</code> member defines all the placeholders, and where they are retrieved from. The <code>"url"</code> placeholder specifies that its content is taken from $1, which is the first value given inside the second parameter of <code>getMessage()</code>. Since the placeholder is called <code>"url"</code>, we use <code>$URL$</code> to call it inside the actual message string (so for <code>"name"</code> you'd use <code>$NAME$</code>, etc.) If you have multiple placeholders, you can provide them inside an array that is given to {{WebExtAPIRef("i18n.getMessage()")}} as the second parameter — <code>[a, b, c]</code> will be available as <code>$1</code>, <code>$2</code>, and <code>$3</code>, and so on, inside <code>messages.json</code>.</p> - -<p>Let's run through an example: the original <code>notificationContent</code> message string in the <code>en/messages.json</code> file is</p> - -<pre>You clicked $URL$.</pre> - -<p>Let's say the link clicked on points to <code>https://developer.mozilla.org</code>. After the {{WebExtAPIRef("i18n.getMessage()")}} call, the contents of the second parameter are made available in messages.json as <code>$1</code>, which replaces the <code>$URL$</code> placeholder as defined in the <code>"url"</code> placeholder. So the final message string is</p> - -<pre>You clicked https://developer.mozilla.org.</pre> - -<h3 id="Direct_placeholder_usage">Direct placeholder usage</h3> - -<p>It is possible to insert your variables (<code>$1</code>, <code>$2</code>, <code>$3</code>, etc.) directly into the message strings, for example we could rewrite the above <code>"notificationContent"</code> member like this:</p> - -<pre class="brush: json">"notificationContent": { - "message": "You clicked $1.", - "description": "Tells the user which link they clicked." -}</pre> - -<p>This may seem quicker and less complex, but the other way (using <code>"placeholders"</code>) is seen as best practice. This is because having the placeholder name (e.g. <code>"url"</code>) and example helps you to remember what the placeholder is for — a week after you write your code, you'll probably forget what <code>$1</code>–<code>$8</code> refer to, but you'll be more likely to know what your placeholder names refer to.</p> - -<h3 id="Hardcoded_substitution">Hardcoded substitution</h3> - -<p>It is also possible to include hardcoded strings in placeholders, so that the same value is used every time, instead of getting the value from a variable in your code. For example:</p> - -<pre class="brush: json">"mdn_banner": { - "message": "For more information on web technologies, go to $MDN$.", - "description": "Tell the user about MDN", - "placeholders": { - "mdn": { - "content": "https://developer.mozilla.org/" - } - } -}</pre> - -<p>In this case we are just hardcoding the placeholder content, rather than getting it from a variable value like <code>$1</code>. This can sometimes be useful when your message file is very complex, and you want to split up different values to make the strings more readable in the file, plus then these values could be accessed programmatically.</p> - -<p>In addition, you can use such substitutions to specify parts of the string that you don't want to be translated, such as person or business names.</p> - -<h2 id="Seleção_de_string_traduzida">Seleção de string traduzida</h2> - -<p>Locales can be specified using only a language code, like <code>fr</code> or <code>en</code>, or they may be further qualified with a region code, like <code>en_US</code> or <code>en_GB</code>, which describes a regional variant of the same basic language. When you ask the i18n system for a string, it will select a string using the following algorithm:</p> - -<ol> - <li>if there is a <code>messages.json</code> file for the exact current locale, and it contains the string, return it.</li> - <li>Otherwise, if the current locale is qualified with a region (e.g. <code>en_US</code>) and there is a <code>messages.json</code> file for the regionless version of that locale (e.g. <code>en</code>), and that file contains the string, return it.</li> - <li>Otherwise, if there is a <code>messages.json</code> file for the <code>default_locale</code> defined in the <code>manifest.json</code>, and it contains the string, return it.</li> - <li>Otherwise return an empty string.</li> -</ol> - -<p>Take the following example:</p> - -<ul class="directory-tree"> - <li>extension-root-directory/ - <ul> - <li>_locales - <ul> - <li>en_GB - <ul> - <li>messages.json - <ul> - <li><code>{ "colorLocalised": { "message": "colour", "description": "Color." }, ... }</code></li> - </ul> - </li> - </ul> - en - - <ul> - <li>messages.json - <ul> - <li><code>{ "colorLocalised": { "message": "color", "description": "Color." }, ... }</code></li> - </ul> - </li> - </ul> - </li> - <li>fr - <ul> - <li>messages.json - <ul> - <li><code>{ "colorLocalised": { "message": "<span lang="fr">couleur</span>", "description": "Color." }, ...}</code></li> - </ul> - </li> - </ul> - </li> - </ul> - </li> - </ul> - </li> -</ul> - -<p>Suppose the <code>default_locale</code> is set to <code>fr</code>, and the browser's current locale is <code>en_GB</code>:</p> - -<ul> - <li>If the extension calls <code>getMessage("colorLocalised")</code>, it will return "colour".</li> - <li>If "colorLocalised" were not present in <code>en_GB</code>, then <code>getMessage("colorLocalised")</code>, would return "color", not "couleur".</li> -</ul> - -<h2 id="Mensagens_predefinidas">Mensagens predefinidas</h2> - -<p>The i18n module provides us with some predefined messages, which we can call in the same way as we saw earlier in {{anch("Calling message strings from manifests and extension CSS")}}. For example:</p> - -<pre>__MSG_extensionName__</pre> - -<p>Predefined messages use exactly the same syntax, except with <code>@@</code> before the message name, for example</p> - -<pre>__MSG_@@ui_locale__</pre> - -<p>The following table shows the different available predefined messages:</p> - -<table class="standard-table"> - <thead> - <tr> - <th scope="col">Nome da mensagem</th> - <th scope="col">Descrição</th> - </tr> - </thead> - <tbody> - <tr> - <td><code>@@extension_id</code></td> - <td> - <p>The extension's internally-generated UUID. You might use this string to construct URLs for resources inside the extension. Even unlocalized extensions can use this message.</p> - - <p>You can't use this message in a manifest file.</p> - - <p>Also note that this ID is <em>not</em> the add-on ID returned by {{WebExtAPIRef("runtime.id")}}, and that can be set using the <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/applications">applications</a> key in manifest.json. It's the generated UUID that appears in the add-on's URL. This means that you can't use this value as the <code>extensionId</code> parameter to {{WebExtAPIRef("runtime.sendMessage()")}}, and can't use it to check against the <code>id</code> property of a {{WebExtAPIRef("runtime.MessageSender")}} object.</p> - </td> - </tr> - <tr> - <td><code>@@ui_locale</code></td> - <td>The current locale; you might use this string to construct locale-specific URLs.</td> - </tr> - <tr> - <td><code>@@bidi_dir</code></td> - <td>The text direction for the current locale, either "ltr" for left-to-right languages such as English or "rtl" for right-to-left languages such as Arabic.</td> - </tr> - <tr> - <td><code>@@bidi_reversed_dir</code></td> - <td>If the <code>@@bidi_dir</code> is "ltr", then this is "rtl"; otherwise, it's "ltr".</td> - </tr> - <tr> - <td><code>@@bidi_start_edge</code></td> - <td>If the <code>@@bidi_dir</code> is "ltr", then this is "left"; otherwise, it's "right".</td> - </tr> - <tr> - <td><code>@@bidi_end_edge</code></td> - <td>If the <code>@@bidi_dir</code> is "ltr", then this is "right"; otherwise, it's "left".</td> - </tr> - </tbody> -</table> - -<p>Going back to our earlier example, it would make more sense to write it like this:</p> - -<pre class="brush: css">header { - background-image: url(../images/__MSG_@@ui_locale__/header.png); -}</pre> - -<p>Now we can just store our local specific images in directories that match the different locales we are supporting — en, de, etc. — which makes a lot more sense.</p> - -<p>Let's look at an example of using <code>@@bidi_*</code> messages in a CSS file:</p> - -<pre class="brush: css">body { - direction: __MSG_@@bidi_dir__; -} - -div#header { - margin-bottom: 1.05em; - overflow: hidden; - padding-bottom: 1.5em; - padding-__MSG_@@bidi_start_edge__: 0; - padding-__MSG_@@bidi_end_edge__: 1.5em; - position: relative; -}</pre> - -<p>For left-to-right languages such as English, the CSS declarations involving the predefined messages above would translate to the following final code lines:</p> - -<pre class="brush: css">direction: ltr; -padding-left: 0; -padding-right: 1.5em; -</pre> - -<p>For a right-to-left language like Arabic, you'd get:</p> - -<pre class="brush: css">direction: rtl; -padding-right: 0; -padding-left: 1.5em;</pre> - -<h2 id="Testar_a_sua_extensão">Testar a sua extensão</h2> - -<p>Starting in Firefox 45, you can install extensions temporarily from disk — see <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Packaging_and_installation#Loading_from_disk">Loading from disk</a>. Do this, and then try testing out our <a href="https://github.com/mdn/webextensions-examples/tree/master/notify-link-clicks-i18n">notify-link-clicks-i18n</a> extension. Go to one of your favourite websites and click a link to see if a notification appears reporting the URL of the clicked link.</p> - -<p>Next, change Firefox's locale to one supported in the extension that you want to test.</p> - -<ol> - <li>Open "about:config" in Firefox, and search for the <code>intl.locale.requested</code> preference (bear in mind that before Firefox 59, this pref is called <code>general.useragent.locale</code>).</li> - <li>If the preference exists, double-click it (or press Return/Enter) to select it, enter the language code for the locale you want to test, then click "OK" (or press Return/Enter). For example in our example extension, "en" (English), "de" (German), "nl" (Dutch), and "ja" (Japanese) are supported. You can also set the value to an empty string (<code>""</code>), which will cause the browser to use the OS default locale.</li> - <li>If the <code>intl.locale.requested</code> preference does not exist, right-click the list of preferences (or activate the context menu using the keyboard), and choose "New" followed by "String". Enter <code>intl.locale.requested</code> for the preference name and, "de", or "nl", etc. for the preference value, as described in step 2 above.</li> - <li>Search for <code>intl.locale.matchOS</code> and, if the preference exists and has the value <code>true</code>, double-click it so that it is set to <code>false</code>.</li> - <li>Restart your browser to complete the change.</li> -</ol> - -<div class="note"> -<p><strong>Nota</strong>: This works to change the browser's locale, even if you haven't got the <a href="https://addons.mozilla.org/en-US/firefox/language-tools/">language pack</a> installed for that language. You'll just get the browser UI in your default language if this is the case.</p> -</div> - -<ol> -</ol> - -<div class="note"> -<p><strong>Nota:</strong> To change the result of <code>getUILanguage</code> the language pack is required, since it reflects the browser UI language and not the language used for extension messages.</p> -</div> - -<p>Load the extension temporarily from disk again, then test your new locale:</p> - -<ul> - <li>Visit "about:addons" again — you should now see the extension listed, with its icon, plus name and description in the chosen language.</li> - <li>Test your extension again. In our example, you'd go to another website and click a link, to see if the notification now appears in the chosen language.</li> -</ul> - -<p>{{EmbedYouTube("R7--fp5pPGg")}}</p> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/manifest.json/browser_action/index.html b/files/pt-pt/mozilla/add-ons/webextensions/manifest.json/browser_action/index.html deleted file mode 100644 index 41b720af8b..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/manifest.json/browser_action/index.html +++ /dev/null @@ -1,236 +0,0 @@ ---- -title: browser_action -slug: Mozilla/Add-ons/WebExtensions/manifest.json/browser_action -tags: - - Extensões - - Extensões da Web - - Extras -translation_of: Mozilla/Add-ons/WebExtensions/manifest.json/browser_action ---- -<div>{{AddonSidebar}}</div> - -<table class="fullwidth-table standard-table"> - <tbody> - <tr> - <th scope="row" style="width: 30%;">Tipo</th> - <td><code>Objeto</code></td> - </tr> - <tr> - <th scope="row">Obrigatório</th> - <td>Não</td> - </tr> - <tr> - <th scope="row">Exemplo</th> - <td> - <pre class="brush: json no-line-numbers"> -"browser_action": { - "browser_style": true, - "default_icon": { - "16": "button/geo-16.png", - "32": "button/geo-32.png" - }, - "default_title": "Whereami?", - "default_popup": "popup/geo.html", - "theme_icons": [{ - "light": "icons/geo-32-light.png", - "dark": "icons/geo-32.png", - "size": 32 - }] -}</pre> - </td> - </tr> - </tbody> -</table> - -<p>A browser action is a button that your extension adds to the browser's toolbar. The button has an icon, and may optionally have a popup whose content is specified using HTML, CSS, and JavaScript.</p> - -<p>If you supply a popup, then the popup is opened when the user clicks the button, and your JavaScript running in the popup can handle the user's interaction with it. If you don't supply a popup, then a click event is dispatched to your extension's <a href="/en-US/Add-ons/WebExtensions/Anatomy_of_a_WebExtension#Background_scripts">background scripts</a> when the user clicks the button.</p> - -<p>You can also create and manipulate browser actions programmatically using the <a href="/en-US/Add-ons/WebExtensions/API/browserAction">browserAction API</a>.</p> - -<h2 id="Sintaxe">Sintaxe</h2> - -<p>The <code>browser_action</code> key is an object that may have any of the following properties, all optional:</p> - -<table class="fullwidth-table standard-table"> - <thead> - <tr> - <th scope="col">Nome</th> - <th scope="col">Tipo</th> - <th scope="col">Descrição</th> - </tr> - </thead> - <tbody> - <tr> - <td><code>browser_style</code></td> - <td><code>Booliano</code></td> - <td> - <div class="geckoVersionNote">Novo no Firefox 48</div> - - <p>Optional, defaulting to <code>false</code>.</p> - - <p>Use this to include a stylesheet in your popup that will make it look consistent with the browser's UI and with other extensions that use the <code>browser_style</code> property. Although this key defaults to <code>false</code>, it's recommended that you include it and set it to <code>true</code>.</p> - - <p>In Firefox, the stylesheet can be seen at chrome://browser/content/extension.css, or chrome://browser/content/extension-mac.css on OS X.</p> - - <p>The <a href="https://firefoxux.github.io/StyleGuide/#/controls">Firefox Style Guide</a> describes the classes you can apply to elements in the popup in order to get particular styles.</p> - - <p>The <a href="https://github.com/mdn/webextensions-examples/tree/master/latest-download">latest-download</a> example extension uses <code>browser_style</code> in its popup.</p> - </td> - </tr> - <tr> - <td><code>default_area</code></td> - <td><code>String</code></td> - <td> - <div class="geckoVersionNote">Novo no Firefox 54</div> - - <p>Defines the part of the browser in which the button is initially placed. This is a string that may take one of four values:</p> - - <ul> - <li>"navbar": the button is placed in the main browser toolbar, alongside the URL bar.</li> - <li>"menupanel": the button is placed in a popup panel.</li> - <li>"tabstrip": the button is placed in the toolbar that contains browser tabs.</li> - <li>"personaltoolbar": the button is placed in the bookmarks toolbar.</li> - </ul> - - <p>This property is only supported in Firefox.</p> - - <p>This property is optional, and defaults to "navbar".</p> - - <p>An extension can't change the location of the button after it has been installed, but the user may be able to move the button using the browser's built-in UI customization mechanism.</p> - </td> - </tr> - <tr> - <td><code>default_icon</code></td> - <td><code>Object</code> or <code>String</code></td> - <td> - <p>Use this to specify one or more icons for the browser action. The icon is shown in the browser toolbar by default.</p> - - <p>Icons are specified as URLs relative to the manifest.json file itself.</p> - - <p>You can specify a single icon file by supplying a string here:</p> - - <pre class="brush: json no-line-numbers"> -"default_icon": "path/to/geo.svg"</pre> - - <p>To specify multiple icons in different sizes, specify an object here. The name of each property is the icon's height in pixels, and must be convertible to an integer. The value is the URL. For example:</p> - - <pre class="brush: json no-line-numbers"> - "default_icon": { - "16": "path/to/geo-16.png", - "32": "path/to/geo-32.png" - }</pre> - - <p>See <a href="/en-US/Add-ons/WebExtensions/manifest.json/browser_action#Choosing_icon_sizes">Choosing icon sizes</a> for more guidance on this.</p> - </td> - </tr> - <tr> - <td><code>default_popup</code></td> - <td><code>String</code></td> - <td> - <p>The path to an HTML file containing the specification of the popup.</p> - - <p>The HTML file may include CSS and JavaScript files using <code><a href="/en-US/docs/Web/HTML/Element/link"><link></a></code> and <code><a href="/en-US/docs/Web/HTML/Element/script"><script></a></code> elements, just like a normal web page.</p> - - <p>Unlike a normal web page, JavaScript running in the popup can access all the <a href="/en-US/Add-ons/WebExtensions/API">WebExtension APIs</a> (subject, of course, to the extension having the appropriate <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions">permissions</a>).</p> - - <p>This is a <a href="/en-US/Add-ons/WebExtensions/Internationalization#Internationalizing_manifest.json">localizable property</a>.</p> - </td> - </tr> - <tr> - <td><code>default_title</code></td> - <td><code>String</code></td> - <td> - <p>Tooltip for the button, displayed when the user moves their mouse over it. If the button is added to the browser's menu panel, this is also shown under the app icon.</p> - - <p>This is a <a href="/en-US/Add-ons/WebExtensions/Internationalization#Internationalizing_manifest.json">localizable property</a>.</p> - </td> - </tr> - <tr> - <td><code>theme_icons</code></td> - <td><code>Array</code></td> - <td> - <p>This property enables you to specify different icons for dark and light themes.</p> - - <p>If this property is present, it's an array containing at least one <code>ThemeIcons</code> object. A <code>ThemeIcons</code> object contains three properties, all mandatory:</p> - - <dl> - <dt><code>"dark"</code></dt> - <dd>A URL pointing to an icon. This icon will be selected when themes with dark text are active (e.g. Firefox's Light theme, and the Default theme if no default_icon is specified).</dd> - <dt><code>"light"</code></dt> - <dd>A URL pointing to an icon. This icon will be selected when themes with light text are active (e.g. Firefox's Dark theme).</dd> - <dt><code>"size"</code></dt> - <dd>The size of the two icons in pixels.</dd> - </dl> - - <p>Icons are specified as URLs relative to the manifest.json file itself.</p> - - <p>Providing multiple <code>ThemeIcons</code> objects enables you to supply a set of icon pairs in different sizes.</p> - </td> - </tr> - </tbody> -</table> - -<h2 id="Escolher_os_tamanhos_do_ícone">Escolher os tamanhos do ícone</h2> - -<p>The browser action's icon may need to be displayed in different sizes in different contexts:</p> - -<ul> - <li>The icon is displayed by default in the browser toolbar, but the user can move it into the browser's menu panel (the panel that opens when the user clicks the "hamburger" icon). The icon in the toolbar is smaller than the icon in the menu panel.</li> - <li>On a high-density display like a Retina screen, icons needs to be twice as big.</li> -</ul> - -<p>If the browser can't find an icon of the right size in a given situation, it will pick the best match and scale it. Scaling may make the icon appear blurry, so it's important to choose icon sizes carefully.</p> - -<p>There are two main approaches to this. You can supply a single icon as an SVG file, and it will be scaled correctly:</p> - -<pre class="brush: json no-line-numbers">"default_icon": "path/to/geo.svg"</pre> - -<p>Alternatively, you can supply several icons in different sizes, and the browser will pick the best match.</p> - -<p>In Firefox:</p> - -<ul> - <li>The default height and width for icons in the toolbar is 16 * <code><a href="/en-US/docs/Web/API/Window/devicePixelRatio">window.devicePixelRatio</a></code>.</li> - <li>The default height and width for icons in the menu panel is 32 * <code><a href="/en-US/docs/Web/API/Window/devicePixelRatio">window.devicePixelRatio</a></code>.</li> -</ul> - -<p>So you can specify icons that match exactly, on both normal and Retina displays, by supplying three icon files, and specifying them like this:</p> - -<pre class="brush: json no-line-numbers"> "default_icon": { - "16": "path/to/geo-16.png", - "32": "path/to/geo-32.png", - "64": "path/to/geo-64.png" - }</pre> - -<p>If Firefox can't find an exact match for the size it wants, then it will pick the smallest icon specified that's bigger than the ideal size. If all icons are smaller than the ideal size, it will pick the biggest icon specified.</p> - -<h2 id="Exemplo">Exemplo</h2> - -<pre class="brush: json no-line-numbers">"browser_action": { - "default_icon": { - "16": "button/geo-16.png", - "32": "button/geo-32.png" - } -}</pre> - -<p>A browser action with just an icon, specified in 2 different sizes. The extension's background scripts can receive click events when the user clicks the icon using code like this:</p> - -<pre class="brush: js no-line-numbers"> browser.browserAction.onClicked.addListener(handleClick);</pre> - -<pre class="brush: json">"browser_action": { - "default_icon": { - "16": "button/geo-16.png", - "32": "button/geo-32.png" - }, - "default_title": "Whereami?", - "default_popup": "popup/geo.html" -}</pre> - -<p>A browser action with an icon, a title, and a popup. The popup will be shown when the user clicks the button.</p> - -<p>For a simple, but complete, extension that uses a browser action, see the <a href="/en-US/Add-ons/WebExtensions/Your_second_WebExtension">walkthrough tutorial</a>.</p> - -<h2 id="Compatibilidade_de_navegador">Compatibilidade de navegador</h2> - -<p>{{Compat("webextensions.manifest.browser_action", 10)}}</p> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/manifest.json/browser_specific_settings/index.html b/files/pt-pt/mozilla/add-ons/webextensions/manifest.json/browser_specific_settings/index.html deleted file mode 100644 index 3d52790362..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/manifest.json/browser_specific_settings/index.html +++ /dev/null @@ -1,107 +0,0 @@ ---- -title: applications -slug: Mozilla/Add-ons/WebExtensions/manifest.json/browser_specific_settings -tags: - - Extensões - - Extensões da Web - - Extras -translation_of: Mozilla/Add-ons/WebExtensions/manifest.json/browser_specific_settings ---- -<div>{{AddonSidebar}}</div> - -<table class="fullwidth-table standard-table"> - <tbody> - <tr> - <th scope="row" style="width: 30%;">Tipo</th> - <td><code>Object</code></td> - </tr> - <tr> - <th scope="row">Obrigatório</th> - <td>Usually, no (but see also <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/WebExtensions_and_the_Add-on_ID#When_do_you_need_an_add-on_ID">When do you need an Add-on ID?</a>). Mandatory before Firefox 48 (desktop) and Firefox for Android.</td> - </tr> - <tr> - <th scope="row">Exemplo</th> - <td> - <pre class="brush: json no-line-numbers"> -"applications": { - "gecko": { - "id": "addon@example.com", - "strict_min_version": "42.0" - } -}</pre> - </td> - </tr> - </tbody> -</table> - -<h2 id="Descrição">Descrição</h2> - -<p>A chave <code>applications</code> contém chaves que são especificas de uma <em>application</em> de um anfitrião em particular.</p> - -<h3 id="Propriedadee_(Gecko)_do_Firefox">Propriedadee (Gecko) do Firefox</h3> - -<p>Currently this contains just one key, <code>gecko</code>, which may contain four string attributes:</p> - -<ul> - <li><code>id</code> is the extension ID. Optional from Firefox 48, mandatory before Firefox 48. See <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/WebExtensions_and_the_Add-on_ID">Extensions and the Add-on ID</a> to see when you need to specify an add-on ID.</li> - <li><code>strict_min_version</code>: minimum version of Gecko to support. Versions containing a "*" are not valid in this field. Defaults to "42a1".</li> - <li><code>strict_max_version</code>: maximum version of Gecko to support. If the Firefox version on which the extension is being installed or run is above this version, then the extension will be disabled, or not permitted to be installed. Defaults to "*", which disables checking for a maximum version.</li> - <li><code>update_url</code> is a link to an <a href="/en-US/Add-ons/Updates">extension update manifest</a>. Note that the link must begin with "https". This key is for managing extension updates yourself (i.e. not through AMO).</li> -</ul> - -<p>Consulte a lista das <a href="https://addons.mozilla.org/pt-PT/firefox/pages/appversions/">versões válidas de Gecko</a>.</p> - -<h4 id="Formato_da_Id._da_Extensão">Formato da Id. da Extensão</h4> - -<p>A Id. da extensão deve ser uma das seguintes:</p> - -<ul> - <li><a href="https://en.wikipedia.org/wiki/Universally_unique_identifier" title="Generating_GUIDs">GUID</a></li> - <li>A string formatted like an email address: <code class="plain">extensionname@example.org</code></li> -</ul> - -<p>The latter format is easier to generate and manipulate. Be aware that using a real email address here may attract spam.</p> - -<p>Por exemplo:</p> - -<pre class="brush:json;auto-links:false no-line-numbers">"id": "extensionname@example.org", - -"id": "{daf44bf7-a45e-4450-979c-91cf07434c3d}"</pre> - -<h3 id="Propriedades_do_Microsoft_Edge">Propriedades do Microsoft Edge</h3> - -<p>Microsoft Edge stores its browser specific settings in the <code>edge</code> subkey, which has the following properties:</p> - -<dl> - <dt><code>browser_action_next_to_addressbar</code></dt> - <dd> - <p>Boolean property which controls the placement of the <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Browser_actions">browser action</a>.</p> - - <ul> - <li><code>true</code> is equivalent to setting <code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_action#Syntax">browser_action.default_area</a></code> to <code>navbar</code>.</li> - <li><code>false</code> is equivalent to setting <code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_action#Syntax">browser_action.default_area</a></code> to <code>menupanel</code>.</li> - </ul> - </dd> -</dl> - -<h2 id="Exemplos">Exemplos</h2> - -<p>Example with all possible keys. Note that most extensions will omit <code>strict_max_version</code> and <code>update_url</code>.</p> - -<pre class="brush: json no-line-numbers">"applications": { - "gecko": { - "id": "addon@example.com", - "strict_min_version": "42.0", - "strict_max_version": "50.*", - "update_url": "https://example.com/updates.json" - }, - "edge": { - <code>"browser_action_next_to_addressbar": true</code> - } -}</pre> - -<h2 id="Compatibilidade_de_navegador">Compatibilidade de navegador</h2> - -<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> - -<p>{{Compat("webextensions.manifest.browser_specific_settings")}}</p> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/manifest.json/devtools_page/index.html b/files/pt-pt/mozilla/add-ons/webextensions/manifest.json/devtools_page/index.html deleted file mode 100644 index 6f53c96b01..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/manifest.json/devtools_page/index.html +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: devtools_page -slug: Mozilla/Add-ons/WebExtensions/manifest.json/devtools_page -translation_of: Mozilla/Add-ons/WebExtensions/manifest.json/devtools_page ---- -<div>{{AddonSidebar}}</div> - -<table class="fullwidth-table standard-table"> - <tbody> - <tr> - <th scope="row" style="width: 30%;">Tipo</th> - <td><code>String</code></td> - </tr> - <tr> - <th scope="row">Obrigatório</th> - <td>Não</td> - </tr> - <tr> - <th scope="row">Exemplo</th> - <td> - <pre class="brush: json no-line-numbers"> -"devtools_page": "devtools/my-page.html"</pre> - </td> - </tr> - </tbody> -</table> - -<p>Utilziae esta chave para permitir que a sua extensão amplie as <em>devtools </em>do navegador integradas.</p> - -<p>esta chave é definida como um URL para um ficheiro HTML. O ficheiro HTML deverá ser incorporado com a extensão, e o URL é relativo à raiz das extensões.</p> - -<p>Consulte <a href="/pt-PT/Add-ons/WebExtensions/Extensão_das_ferramentas_de_desenvolvimento">Extensão das ferramentas de desenvolvimento</a> para saber mais.</p> - -<h2 id="Exemplo">Exemplo</h2> - -<pre class="brush: json no-line-numbers">"devtools_page": "devtools/my-page.html"</pre> - -<h2 id="Compatibilidade_de_navegador">Compatibilidade de navegador</h2> - -<p class="hidden">A tabela de compatibilidade nesta página é gerada a partir dos dados estruturados. Se pretender contribuir para os dados, por favor, consulte <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> e envie-nos um pedido de submissão (<em>pull</em>).</p> - -<p>{{Compat("webextensions.manifest.devtools_page")}}</p> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/manifest.json/icons/index.html b/files/pt-pt/mozilla/add-ons/webextensions/manifest.json/icons/index.html deleted file mode 100644 index 66eb369f78..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/manifest.json/icons/index.html +++ /dev/null @@ -1,79 +0,0 @@ ---- -title: Ícones (icons) -slug: Mozilla/Add-ons/WebExtensions/manifest.json/icons -tags: - - Extensões - - Extensões da Web - - Extras -translation_of: Mozilla/Add-ons/WebExtensions/manifest.json/icons -original_slug: Mozilla/Add-ons/WebExtensions/manifest.json/icones ---- -<div>{{AddonSidebar}}</div> - -<table class="fullwidth-table standard-table"> - <tbody> - <tr> - <th scope="row" style="width: 30%;">Tipo</th> - <td><code>Objeto</code></td> - </tr> - <tr> - <th scope="row">Obrigatório</th> - <td>Não</td> - </tr> - <tr> - <th scope="row">Exemplo</th> - <td> - <pre class="brush: json no-line-numbers"> -"icons": { - "48": "icon.png", - "96": "icon@2x.png" -}</pre> - </td> - </tr> - </tbody> -</table> - -<p>The <code>icons</code> key specifies icons for your extension. Those icons will be used to represent the extension in components such as the Add-ons Manager.</p> - -<p>It consists of key-value pairs of image size in px and image path relative to the root directory of the extension.</p> - -<p>If <code>icons</code> is not supplied, a standard extension icon will be used by default.</p> - -<p>You should supply at least a main extension icon, ideally 48x48 px in size. This is the default icon that will be used in the Add-ons Manager. You may, however, supply icons of any size and Firefox will attempt to find the best icon to display in different components.</p> - -<p>Firefox will consider the screen resolution when choosing an icon. To deliver the best visual experience to users with high-resolution displays, such as Retina displays, provide double-sized versions of all your icons.</p> - -<h2 id="Exemplo">Exemplo</h2> - -<p>The keys in the <code>icons</code> object specify the icon size in px, values specify the relative icon path. This example contains a 48px extension icon and a larger version for high-resolution displays.</p> - -<pre class="brush: json no-line-numbers">"icons": { - "48": "icon.png", - "96": "icon@2x.png" -}</pre> - -<h2 id="SVG">SVG</h2> - -<p>You can use SVG and the browser will scale your icon appropriately. There are currently two caveats though:</p> - -<ol> - <li>You need to specify a viewBox in the image. E.g.: - <pre class="brush: html"><svg viewBox="0 0 48 48" width="48" height="48" ...</pre> - </li> - <li>Even though you can use one file, you still need to specify various size of the icon in your manifest. E.g.: - <pre class="brush: json">"icons": { - "48": "icon.svg", - "96": "icon.svg" -}</pre> - </li> -</ol> - -<div class="note"> -<p>If you are using a program like Inkscape for creating SVG, you might want to save it as a "plain SVG". Firefox might be confused by various special namespaces and not display your icon.</p> -</div> - -<h2 id="Compatibilidade_de_navegador">Compatibilidade de navegador</h2> - -<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> - -<p>{{Compat("webextensions.manifest.icons")}}</p> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/manifest.json/index.html b/files/pt-pt/mozilla/add-ons/webextensions/manifest.json/index.html deleted file mode 100644 index 4f8e087281..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/manifest.json/index.html +++ /dev/null @@ -1,132 +0,0 @@ ---- -title: manifest.json -slug: Mozilla/Add-ons/WebExtensions/manifest.json -tags: - - Add-ons - - Extensões - - WebExtensions -translation_of: Mozilla/Add-ons/WebExtensions/manifest.json ---- -<div>{{AddonSidebar}}</div> - -<p>O ficheiro manifest.json é o único ficheiro que deve ser incluído em extensões que usem APIs de WebExtension.</p> - -<p>Com o <code>manifest.json</code>, é possível especificar metadados sobre a extensão a que pertence, tal como o nome, a versão, e funcionalidades como <em>scripts </em>de <em>background</em>, <em>scripts</em> de conteúdo, e ações de <em>browser</em>.</p> - -<p>O <code>manifest.json</code><em> </em>é um ficheiro em formato <a href="https://wiki.developer.mozilla.org/en-US/docs/Glossary/JSON">JSON</a>, mas também suporta comentários do tipo "//".</p> - -<h2 id="Propriedades_do_manifest.json">Propriedades do manifest.json</h2> - -<p>Seguem-se as propriedades que o <code>manifest.json</code> suporta:</p> - -<div class="twocolumns">{{ ListSubpages ("/en-US/Add-ons/WebExtensions/manifest.json") }}</div> - -<div class="twocolumns"></div> - -<h3 id="Notas_sobre_propriedades_do_manifest.json">Notas sobre propriedades do manifest.json</h3> - -<ul> - <li><code>as únicas <strong>propriedades obrigatórias</strong> são "manifest_version"</code>, <code>"version"</code>, e <code>"name"</code>. <code>"default_locale"</code> só é obrigatório se existir uma pasta "_locales". Caso contrário, a propriedade não pode existir.</li> - <li> - <p><code>"browser_specific_settings"</code> não é compatível com Google Chrome.</p> - </li> -</ul> - -<h3 id="Como_aceder_a_propriedades_manifest.json_em_runtime">Como aceder a propriedades manifest.json em <em>runtime</em></h3> - -<p>É possível aceder ao <code>manifest.json</code> de uma extensão a partir de um <em>script</em><em> </em>da mesma, com a função de JavaScript {{WebExtAPIRef("runtime.getManifest()")}}:</p> - -<pre class="brush: js notranslate">browser.runtime.getManifest().version;</pre> - -<h2 id="Compatibilidade_de_browsers">Compatibilidade de <em>browsers</em></h2> - -<p>{{Compat("webextensions.manifest")}}</p> - -<h2 id="Exemplo">Exemplo</h2> - -<p>Os exemplos seguintes demonstram como funcionam algumas propriedades comuns nos <em>manifest.json.</em> </p> - -<div class="blockIndicator note"> -<p><strong>Nota:</strong> Estes exemplos não funcionam se forem simplesmente copiados e colados. As propriedades necessárias são determinadas pelas características de cada extensão</p> -</div> - -<p>Para ver exemplos completos de extensões, veja a página <a href="https://wiki.developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Examples">Exemplos de extensões</a>.</p> - -<pre class="brush: json notranslate">{ - "applications": { - "gecko": { - "id": "addon@example.com", - "strict_min_version": "42.0" - } - }, - - "background": { - "scripts": ["jquery.js", "my-background.js"], - "page": "my-background.html" - }, - - "browser_action": { - "default_icon": { - "19": "button/geo-19.png", - "38": "button/geo-38.png" - }, - "default_title": "Whereami?", - "default_popup": "popup/geo.html" - }, - - "commands": { - "toggle-feature": { - "suggested_key": { - "default": "Ctrl+Shift+Y", - "linux": "Ctrl+Shift+U" - }, - "description": "Send a 'toggle-feature' event" - } - }, - - "content_security_policy": "script-src 'self' https://example.com; object-src 'self'", - - "content_scripts": [ - { - "exclude_matches": ["*://developer.mozilla.org/*"], - "matches": ["*://*.mozilla.org/*"], - "js": ["borderify.js"] - } - ], - - "default_locale": "en", - - "description": "...", - - "icons": { - "48": "icon.png", - "96": "icon@2x.png" - }, - - "manifest_version": 2, - - "name": "...", - - "page_action": { - "default_icon": { - "19": "button/geo-19.png", - "38": "button/geo-38.png" - }, - "default_title": "Whereami?", - "default_popup": "popup/geo.html" - }, - - "permissions": ["webNavigation"], - - "version": "0.1", - - "web_accessible_resources": ["images/my-image.png"] -}</pre> - -<h2 id="Compatibilidade_de_browsers_2">Compatibilidade de <em>browsers</em></h2> - -<p>Consulte a <a href="https://wiki.developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Browser_compatibility_for_manifest.json">tabela de compatibilidade de browsers do manifest.json</a> para saber que <em>browsers </em>suportam cada propriedade do <code>manifest.json</code>.</p> - -<h2 id="Ver_também">Ver também</h2> - -<p>{{WebExtAPIRef("permissions")}} JavaScript API</p> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/match_patterns/index.html b/files/pt-pt/mozilla/add-ons/webextensions/match_patterns/index.html deleted file mode 100644 index e7330b3010..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/match_patterns/index.html +++ /dev/null @@ -1,431 +0,0 @@ ---- -title: dubla padrões em extensão manifestos -slug: Mozilla/Add-ons/WebExtensions/Match_patterns -translation_of: Mozilla/Add-ons/WebExtensions/Match_patterns -original_slug: Mozilla/Add-ons/WebExtensions/dubla_padrões ---- -<div>{{AddonSidebar}}</div> - -<p>Match patterns are a way to specify groups of URLs: a match pattern matches a specific set of URLs. They are used in WebExtensions APIs in a few places, most notably to specify which documents to load <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_scripts">content scripts</a> into, and to specify which URLs to add <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest">webRequest</a></code> listeners to.</p> - -<p>APIs that use match patterns usually accept a list of match patterns, and will perform the appropriate action if the URL matches any of the patterns. See, for example, the <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts">content_scripts</a></code> key in manifest.json.</p> - -<h2 id="Match_pattern_structure">Match pattern structure</h2> - -<div class="note"> -<p><strong>Note:</strong> Some browsers don’t support certain schemes.<br> - Check the <a href="#Browser_compatibility">Browser compatibility table</a> for details.</p> -</div> - -<p>All match patterns are specified as strings. Apart from the special <code><a href="/en-US/Add-ons/WebExtensions/Match_patterns#%3Call_urls%3E"><all_urls></a></code> pattern, match patterns consist of three parts: <em>scheme</em>, <em>host</em>, and <em>path</em>. The scheme and host are separated by <code>://</code>.</p> - -<pre><scheme>://<host><path></pre> - -<h3 id="scheme">scheme</h3> - -<p>The <em>scheme</em> component may take one of two forms:</p> - -<table class="fullwidth-table standard-table"> - <thead> - <tr> - <th scope="col" style="width: 50%;">Form</th> - <th scope="col">Matches</th> - </tr> - </thead> - <tbody> - <tr> - <td><code>*</code></td> - <td>Only "http" and "https" and in some browsers also <a href="/en-US/docs/Web/API/WebSockets_API">"ws" and "wss"</a>.</td> - </tr> - <tr> - <td>One of <code>http</code>, <code>https</code>, <code>ws</code>, <code>wss</code>, <code>ftp</code>, <code>ftps</code>, <code>data</code> or <code>file</code>.</td> - <td>Only the given scheme.</td> - </tr> - </tbody> -</table> - -<h3 id="host">host</h3> - -<p>The <em>host</em> component may take one of three forms:</p> - -<table class="fullwidth-table standard-table"> - <thead> - <tr> - <th scope="col" style="width: 50%;">Form</th> - <th scope="col">Matches</th> - </tr> - </thead> - <tbody> - <tr> - <td><code>*</code></td> - <td>Any host.</td> - </tr> - <tr> - <td><code>*.</code> followed by part of the hostname.</td> - <td>The given host and any of its subdomains.</td> - </tr> - <tr> - <td>A complete hostname, without wildcards.</td> - <td>Only the given host.</td> - </tr> - </tbody> -</table> - -<p><em>host</em> must not include a port number.</p> - -<p><em>host</em> is optional only if the <em>scheme</em> is "file".</p> - -<p>Note that the wildcard may only appear at the start.</p> - -<h3 id="path">path</h3> - -<p>The <em>path</em> component must begin with a <code>/</code>.</p> - -<p>After that, it may subsequently contain any combination of the <code>*</code> wildcard and any of the characters that are allowed in URL paths or query strings. Unlike <em>host</em>, the <em>path</em> component may contain the <code>*</code> wildcard in the middle or at the end, and the <code>*</code> wildcard may appear more than once.</p> - -<p>The value for the <em>path</em> matches against the string which is the URL path plus the <a href="https://en.wikipedia.org/wiki/Query_string">URL query string</a>. This includes the <code>?</code> between the two, if the query string is present in the URL. For example, if you want to match URLs on any domain where the URL path ends with <code>foo.bar</code>, then you need to use an array of Match Patterns like <code>['*://*/*foo.bar', '*://*/*foo.bar?*']</code>. The <code>?*</code> is needed, rather than just <code>bar*</code>, in order to anchor the ending <code>*</code> as applying to the URL query string and not some portion of the URL path.</p> - -<p>Neither the <a href="https://en.wikipedia.org/wiki/Fragment_identifier">URL fragment identifier</a>, nor the <code>#</code> which precedes it, are considered as part of the <em>path</em>.</p> - -<div class="blockIndicator note"> -<p><strong>Note</strong>: The path pattern string should not include a port number. Adding a port, as in: <em>"http://localhost:1234/*" </em>causes the match pattern to be ignored. However, "<em>http://localhost:1234</em>" will match with "<em>http://localhost/*</em>"</p> -</div> - -<h3 id="<all_urls>"><all_urls></h3> - -<p>The special value <code><all_urls></code> matches all URLs under any of the supported schemes: that is "http", "https", "ws", "wss", "ftp", "data", and "file".</p> - -<h2 id="Examples">Examples</h2> - -<table class="fullwidth-table standard-table"> - <thead> - <tr> - <th scope="col" style="width: 33%;">Pattern</th> - <th scope="col" style="width: 33%;">Example matches</th> - <th scope="col" style="width: 33%;">Example non-matches</th> - </tr> - </thead> - <tbody> - <tr> - <td> - <p><code><all_urls></code></p> - - <p>Match all URLs.</p> - </td> - <td> - <p><code>http://example.org/</code></p> - - <p><code>https://a.org/some/path/</code></p> - - <p><code>ws://sockets.somewhere.org/</code></p> - - <p><code>wss://ws.example.com/stuff/</code></p> - - <p><code>ftp://files.somewhere.org/</code></p> - - <p><code>ftps://files.somewhere.org/</code></p> - </td> - <td> - <p><code>resource://a/b/c/</code><br> - (unsupported scheme)</p> - </td> - </tr> - <tr> - <td> - <p><code>*://*/*</code></p> - - <p>Match all HTTP, HTTPS and WebSocket URLs.</p> - </td> - <td> - <p><code>http://example.org/</code></p> - - <p><code>https://a.org/some/path/</code></p> - - <p><code>ws://sockets.somewhere.org/</code></p> - - <p><code>wss://ws.example.com/stuff/</code></p> - </td> - <td> - <p><code>ftp://ftp.example.org/</code><br> - (unmatched scheme)</p> - - <p><code>ftps://ftp.example.org/</code><br> - (unmatched scheme)</p> - - <p><code>file:///a/</code><br> - (unmatched scheme)</p> - </td> - </tr> - <tr> - <td> - <p><code>*://*.mozilla.org/*</code></p> - - <p>Match all HTTP, HTTPS and WebSocket URLs that are hosted at "mozilla.org" or one of its subdomains.</p> - </td> - <td> - <p><code>http://mozilla.org/</code></p> - - <p><code>https://mozilla.org/</code></p> - - <p><code>http://a.mozilla.org/</code></p> - - <p><code>http://a.b.mozilla.org/</code></p> - - <p><code>https://b.mozilla.org/path/</code></p> - - <p><code>ws://ws.mozilla.org/</code></p> - - <p><code>wss://secure.mozilla.org/something</code></p> - </td> - <td> - <p><code>ftp://mozilla.org/</code><br> - (unmatched scheme)</p> - - <p><code>http://mozilla.com/</code><br> - (unmatched host)</p> - - <p><code>http://firefox.org/</code><br> - (unmatched host)</p> - </td> - </tr> - <tr> - <td> - <p><code>*://mozilla.org/</code></p> - - <p>Match all HTTP, HTTPS and WebSocket URLs that are hosted at exactly "mozilla.org/".</p> - </td> - <td> - <p><code>http://mozilla.org/</code></p> - - <p><code>https://mozilla.org/</code></p> - - <p><code>ws://mozilla.org/</code></p> - - <p><code>wss://mozilla.org/</code></p> - </td> - <td> - <p><code>ftp://mozilla.org/</code><br> - (unmatched scheme)</p> - - <p><code>http://a.mozilla.org/</code><br> - (unmatched host)</p> - - <p><code>http://mozilla.org/a</code><br> - (unmatched path)</p> - </td> - </tr> - <tr> - <td> - <p><code>ftp://mozilla.org/</code></p> - - <p>Match only "ftp://mozilla.org/".</p> - </td> - <td><code>ftp://mozilla.org</code></td> - <td> - <p><code>http://mozilla.org/</code><br> - (unmatched scheme)</p> - - <p><code>ftp://sub.mozilla.org/</code><br> - (unmatched host)</p> - - <p><code>ftp://mozilla.org/path</code><br> - (unmatched path)</p> - </td> - </tr> - <tr> - <td> - <p><code>https://*/path</code></p> - - <p>Match HTTPS URLs on any host, whose path is "path".</p> - </td> - <td> - <p><code>https://mozilla.org/path</code></p> - - <p><code>https://a.mozilla.org/path</code></p> - - <p><code>https://something.com/path</code></p> - </td> - <td> - <p><code>http://mozilla.org/path</code><br> - (unmatched scheme)</p> - - <p><code>https://mozilla.org/path/</code><br> - (unmatched path)</p> - - <p><code>https://mozilla.org/a</code><br> - (unmatched path)</p> - - <p><code>https://mozilla.org/</code><br> - (unmatched path)</p> - - <p><code>https://mozilla.org/path?foo=1</code><br> - (unmatched path due to URL query string)</p> - </td> - </tr> - <tr> - <td> - <p><code>https://*/path/</code></p> - - <p>Match HTTPS URLs on any host, whose path is "path/" and which has no URL query string.</p> - </td> - <td> - <p><code>https://mozilla.org/path/</code></p> - - <p><code>https://a.mozilla.org/path/</code></p> - - <p><code>https://something.com/path</code>/</p> - </td> - <td> - <p><code>http://mozilla.org/path/</code><br> - (unmatched scheme)</p> - - <p><code>https://mozilla.org/path</code><br> - (unmatched path)</p> - - <p><code>https://mozilla.org/a</code><br> - (unmatched path)</p> - - <p><code>https://mozilla.org/</code><br> - (unmatched path)</p> - - <p><code>https://mozilla.org/path/</code><code>?foo=1</code><br> - (unmatched path due to URL query string)</p> - </td> - </tr> - <tr> - <td> - <p><code>https://mozilla.org/*</code></p> - - <p>Match HTTPS URLs only at "mozilla.org", with any URL path and URL query string.</p> - </td> - <td> - <p><code>https://mozilla.org/</code></p> - - <p><code>https://mozilla.org/path</code></p> - - <p><code>https://mozilla.org/another</code></p> - - <p><code>https://mozilla.org/path/to/doc</code></p> - - <p><code>https://mozilla.org/path/to/doc?foo=1</code></p> - </td> - <td> - <p><code>http://mozilla.org/path</code><br> - (unmatched scheme)</p> - - <p><code>https://mozilla.com/path</code><br> - (unmatched host)</p> - </td> - </tr> - <tr> - <td> - <p><code>https://mozilla.org/a/b/c/</code></p> - - <p>Match only this URL, or this URL with any URL fragment.</p> - </td> - <td> - <p><code>https://mozilla.org/a/b/c/</code></p> - - <p><code>https://mozilla.org/a/b/c/#section1</code></p> - </td> - <td>Anything else.</td> - </tr> - <tr> - <td> - <p><code>https://mozilla.org/*/b/*/</code></p> - - <p>Match HTTPS URLs hosted on "mozilla.org", whose path contains a component "b" somewhere in the middle. Will match URLs with query strings, if the string ends in a <code>/</code>.</p> - </td> - <td> - <p><code>https://mozilla.org/a/b/c/</code></p> - - <p><code>https://mozilla.org/d/b/f/</code></p> - - <p><code>https://mozilla.org/a/b/c/d/</code></p> - - <p><code>https://mozilla.org/a/b/c/d/#section1</code></p> - - <p><code>https://mozilla.org/a/b/c/d/?foo=/</code></p> - - <p><code>https://mozilla.org/a?foo=21314&bar=/b/&extra=c/</code></p> - </td> - <td> - <p><code>https://mozilla.org/b/*/</code><br> - (unmatched path)</p> - - <p><code>https://mozilla.org/a/b/</code><br> - (unmatched path)</p> - - <p><code>https://mozilla.org/a/b/c/d/?foo=bar</code><br> - (unmatched path due to URL query string)</p> - </td> - </tr> - <tr> - <td> - <p><code>file:///blah/*</code></p> - - <p>Match any FILE URL whose path begins with "blah".</p> - </td> - <td> - <p><code>file:///blah/</code></p> - - <p><code>file:///blah/bleh</code></p> - </td> - <td><code>file:///bleh/</code><br> - (unmatched path)</td> - </tr> - </tbody> -</table> - -<h3 id="Invalid_match_patterns">Invalid match patterns</h3> - -<table class="fullwidth-table standard-table"> - <thead> - <tr> - <th scope="col">Invalid pattern</th> - <th scope="col">Reason</th> - </tr> - </thead> - <tbody> - <tr> - <td><code>resource://path/</code></td> - <td>Unsupported scheme.</td> - </tr> - <tr> - <td><code>https://mozilla.org</code></td> - <td>No path.</td> - </tr> - <tr> - <td><code>https://mozilla.*.org/</code></td> - <td>"*" in host must be at the start.</td> - </tr> - <tr> - <td><code>https://*zilla.org/</code></td> - <td>"*" in host must be the only character or be followed by ".".</td> - </tr> - <tr> - <td><code>http*://mozilla.org/</code></td> - <td>"*" in scheme must be the only character.</td> - </tr> - <tr> - <td><code>https://mozilla.org:80/</code></td> - <td>Host must not include a port number.</td> - </tr> - <tr> - <td><code>*://*</code></td> - <td>Empty path: this should be "<code>*://*/*</code>".</td> - </tr> - <tr> - <td><code>file://*</code></td> - <td>Empty path: this should be "<code>file:///*</code>".</td> - </tr> - </tbody> -</table> - -<h2 id="Browser_compatibility">Browser compatibility</h2> - -<h3 id="scheme_2">scheme</h3> - - - -<p>{{Compat("webextensions.match_patterns.scheme",10)}}</p> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/tips/index.html b/files/pt-pt/mozilla/add-ons/webextensions/tips/index.html deleted file mode 100644 index dd02a81c1d..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/tips/index.html +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: Tips and Tricks -slug: Mozilla/Add-ons/WebExtensions/Tips -translation_of: Mozilla/Add-ons/WebExtensions/Tips ---- -<p>{{AddonSidebar}}</p> - -<p>Esta paginas contêm varias dicas e truques que deve ser útil para muitas pessoas devenvolvendo extensões usando WebExtension APIs.</p> - -<h2 id="Usando_recursos_avancados_do_ECMAScript_2015_e_2016.">Usando recursos avancados do ECMAScript 2015 e 2016.</h2> - -<p>Firefox <a href="/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla">suporta muitos recursos do ECMAScript 2015</a> fora da box. Diversas novidades e recursos experimental, contanto entretanto, não estão disponiveis por padrão para a Web ou WebExtensions. Se você quer usar esses recursos, é melhor transpilar seu codigo usando uma ferramenta como o <a href="https://babeljs.io/">Babel</a>.</p> - -<p>Cuidado que qualquer coisa abalixo desta linha é informação desatualizada e tem sido removida do Babel 6.</p> - -<p>Babel fornece transformações para a grande maioria dos recursos do ES2015, e os habilita por padrão. Uma vez que o Firefox já suporta totalmente a maiorias dessas, é melhor configurar Babel para ignorar-lá. Nós sugerimos criando um arquivo <code>.babelrc</code>, ou uma seção <code>babel</code> em seu arquivo de projeto <code>package.json</code> contendo o seguinte:</p> - -<pre class="brush: js">{ - "env": { - "firefox": { - "sourceMaps": "inline", - "blacklist": [ - "es5.properties.mutators", - "es6.arrowFunctions", - "es6.destructuring", - "es6.forOf", - "es6.parameters", - "es6.properties.computed", - "es6.properties.shorthand", - "es6.spec.symbols", - "es6.spread", - "es6.tailCall", - "es6.templateLiterals", - "es6.regex.sticky", - "es6.regex.unicode" - ] - } - } -} -</pre> - -<p>Então, para compilar um script individual simplesmente, execute:</p> - -<pre class="brush: sh">BABEL_ENV=firefox babel <filename> -</pre> - -<p>Ou, para compilar cada arquivo JavaScript dentro do diretório <code>src</code> e colocar os arquivos compilados em <code>compiled</code>, copiando arquivos não-JavaScript no processo, executadno:</p> - -<pre class="brush: sh">BABEL_ENV=firefox babel -Dd compiled src -</pre> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/browser_action/index.html b/files/pt-pt/mozilla/add-ons/webextensions/user_interface/browser_action/index.html deleted file mode 100644 index 421dffbb28..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/browser_action/index.html +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: Botão da Barra de Ferramentas -slug: Mozilla/Add-ons/WebExtensions/user_interface/Browser_action -tags: - - Extensão da Web -translation_of: Mozilla/Add-ons/WebExtensions/user_interface/Browser_action -original_slug: Mozilla/Add-ons/WebExtensions/interface_do_utilizador/Ação_navegador ---- -<div>{{AddonSidebar}}</div> - -<p>Normalmente referido como uma <a href="/pt-PT/Add-ons/WebExtensions/API/browserAction">ação do navegador</a>, esta opção da interface do utilizador é um botão adicionado à barra de ferramentas do navegador. Os utilizadores clicam no botão para interagir com a sua extensão.<br> - <img alt="" src="https://mdn.mozillademos.org/files/15751/browser-action.png" style="display: block; height: 182px; margin-left: auto; margin-right: auto; width: 350px;"></p> - -<p>The toolbar button (browser action) is very like the address bar button (page action). For the differences, and guidance on when to use what, see <a href="/en-US/Add-ons/WebExtensions/user_interface/Page_actions#Page_actions_and_browser_actions">Page actions and browser actions</a>.</p> - -<h2 id="Especificar_a_ação_do_navegador">Especificar a ação do navegador</h2> - -<p>Define as propriedades da ação do navegador utilizando a chave <code><a href="/pt-PT/Add-ons/WebExtensions/manifest.json/browser_action">browser_action</a></code> em manifest.json:</p> - -<pre class="brush: json line-numbers language-json"><code class="language-json"><span class="key token">"browser_action":</span> <span class="punctuation token">{</span> - <span class="key token">"default_icon":</span> <span class="punctuation token">{</span> - <span class="key token">"19":</span> <span class="string token">"button/geo-19.png"</span><span class="punctuation token">,</span> - <span class="key token">"38":</span> <span class="string token">"button/geo-38.png"</span> - <span class="punctuation token">}</span><span class="punctuation token">,</span> - <span class="key token">"default_title":</span> <span class="string token">"Whereami?"</span> -<span class="punctuation token">}</span></code></pre> - -<p>The only mandatory key is <code>default_icon</code>.</p> - -<p>There are two ways to specify a browser action: with or without a <a href="/en-US/Add-ons/WebExtensions/Popups">popup</a>. If you don't specify a popup, when the user clicks the button an event is dispatched to the extension, which the extension listens for using <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/BrowserAction/onClicked" title="Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup."><code>browserAction.onClicked</code></a>:</p> - -<pre class="brush: js line-numbers language-js"><code class="language-js">browser<span class="punctuation token">.</span>browserAction<span class="punctuation token">.</span>onClicked<span class="punctuation token">.</span><span class="function token">addListener</span><span class="punctuation token">(</span>handleClick<span class="punctuation token">)</span><span class="punctuation token">;</span></code></pre> - -<p>If you specify a popup, the click event is not dispatched: instead, the popup is shown when the user clicks the button. The user is able to interact with the popup and it closes automatically when the user clicks outside it. See the <a href="/en-US/Add-ons/WebExtensions/Popups">Popup </a>article for more details on creating and managing popups.</p> - -<p>Note that your extension can have only one browser action.</p> - -<p>You can change any of the browser action properties programmatically using the <code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browserAction">browserAction</a></code> API.</p> - -<h2 id="Ícones">Ícones</h2> - -<p>For details on how to create icons to use with your browser action, see <a href="https://design.firefox.com/photon/visuals/iconography.html">Iconography</a> in the <a class="grey-90 no-underline hover-no-underline" href="https://design.firefox.com/photon/index.html">Photon Design System</a> documentation.</p> - -<h2 id="Exemplos">Exemplos</h2> - -<p>The <a href="https://github.com/mdn/webextensions-examples">webextensions-examples</a> repository on GitHub contains two examples of extensions that implement browser actions:</p> - -<ul> - <li><a href="https://github.com/mdn/webextensions-examples/blob/master/bookmark-it/">bookmark-it</a> uses a browser action without a popup.</li> - <li><a href="https://github.com/mdn/webextensions-examples/tree/master/beastify">beastify</a> uses a browser action with a popup.</li> -</ul> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/browser_styles/index.html b/files/pt-pt/mozilla/add-ons/webextensions/user_interface/browser_styles/index.html deleted file mode 100644 index 233cf4ff31..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/browser_styles/index.html +++ /dev/null @@ -1,454 +0,0 @@ ---- -title: Estilos de navegador -slug: Mozilla/Add-ons/WebExtensions/user_interface/Browser_styles -tags: - - Extensões - - Extensões da Web - - Extras -translation_of: Mozilla/Add-ons/WebExtensions/user_interface/Browser_styles -original_slug: Mozilla/Add-ons/WebExtensions/interface_do_utilizador/Estilos_de_navegador ---- -<div>{{AddonSidebar}}</div> - -<p>Certain user interface components - browser and page action <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Popups">popups</a>, <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Sidebars">sidebars</a>, and <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/user_interface/Options_pages">options pages</a> - are specified by your extension in essentially the same way:</p> - -<ol> - <li>create an HTML file defining the structure of the UI element</li> - <li>add a manifest.json key (<code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_action">browser_action</a></code>, <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/page_action">page_action</a></code>, <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/sidebar_action">sidebar_action</a></code>, or <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/options_ui">options_ui</a></code>) pointing to that HTML file.</li> -</ol> - -<p>One of the challenges with this approach is styling the element in such a way that it fits in with the browser's own style. To help with this, the manifest.json keys include an extra optional property: <code>browser_style</code>. If this is included and set to <code>true</code>, then your document will get one or more extra stylesheets that will help make it look consistent with the browser's UI and with other extensions that use the <code>browser_style</code> property.</p> - -<p>In Firefox, the stylesheet can be seen at <code>chrome://browser/content/extension.css</code>. The extra stylesheet at <code>chrome://browser/content/extension-mac.css</code> is also included on OS X.</p> - -<p>Most styles are automatically applied, but some elements require you to add the <span style="white-space: nowrap;">non-standard</span> <code style="white-space: nowrap;">browser-style</code> class to get their styling since Firefox 55, as detailed in the table below:</p> - -<table class="fullwidth-table standard-table"> - <thead> - <tr> - <th scope="col">Elemento</th> - <th scope="col">Exemplo</th> - </tr> - </thead> - <tbody> - <tr> - <td><code><a href="/en-US/docs/Web/HTML/Element/button"><button></a></code></td> - <td> - <pre class="brush: html no-line-numbers"> -<button class="browser-style">Click me</button>{{non-standard_inline}}</pre> - </td> - </tr> - <tr> - <td> - <p><code><a href="/en-US/docs/Web/HTML/Element/select"><select></a></code></p> - </td> - <td> - <pre class="brush: html no-line-numbers"> -<select class="browser-style" name="select"> - <option value="value1">Value 1</option> - <option value="value2" selected>Value 2</option> - <option value="value3">Value 3</option> -</select></pre> - </td> - </tr> - <tr> - <td><code><a href="/en-US/docs/Web/HTML/Element/textarea"><textarea></a></code></td> - <td> - <pre class="brush: html no-line-numbers"> -<textarea class="browser-style">Write here</textarea></pre> - </td> - </tr> - <tr> - <td>Parent of an <code><a href="/en-US/docs/Web/HTML/Element/input"><input></a></code></td> - <td> - <pre class="brush: html no-line-numbers"> -<div class="browser-style"> - <input type="radio" id="op1" name="choices" value="op1"> - <label for="op1">Option 1</label> - - <input type="radio" id="op2" name="choices" value="op2"> - <label for="op2">Option 2</label> -</div></pre> - </td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilidade_de_navegador">Compatibilidade de navegador</h2> - - - -<p>{{Compat("webextensions.browser_style")}}</p> - -<h2 id="Componentes_de_Painel_do_Firefox">Componentes de Painel do Firefox</h2> - -<div class="overheadIndicator nonStandard nonStandardHeader"> -<p><strong>{{NonStandardBadge(1)}} Non-Standard</strong><br> - This feature is non-standard and only works in Firefox.</p> -</div> - -<p>The <code>chrome://browser/content/extension.css</code> stylesheet also contains the styles for the Firefox Panel Components.</p> - -<p>The <a href="https://firefoxux.github.io/StyleGuide/#/navigation">legacy Firefox Style Guide</a> documents proper usage.</p> - -<table class="fullwidth-table standard-table"> - <thead> - <tr> - <th scope="col">Elemento</th> - <th scope="col">Exemplo</th> - </tr> - </thead> - <tbody> - <tr> - <td>Cabeçalho</td> - <td> - <pre class="brush: html"> -<header class="panel-section panel-section-header"> - <div class="icon-section-header"><img src="image.svg"/></div> - <div class="text-section-header">Header</div> -</header></pre> - </td> - </tr> - <tr> - <td>Rodapé</td> - <td> - <pre class="brush: html"> -<footer class="panel-section panel-section-footer"> - <button class="panel-section-footer-button">Cancel</button> - <div class="panel-section-footer-separator"></div> - <button class="panel-section-footer-button default">Confirm</button> -</footer></pre> - </td> - </tr> - <tr> - <td>Separadores</td> - <td> - <pre class="brush: html"> -<div class="panel-section panel-section-tabs"> - <button class="panel-section-tabs-button selected">Tab</button> - <div class="panel-section-tabs-separator"></div> - <button class="panel-section-tabs-button">Tab</button> - <div class="panel-section-tabs-separator"></div> - <button class="panel-section-tabs-button">Tab</button> -</div></pre> - </td> - </tr> - <tr> - <td>Form</td> - <td> - <pre class="brush: html"> -<div class="panel-section panel-section-formElements"> - <div class="panel-formElements-item"> - <label for="name01">Label:</label> - <input type="text" value="Name" id="name01" /> - </div> - <div class="panel-formElements-item"> - <label for="picker01">Label:</label> - <select id="picker01"> - <option value="value1" selected="true">Dropdown</option> - <option value="value2">List Item</option> - <option value="value3">List Item</option> - </select> - </div> - <div class="panel-formElements-item"> - <label for="placeholder01">Label:</label> - <input type="text" placeholder="Placeholder" id="placeholder01" /> - <button name="expander" class="expander"></button> - </div> -</div></pre> - </td> - </tr> - <tr> - <td>Menu</td> - <td> - <pre class="brush: html"> -<div class="panel-section panel-section-list"> - <div class="panel-list-item"> - <div class="icon"></div> - <div class="text">List Item</div> - <div class="text-shortcut">Ctrl-L</div> - </div> - - <div class="panel-list-item"> - <div class="icon"></div> - <div class="text">List Item</div> - <div class="text-shortcut"></div> - </div> - - <div class="panel-section-separator"></div> - - <div class="panel-list-item disabled"> - <div class="icon"></div> - <div class="text">Disabled List Item</div> - <div class="text-shortcut"></div> - </div> - - <div class="panel-section-separator"></div> - - <div class="panel-list-item"> - <div class="icon"></div> - <div class="text">List Item</div> - <div class="text-shortcut"></div> - </div> - - <div class="panel-list-item"> - <div class="icon"></div> - <div class="text">List Item</div> - <div class="text-shortcut"></div> - </div> -</div></pre> - </td> - </tr> - </tbody> -</table> - -<h3 id="Exemplo">Exemplo</h3> - -<h4 id="HTML">HTML</h4> - -<pre class="brush: html"><header class="panel-section panel-section-header"> - <div class="icon-section-header"><!-- An image goes here. --></div> - <div class="text-section-header">Header</div> -</header> - -<div class="panel-section panel-section-list"> - <div class="panel-list-item"> - <div class="icon"></div> - <div class="text">List Item</div> - <div class="text-shortcut">Ctrl-L</div> - </div> - - <div class="panel-list-item"> - <div class="icon"></div> - <div class="text">List Item</div> - <div class="text-shortcut"></div> - </div> - - <div class="panel-section-separator"></div> - - <div class="panel-list-item disabled"> - <div class="icon"></div> - <div class="text">Disabled List Item</div> - <div class="text-shortcut"></div> - </div> - - <div class="panel-section-separator"></div> - - <div class="panel-list-item"> - <div class="icon"></div> - <div class="text">List Item</div> - <div class="text-shortcut"></div> - </div> - - <div class="panel-list-item"> - <div class="icon"></div> - <div class="text">List Item</div> - <div class="text-shortcut"></div> - </div> -</div> - -<footer class="panel-section panel-section-footer"> - <button class="panel-section-footer-button">Cancel</button> - <div class="panel-section-footer-separator"></div> - <button class="panel-section-footer-button default">Confirm</button> -</footer></pre> - -<div class="hidden"> -<h4 id="CSS">CSS</h4> - -<pre class="brush: css">/* Global */ -html, -body { - background: white; - box-sizing: border-box; - color: #222426; - cursor: default; - display: flex; - flex-direction: column; - font: caption; - margin: 0; - padding: 0; - -moz-user-select: none; -} - -body * { - box-sizing: border-box; - text-align: start; -} - -button.panel-section-footer-button, -button.panel-section-tabs-button { - color: inherit; - background-color: unset; - font: inherit; - text-shadow: inherit; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - border: none; -} - -/* Panel Section */ -.panel-section { - display: flex; - flex-direction: row; -} - -.panel-section-separator { - background-color: rgba(0, 0, 0, 0.15); - min-height: 1px; -} - -/* Panel Section - Header */ -.panel-section-header { - border-bottom: 1px solid rgba(0, 0, 0, 0.15); - padding: 16px; -} - -.panel-section-header > .icon-section-header { - background-position: center center; - background-repeat: no-repeat; - height: 32px; - margin-right: 16px; - position: relative; - width: 32px; -} - -.panel-section-header > .text-section-header { - align-self: center; - font-size: 1.385em; - font-weight: lighter; -} - -/* Panel Section - List */ -.panel-section-list { - flex-direction: column; - padding: 4px 0; -} - -.panel-list-item { - align-items: center; - display: flex; - flex-direction: row; - height: 24px; - padding: 0 16px; -} - -.panel-list-item:not(.disabled):hover { - background-color: rgba(0, 0, 0, 0.06); - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - border-top: 1px solid rgba(0, 0, 0, 0.1); -} - -.panel-list-item:not(.disabled):hover:active { - background-color: rgba(0, 0, 0, 0.1); -} - -.panel-list-item.disabled { - color: #999; -} - -.panel-list-item > .icon { - flex-grow: 0; - flex-shrink: 0; -} - -.panel-list-item > .text { - flex-grow: 10; -} - -.panel-list-item > .text-shortcut { - color: #808080; - font-family: "Lucida Grande", caption; - font-size: .847em; - justify-content: flex-end; -} - -.panel-section-list .panel-section-separator { - margin: 4px 0; -} - -/* Panel Section - Footer */ -.panel-section-footer { - background-color: rgba(0, 0, 0, 0.06); - border-top: 1px solid rgba(0, 0, 0, 0.15); - color: #1a1a1a; - display: flex; - flex-direction: row; - height: 41px; - margin-top: -1px; - padding: 0; -} - -.panel-section-footer-button { - flex: 1 1 auto; - height: 100%; - margin: 0 -1px; - padding: 12px; - text-align: center; -} - -.panel-section-footer-button > .text-shortcut { - color: #808080; - font-family: "Lucida Grande", caption; - font-size: .847em; -} - -.panel-section-footer-button:hover { - background-color: rgba(0, 0, 0, 0.06); -} - -.panel-section-footer-button:hover:active { - background-color: rgba(0, 0, 0, 0.1); -} - -.panel-section-footer-button.default { - background-color: #0996f8; - box-shadow: 0 1px 0 #0670cc inset; - color: #fff; -} - -.panel-section-footer-button.default:hover { - background-color: #0670cc; - box-shadow: 0 1px 0 #005bab inset; -} - -.panel-section-footer-button.default:hover:active { - background-color: #005bab; - box-shadow: 0 1px 0 #004480 inset; -} - -.panel-section-footer-separator { - background-color: rgba(0, 0, 0, 0.1); - width: 1px; - z-index: 99; -}</pre> - -<hr> -<pre class="brush: css">/* Example specific – not part of chrome://browser/content/extension.css */ -body { - background: #fcfcfc; - background-clip: padding-box; - border: 1px solid rgba(24,26,27,.2); - box-shadow: 0 3px 5px rgba(24,26,27,.1),0 0 7px rgba(24,26,27,.1); - box-sizing: content-box; - margin: 2em auto .5em; - width: 384px; -} - -html { - min-height: 100vh; -} - -html > body { - margin: auto; -} - -.icon-section-header { - background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmlld0JveD0iMCAwIDMyIDMyIj48Y2lyY2xlIGZpbGw9IiMzNjM5NTkiIGN4PSIxNSIgY3k9IjE1IiByPSIxNSIvPjwvc3ZnPg=="); -}</pre> -</div> - -<h4 id="Result">Result</h4> - -<p>{{EmbedLiveSample("Example","640","360")}}</p> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/context_menu_items/index.html b/files/pt-pt/mozilla/add-ons/webextensions/user_interface/context_menu_items/index.html deleted file mode 100644 index bf69421558..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/context_menu_items/index.html +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: Itens do menu de contexto -slug: Mozilla/Add-ons/WebExtensions/user_interface/Context_menu_items -tags: - - Extensões da Web -translation_of: Mozilla/Add-ons/WebExtensions/user_interface/Context_menu_items -original_slug: >- - Mozilla/Add-ons/WebExtensions/interface_do_utilizador/Itens_do_menu_de_contexto ---- -<div>{{AddonSidebar}}</div> - -<div> -<p>Essa opção da interface do utilizador adiciona um ou mais itens a um menu de contexto do navegador.</p> - -<p><img alt="Example of content menu items added by a WebExtension, from the context-menu-demo example" src="https://mdn.mozillademos.org/files/15051/context_menu_example.png" style="display: block; height: 587px; margin-left: auto; margin-right: auto; width: 573px;"></p> - -<p>You would use this option to expose features that are relevant to specific browser or web page contexts. For example, you could show features to open a graphic editor when the user clicks on an image or offer a feature to save page content when part of a page is selected. You can add plain menu items, checkbox items, radio button groups, and separators to menus. Once a context menu item has been added using {{WebExtAPIRef("contextMenus.create")}} it's displayed in all browser tabs, but you can hide it by removing it with {{WebExtAPIRef("contextMenus.remove")}}.</p> - -<h2 id="Especificar_itens_do_menu_de_contexto">Especificar itens do menu de contexto</h2> - -<p>You manage context menu items programmatically, using the {{WebExtAPIRef("contextMenus")}} API. However, you need to request the <code>contextMenus</code> permission in your manifest.json to be able to take advantage of the API.</p> - -<pre class="brush: json">"permissions": ["contextMenus"]</pre> - -<p>You can then add (and update or delete) the context menu items in your extension's background script. To create a menu item you specify an id, its title, and the context menus it should appear on:</p> - -<pre class="brush: js">browser.contextMenus.create({ - id: "log-selection", - title: browser.i18n.getMessage("contextMenuItemSelectionLogger"), - contexts: ["selection"] -}, onCreated);</pre> - -<p>Your extension then listens for clicks on the menu items. The passed information about the item clicked, the context where the click happened, and details of the tab where the click took place can then be used to invoke the appropriate extension functionality.</p> - -<pre class="brush: js">browser.contextMenus.onClicked.addListener(function(info, tab) { - switch (info.menuItemId) { - case "log-selection": - console.log(info.selectionText); - break; - ... - } -})</pre> - -<h2 id="Exemplos">Exemplos</h2> - -<p>O repositório de <a class="external external-icon" href="https://github.com/mdn/webextensions-examples">wexemplos das Extensões da Web </a>no GitHub, contém vários exemplos de extensões que utilizam os itens do menu de contexto:</p> - -<ul> - <li><a href="https://github.com/mdn/webextensions-examples/tree/master/menu-demo">menu-demo</a> adds several items to the browser's context menu.</li> - <li><a href="https://github.com/mdn/webextensions-examples/tree/master/context-menu-copy-link-with-types">context-menu-copy-link-with-types</a> adds a context menu item to links that copies the URL to the clipboard, as plain text and rich HTML.</li> -</ul> -</div> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/devtools_panels/index.html b/files/pt-pt/mozilla/add-ons/webextensions/user_interface/devtools_panels/index.html deleted file mode 100644 index ffd1b942af..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/devtools_panels/index.html +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: Painéis das ferramentas de desenvolvimento -slug: Mozilla/Add-ons/WebExtensions/user_interface/devtools_panels -tags: - - Extensões da Web - - Guía - - Interface do Utilizador - - Principiante -translation_of: Mozilla/Add-ons/WebExtensions/user_interface/devtools_panels -original_slug: Mozilla/Add-ons/WebExtensions/interface_do_utilizador/devtools_panels ---- -<div>{{AddonSidebar}}</div> - -<div class="note"> -<p>Esta funcionalidade está disponível desde o Firefox 54.</p> -</div> - -<p>Quando uma extensão fornece ferramentas que são úteis para os programadores, é possível adicionar uma IU para as mesmas para as ferramentas de desenvolvimento do navegador como um novo painel.</p> - -<p><img alt='Simple example showing the addition of "My panel" to the Developer Tools tabs.' src="https://mdn.mozillademos.org/files/15035/devtools_panel_example.png" style="height: 352px; width: 1192px;"></p> - -<h2 id="Especificar_um_painel_de_ferramentas_de_desenvolvimento">Especificar um painel de ferramentas de desenvolvimento</h2> - -<p>Um painél das ferramentas de desenvovlimento é adicionado utilizando a API <code><a href="/pt-PT/Add-ons/WebExtensions/API/devtools.panels">devtools.panels</a></code>, que precisa de ser executada a partir de uma página de <em>devtools</em> especial.</p> - -<p>Adicione a páginas de devtools, incluindo a chave <code><a href="/pt-PT/Add-ons/WebExtensions/manifest.json/devtools_page">devtools_page</a></code> na extensão de <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json">manifest.json</a> e forneça a localização do ficheiro HTML da página na extensão:</p> - -<pre class="brush: json line-numbers language-json"><code class="language-json"><span class="key token">"devtools_page":</span> <span class="string token">"devtools-page.html"</span></code></pre> - -<p>From the devtools page, call a script that will add the devtools panel:</p> - -<pre class="brush: html"><body> - <script src="devtools.js"></script> -</body></pre> - -<p>In the script, create the devtools panel by specifying the panel's title, icon, and HTML file that provides the panel's content:</p> - -<pre class="brush: js">function handleShown() { - console.log("panel is being shown"); -} - -function handleHidden() { - console.log("panel is being hidden"); -} - -browser.devtools.panels.create( - "My Panel", // title - "icons/star.png", // icon - "devtools/panel/panel.html" // content -).then((newPanel) => { - newPanel.onShown.addListener(handleShown); - newPanel.onHidden.addListener(handleHidden); -});</pre> - -<p>The extension can now run code in the inspected window using <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/devtools.inspectedWindow/eval"><code>devtools</code>.inspectedWindow.eval()</a></code> or by injecting a content script via the background script by passing a message. You can find more details on how to do this in <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Extending_the_developer_tools">Extending the developer tools.</a></p> - -<h2 id="Exemplos">Exemplos</h2> - -<p>The <a href="https://github.com/mdn/webextensions-examples">webextensions-examples</a> repo on GitHub, contains several examples of extensions that use devtools panels:</p> - -<ul> - <li><a href="https://github.com/mdn/webextensions-examples/blob/master/devtools-panels/">devtools-panels</a> use devtools panels:</li> -</ul> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/extension_pages/index.html b/files/pt-pt/mozilla/add-ons/webextensions/user_interface/extension_pages/index.html deleted file mode 100644 index bea67ee60c..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/extension_pages/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: Páginas de extensão -slug: Mozilla/Add-ons/WebExtensions/user_interface/Extension_pages -translation_of: Mozilla/Add-ons/WebExtensions/user_interface/Extension_pages -original_slug: Mozilla/Add-ons/WebExtensions/interface_do_utilizador/Paginas_de_extensão ---- -<div>{{AddonSidebar()}}</div> - -<p>Pode inclur páginas html na sua extensão para fornecer formulários, ajuda, ou qualquer outro conteúdo que a sua extensão precisar.</p> - -<p><img alt="Example of a simple bundled page displayed as a detached panel." src="https://mdn.mozillademos.org/files/15752/bundled_page_as_panel_small.png" style="display: block; height: 216px; margin-left: auto; margin-right: auto; width: 350px;"></p> - -<p>These pages also get access to the same privileged JavaScript APIs that are available to your extension's background scripts.</p> - -<h2 id="Especificar_páginas_de_extensão">Especificar páginas de extensão</h2> - -<p>You can include HTML files, and their associated CSS or JavaScript files, in your extension. The files can be included in the root or organized within meaningful sub-folders.</p> - -<pre>/my-extension - /manifest.json - /my-page.html - /my-page.js</pre> - -<h2 id="Exibir_páginas_de_extensão">Exibir páginas de extensão</h2> - -<p>There are two options for displaying extension pages: {{WebExtAPIRef("windows.create()")}} and {{WebExtAPIRef("tabs.create()")}}.</p> - -<p>Using <code>windows.create()</code>, for example, you can open an HTML page into a detached panel (a window without the normal browser UI of address bar, bookmark bar, and alike) to create a dialog-like user experience:</p> - -<pre class="brush: js">var createData = { - type: "detached_panel", - url: "panel.html", - width: 250, - height: 100 -}; -var creating = browser.windows.create(createData);</pre> - -<p>When the window is no longer needed, it can be closed programmatically, for example, after the user clicks a button, by passing the id of the current window to {{WebExtAPIRef("windows.remove()")}}:</p> - -<pre class="brush: js">document.getElementById("closeme").addEventListener("click", function(){ - var winId = browser.windows.WINDOW_ID_CURRENT; - var removing = browser.windows.remove(winId); -}); </pre> - -<h2 id="Páginas_de_extensão_e_histório">Páginas de extensão e histório</h2> - -<p>By default, pages you open in this way will be stored in the user's history, just like normal web pages. If you don't want to have this behavior, use {{WebExtAPIRef("history.deleteUrl()")}} to remove the browser's record:</p> - -<pre class="comment-text " id="ct-4">function onVisited(historyItem) { - if (historyItem.url == browser.extension.getURL(myPage)) { - browser.history.deleteUrl({url: historyItem.url}); - } -} - -browser.history.onVisited.addListener(onVisited);</pre> - -<p>To use the history API, you must request the "history" <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions">permission</a> in your <code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json">manifest.json</a></code> file.</p> - -<h2 id="Desenho_da_página_da_Web">Desenho da página da Web</h2> - -<p>For details on how to design your web page's to match the style of Firefox, see the <a class="grey-90 no-underline hover-no-underline" href="https://design.firefox.com/photon/index.html">Photon Design System</a> documentation.</p> - -<h2 id="Exemplos">Exemplos</h2> - -<p>The <a class="external external-icon" href="https://github.com/mdn/webextensions-examples">webextensions-examples</a> repository on GitHub includes the <a class="external external-icon" href="https://github.com/mdn/webextensions-examples/tree/master/window-manipulator">window-manipulator</a> example, which implements several of the options for creating windows.</p> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/index.html b/files/pt-pt/mozilla/add-ons/webextensions/user_interface/index.html deleted file mode 100644 index b18f1afd85..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/index.html +++ /dev/null @@ -1,94 +0,0 @@ ---- -title: Interface do utilizador -slug: Mozilla/Add-ons/WebExtensions/user_interface -tags: - - Interface do Utilizador - - Landing - - WebExtensions -translation_of: Mozilla/Add-ons/WebExtensions/user_interface -original_slug: Mozilla/Add-ons/WebExtensions/interface_do_utilizador ---- -<div>{{AddonSidebar}}</div> - -<p>As extensões que utilizam as APIs de WebExtension são fornecidas com várias opções de interface do utilizador, e assim, as suas funcionalidades podem ficar disponíveis para o utilizador. Um resumo dessas opções é fornecido abaixo, com uma introdução mais detalhada para cada opção da interface do utilziador nesta secção .</p> - -<div class="note"> -<p>For advice on using these UI components to create a great user experience in your extension, please see the <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/User_experience_best_practices">User experience best practices</a> article.</p> -</div> - -<table class="standard-table"> - <thead> - <tr> - <th scope="col">Opção de UI</th> - <th scope="col">Descrição</th> - <th scope="col" style="width: 350px;">Exemplo</th> - </tr> - </thead> - <tbody> - <tr> - <td><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Browser_action">Browser toolbar button</a></td> - <td>A button on the browser toolbar that dispatches an event to the extension when clicked. By default, the button is visible in all tabs.</td> - <td><img alt="Example of a WebExtension toolbar button" src="https://mdn.mozillademos.org/files/12966/browser-action.png" style="height: 99px; width: 350px;"></td> - </tr> - <tr> - <td>Browser toolbar button with a <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Popups">popup</a></td> - <td>A popup on a button in the browser toolbar that opens when the button is clicked. The popup is defined in an HTML document that handles the user interaction.</td> - <td><img alt="Example of a WebExtension toolbar button with a popup" src="https://mdn.mozillademos.org/files/14039/popup-shadow.png" style="height: 156px; width: 350px;"></td> - </tr> - <tr> - <td><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Page_actions">Address bar button</a></td> - <td>A button on the browser address bar that dispatches an event to the extension when clicked. By default, the button is hidden in all tabs.</td> - <td><img alt="Example showing an address bar button (page action)" src="https://mdn.mozillademos.org/files/15047/address_bar_button.png" style="height: 127px; width: 350px;"></td> - </tr> - <tr> - <td>Address bar button with a <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Popups">popup</a></td> - <td>A popup on a button in the browser address bar that opens when the button is clicked. The popup is defined in an HTML document that handles the user interaction.</td> - <td><img alt="Example of a popup on the address bar button" src="https://mdn.mozillademos.org/files/15053/page_action_popup.png" style="height: 250px; width: 330px;"></td> - </tr> - <tr> - <td><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Context_menu_items">Context menu items</a></td> - <td>Menu items, checkboxes, and radio buttons on one or more of the browser's context menus. Also, menus can be structured by adding separators. When menu items are clicked, an event is dispatched to the extension.</td> - <td><img alt="" src="https://mdn.mozillademos.org/files/15051/context_menu_example.png" style="height: 359px; width: 350px;"></td> - </tr> - <tr> - <td><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Sidebars">Sidebar</a></td> - <td> - <p dir="ltr">An HTML document displayed next to a web page, with the option for unique content per page. The sidebar is opened when the extension is installed, then obeys the user's sidebar visibility selection. User interaction within the sidebar is handled by its HTML document.</p> - </td> - <td><img alt="Example of a WebExtension's sidebar" src="https://mdn.mozillademos.org/files/14825/bookmarks-sidebar.png" style="height: 209px; width: 350px;"></td> - </tr> - <tr> - <td><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Options_pages">Options page</a></td> - <td>A page that enables you to define preferences for your extension that your users can change. The user can access this page in the from the browser's add-ons manager.</td> - <td><img alt="Example showing the options page content added in the favorite colors example." src="https://mdn.mozillademos.org/files/15055/options_page.png" style="height: 259px; width: 350px;"></td> - </tr> - <tr> - <td><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Bundled_web_pages">Bundled web pages</a></td> - <td>Use web pages included in your extension to provide forms, help, or any other content required, within windows or tabs.</td> - <td><img alt="Example of a simple bundled page displayed as a detached panel." src="https://mdn.mozillademos.org/files/15063/bundled_page_as_panel_small.png" style="height: 180px; width: 350px;"></td> - </tr> - <tr> - <td><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Notifications">Notifications</a></td> - <td>Transient notifications displayed to the user through the underlying operating system's notifications mechanism. Dispatches an event to the extension when the user clicks a notification, or when a notification closes (either automatically or at the user's request).</td> - <td><img alt="Example notification from a WebExtension" src="https://mdn.mozillademos.org/files/14043/notify-shadowed.png" style="height: 95px; width: 350px;"></td> - </tr> - <tr> - <td><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Omnibox">Address bar suggestions</a></td> - <td>Offer custom address bar suggestions when the user enters a keyword.</td> - <td><img alt="Example showing the result of the firefox_code_search WebExtension's customization of the address bar suggestions." src="https://mdn.mozillademos.org/files/15059/omnibox_example_small.png" style="height: 242px; width: 350px;"></td> - </tr> - <tr> - <td><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/devtools_panels">Developer tools panels</a></td> - <td>A tab with an associated HTML document that displays in the browser's developer tools.</td> - <td><img alt="New panel tab in the Developer Tools tab bar" src="https://mdn.mozillademos.org/files/15049/developer_panel_tab.png" style="height: 180px; width: 350px;"></td> - </tr> - </tbody> -</table> - -<p>The following how-to guides provide step-by-step guidance to creating some of these user interface options:</p> - -<ul> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Add_a_button_to_the_toolbar">Add a button to the toolbar</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Implement_a_settings_page">Implement a settings page</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Extending_the_developer_tools">Extending the developer tools</a></li> -</ul> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/notifications/index.html b/files/pt-pt/mozilla/add-ons/webextensions/user_interface/notifications/index.html deleted file mode 100644 index 8c8c113425..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/notifications/index.html +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: Notificações -slug: Mozilla/Add-ons/WebExtensions/user_interface/Notifications -tags: - - Extensões da Web -translation_of: Mozilla/Add-ons/WebExtensions/user_interface/Notifications -original_slug: Mozilla/Add-ons/WebExtensions/interface_do_utilizador/Notificacoes ---- -<div>{{AddonSidebar}}</div> - -<div> -<p>As notificações permitem-lhe comunicar a informação sobre a sua extensão ou o seu conteúdo utilizando o serviço de notificação do sistema operativo subjacente:</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/14043/notify-shadowed.png" style="display: block; height: 334px; margin-left: auto; margin-right: auto; width: 700px;"></p> - -<p>As notificações podem incluir uma chamada para ação para o utilizador, e o seu extra pode escutar o utilizador a clicar na notificação ou a notificação a fechar.</p> - -<h2 id="Especificar_as_notificações">Especificar as notificações</h2> - -<p>Pode gerir as notificações programaticamente, utilizando a API {{WebExtAPIRef("notifications")}}. Para utilizar esta API deve solicitar a permissão de <em><code>notifications</code></em> no seu manifest.json:</p> - -<pre class="brush: json"><span class="pl-s"><span class="pl-pds">"</span>permissions<span class="pl-pds">"</span></span>: [<span class="pl-s"><span class="pl-pds">"</span>notifications<span class="pl-pds">"</span></span>]</pre> - -<p>Depois, pode utilziar {{WebExtAPIRef("notifications.create")}} para criar as suas notificações, como neste exemplo de <a href="https://github.com/mdn/webextensions-examples/tree/master/notify-link-clicks-i18n">notify-link-clicks-i18n:</a></p> - -<pre class="brush: js">var title = browser.i18n.getMessage("notificationTitle"); -var content = browser.i18n.getMessage("notificationContent", message.url); -browser.notifications.create({ - "type": "basic", - "iconUrl": browser.extension.getURL("icons/link-48.png"), - "title": title, - "message": content -});</pre> - -<p>Este código cria uma notificação com um ícone, título, e mensagem.</p> - -<p>Se a notificação incluir uma chamada para ação, pode escutar o utilizador a clicar na notificação para chamar a ação para manipular a ação:</p> - -<pre class="brush: js line-numbers language-js"><code class="language-js">browser<span class="punctuation token">.</span>notifications<span class="punctuation token">.</span>onClicked<span class="punctuation token">.</span><span class="function token">addListener</span><span class="punctuation token">(</span>handleClick<span class="punctuation token">)</span><span class="punctuation token">;</span> -</code></pre> - -<p>Se estiver a enviar chamadas para ação através das notificações, também irá querer definir a notificação opcional <code>id</code>, e assim, pode saber qual a chamada para ação que o utilizador selecionou.</p> - -<h2 id="Exemplos">Exemplos</h2> - -<p>O repositório dos <a href="https://github.com/mdn/webextensions-examples">exemplos da extensões da Web</a> no GitHub, contém vários exemplos das extensões que utilizam <em>creates notifications</em>:</p> - -<ul> - <li><a href="https://github.com/mdn/webextensions-examples/tree/master/notify-link-clicks-i18n">notify-link-clicks-i18n</a> utiliza <em>creates notifications</em>.</li> -</ul> -</div> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/omnibox/index.html b/files/pt-pt/mozilla/add-ons/webextensions/user_interface/omnibox/index.html deleted file mode 100644 index 2470a05c32..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/omnibox/index.html +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: Sugestões da barra de endereço -slug: Mozilla/Add-ons/WebExtensions/user_interface/Omnibox -tags: - - Extensões da Web - - Interface do Utilizador -translation_of: Mozilla/Add-ons/WebExtensions/user_interface/Omnibox -original_slug: Mozilla/Add-ons/WebExtensions/interface_do_utilizador/Omnibox ---- -<div>{{AddonSidebar()}}</div> - -<p>Using the {{WebExtAPIRef("omnibox")}} API, extensions can customize the suggestions offered in the browser address bar's drop-down when the user enters a keyword.</p> - -<p><img alt="Example showing the result of the firefox_code_search WebExtension's customization of the address bar suggestions." src="https://mdn.mozillademos.org/files/15749/omnibox_example_small.png" style="display: block; height: 232px; margin-left: auto; margin-right: auto; width: 350px;"></p> - -<p>This enables your extension to, for example, search a library of free ebooks or, as in the example above, a repository of code examples.</p> - -<h2 id="Especificando_a_personalização_de_omnibox">Especificando a personalização de omnibox</h2> - -<p>You tell your extension that it is going to customize the address bar suggestions by including the <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/omnibox">omnibox</a> key and definition of the trigger keyword in its <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json">manifest.json</a> file:</p> - -<pre class="brush: json line-numbers language-json"> "omnibox": { "keyword" : "cs" }</pre> - -<p>In the extension's background JavaScript file, using {{WebExtAPIRef("omnibox.setDefaultSuggestion()")}}, you can optionally define the first suggestion to be displayed in the address bar drop-down. Use this to provide a hint on how to use the feature:</p> - -<pre class="brush: js line-numbers language-js">browser.omnibox.setDefaultSuggestion({ - description: `Search the firefox codebase - (e.g. "hello world" | "path:omnibox.js onInputChanged")` -});</pre> - -<p>You can then add the code to provide the customized content by listening for {{WebExtAPIRef("omnibox.onInputStarted")}}, which is dispatched when the user has typed the keyword and a space, and {{WebExtAPIRef("omnibox.onInputChanged")}}, which is dispatched whenever the user updates the address bar entry. You can then populate the suggestions, in this case building a search of https://searchfox.org/mozilla-central using the term entered by the user:</p> - -<pre class="brush: js">browser.omnibox.onInputChanged.addListener((text, addSuggestions) => { - let headers = new Headers({"Accept": "application/json"}); - let init = {method: 'GET', headers}; - let url = buildSearchURL(text); - let request = new Request(url, init); - - fetch(request) - .then(createSuggestionsFromResponse) - .then(addSuggestions); -});</pre> - -<p>If the extension set a default suggestion using {{WebExtAPIRef("omnibox.setDefaultSuggestion()")}}, then this will appear first in the drop-down.</p> - -<p>The extension can then listen for the user clicking one of the suggestions, using {{WebExtAPIRef("omnibox.onInputEntered")}}. If the default suggestion is clicked the user's custom term is returned, otherwise the suggestion's string is returned. This also passes information on the user's browser preferences for handling new links. In the code below the user's custom term is used to create a search, otherwise the suggested URL is opened:</p> - -<pre class="brush: js">browser.omnibox.onInputEntered.addListener((text, disposition) => { - let url = text; - if (!text.startsWith(SOURCE_URL)) { - // Update the url if the user clicks on the default suggestion. - url = `${SEARCH_URL}?q=${text}`; - } - switch (disposition) { - case "currentTab": - browser.tabs.update({url}); - break; - case "newForegroundTab": - browser.tabs.create({url}); - break; - case "newBackgroundTab": - browser.tabs.create({url, active: false}); - break; - } -});</pre> - -<p> </p> - -<h2 id="Exemplos">Exemplos</h2> - -<p>O repositório dos <a href="https://github.com/mdn/webextensions-examples">exemplos das extensões da Web</a> no GitHub inclui o exemplo <a class="external external-icon" href="https://github.com/mdn/webextensions-examples/tree/master/firefox-code-search">firefox-code-search</a> que personaliza a barra de pesquisa.</p> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/options_pages/index.html b/files/pt-pt/mozilla/add-ons/webextensions/user_interface/options_pages/index.html deleted file mode 100644 index d3a560412f..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/options_pages/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: Página de opções -slug: Mozilla/Add-ons/WebExtensions/user_interface/Options_pages -tags: - - Extensões da Web -translation_of: Mozilla/Add-ons/WebExtensions/user_interface/Options_pages -original_slug: Mozilla/Add-ons/WebExtensions/interface_do_utilizador/Options_pages ---- -<div>{{AddonSidebar}}</div> - -<div> -<p>Uma página de <strong>Opções</strong> permite-lhe definir as preferências para sua extensão que os seus utilizadores podem alterar. Os utilizadores podem aceder á página das opções para uma extensão a partir do do gestor de extras do navegador:</p> - -<p>{{EmbedYouTube("02oXAcbUv-s")}}</p> - -<p>The way users access the page, and the way it's integrated into the browser's user interface, will vary from one browser to another.</p> - -<ul> -</ul> - -<p>You can open the page programmatically by calling <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/Runtime/openOptionsPage" title="If your add-on does not have an options page, or the browser failed to create one for some other reason, runtime.lastError will be set."><code>runtime.openOptionsPage()</code></a>.</p> - -<p>Options pages have a Content Security Policy that restricts the sources from which they can load resources, and disallows some unsafe practices such as the use of <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval">eval()</a></code>. See <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_Security_Policy">Content Security Policy</a> for more details.</p> - -<h2 id="Especificar_a_página_de_opções">Especificar a página de opções</h2> - -<p>To create an options page, write an HTML file defining the page. This page can include CSS and JavaScript files, like a normal web page. This page, from the <a href="https://github.com/mdn/webextensions-examples/tree/master/favourite-colour">favourite-colour</a> example, includes a JavaScript file:</p> - -<pre class="brush: html"><!DOCTYPE html> - -<html> - <head> - <meta charset="utf-8"> - </head> - -<body> - <form> - <label>Favourite colour</label> - <input type="text" id="colour" > - <button type="submit">Save</button> - </form> - <script src="options.js"></script> -</body> - -</html></pre> - -<p>JavaScript em execução na página pode utilizar a <a href="/pt-PT/Add-ons/WebExtensions/API">API das Extensões da Web</a> que o extra tem <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions">permissões</a> para. Em particular, pode utilziar a APi de <a href="/pt-PT/Add-ons/WebExtensions/API/Armazenamento" title="Enables WebExtensions to store and retrieve data, and listen for changes to stored items."><code>armazenamento</code></a> para manter as preferências.</p> - -<p>Package the page's files in your extension.</p> - -<p>You also need to include the <code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/options_ui">options_ui</a></code> key in your manifest.json file, giving it the URL to the page.</p> - -<pre class="brush: json">"options_ui": { - "page": "options.html", - "browser_style": true -},</pre> - -<h2 id="Exemplos">Exemplos</h2> - -<p>The <a href="https://github.com/mdn/webextensions-examples">webextensions-examples</a> repo on GitHub, contains several examples of extensions that use an options page:</p> - -<ul> - <li><a href="https://github.com/mdn/webextensions-examples/tree/master/favourite-colour">favourite-colour</a> example extension with options page</li> -</ul> -</div> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/page_actions/index.html b/files/pt-pt/mozilla/add-ons/webextensions/user_interface/page_actions/index.html deleted file mode 100644 index 57407bc175..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/page_actions/index.html +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: Botão da barra de endereço -slug: Mozilla/Add-ons/WebExtensions/user_interface/Page_actions -tags: - - Extensões da Web - - Interface do Utilizador -translation_of: Mozilla/Add-ons/WebExtensions/user_interface/Page_actions -original_slug: Mozilla/Add-ons/WebExtensions/interface_do_utilizador/Acoes_pagina ---- -<div>{{AddonSidebar}}</div> - -<p>Normalmente referido como uma <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/pageAction">ação da página</a>, esta opção da inteface do utilizador é um botão adicionado à barra de endereço do navegador. Os utilziadores clicam no botão para interagir com a sua extensão.</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/12960/page-action.png" style="display: block; height: 262px; margin-left: auto; margin-right: auto; width: 850px;"></p> - -<p>Use this button when a feature is only relevant for some web pages. By default, the address bar button is hidden in all browser tabs, and you call <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/PageAction/show" title="Shows the page action for a given tab. The page action is shown whenever the given tab is the active tab."><code>pageAction.show()</code></a> and <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/PageAction/hide" title="Hides the page action for a given tab."><code>pageAction.hide()</code></a> to show or hide it in specific tabs.</p> - -<p>Compare to the <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Browser_action">toolbar button</a>, which offers similar behavior but is used in situations where the extension's features are applicable to almost every web page.</p> - -<h2 id="Especificar_a_ação_da_página">Especificar a ação da página</h2> - -<p>You define the page action's properties using the <code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/page_action">page_action</a></code> key in manifest.json:</p> - -<pre class="brush: json line-numbers language-json"><code class="language-json"><span class="key token">"page_action":</span> <span class="punctuation token">{</span> - <span class="key token">"browser_style":</span> <span class="keyword token">true</span><span class="punctuation token">,</span> - <span class="key token">"default_icon":</span> <span class="punctuation token">{</span> - <span class="key token">"19":</span> <span class="string token">"button/geo-19.png"</span><span class="punctuation token">,</span> - <span class="key token">"38":</span> <span class="string token">"button/geo-38.png"</span> - <span class="punctuation token">}</span><span class="punctuation token">,</span> - <span class="key token">"default_title":</span> <span class="string token">"Whereami?"</span> -<span class="punctuation token">}</span></code></pre> - -<p>The only mandatory key is <code>default_icon</code>.</p> - -<p>There are two ways to specify a page action: with or without a <a href="/en-US/Add-ons/WebExtensions/Popups">popup</a>. If you don't specify a popup, when the user clicks the button an event is dispatched to the extension, which the extension listens for using <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/pageAction/onClicked" title="Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup."><code>pageAction.onClicked</code></a>:</p> - -<pre class="brush: js line-numbers language-js"><code class="language-js">browser<span class="punctuation token">.</span>pageAction<span class="punctuation token">.</span>onClicked<span class="punctuation token">.</span><span class="function token">addListener</span><span class="punctuation token">(</span>handleClick<span class="punctuation token">)</span><span class="punctuation token">;</span></code></pre> - -<p>If you specify a popup, the click event is not dispatched: instead, the popup is shown when the user clicks the button. The user is able to interact with the popup and it closes automatically when the user clicks outside it. See the <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Popups">Popup </a>article for more details on creating and managing popups.</p> - -<p>Note that your extension can have one page action only.</p> - -<p>You can change any of the page action properties programmatically using the <code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/pageAction">pageAction</a></code> API.</p> - -<h2 id="Exemplos">Exemplos</h2> - -<p>The <a href="https://github.com/mdn/webextensions-examples">webextensions-examples</a> repo on GitHub, contains several examples of extensions that use page action:</p> - -<ul> - <li><a href="https://github.com/mdn/webextensions-examples/tree/master/chill-out">chill-out</a> uses a page action without a popup.</li> -</ul> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/popups/index.html b/files/pt-pt/mozilla/add-ons/webextensions/user_interface/popups/index.html deleted file mode 100644 index 7d7c1d469e..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/popups/index.html +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: Janelas (Popups) -slug: Mozilla/Add-ons/WebExtensions/user_interface/Popups -tags: - - Extensions - - IU - - Interface do Utilizador - - Janela - - popup -translation_of: Mozilla/Add-ons/WebExtensions/user_interface/Popups -original_slug: Mozilla/Add-ons/WebExtensions/interface_do_utilizador/Popups ---- -<div>{{AddonSidebar}}</div> - -<div> -<p>Uma janela (<em>popup)</em> é uma janela que está associada com um <a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/Ação_navegador">botão da barra de ferramentas</a> ou <a href="/pt-PT/Add-ons/WebExtensions/interface_do_utilizador/Acoes_pagina">botão da barra de endereço</a>.</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/15747/page_action_popup.png" style="display: block; height: 282px; margin-left: auto; margin-right: auto; width: 350px;"></p> - -<p>Quando o usuário clica no botão, a janela popup é exibida. Quando o usuário clica em qualquer lugar fora do popup, ele é fechado. O popup pode ser fechado via programação usando a função <code><a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/close">window.close()</a></code> em um script sendo executado no popup. Entretanto, você não pode abrir o popup via programação a partir do código JavaScript da extensão: ele somente se abre em resposta a uma ação do usuário.</p> - -<p>Você pode definir um atalho de teclado que abre o popup usando <code>"_execute_browser_action"</code> and <code>"_execute_page_action"</code>. Veja a documentação da chave <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands">commands</a></code><span class="hidden"> </span> no manifest.json.</p> - -<h2 id="Especificar_uma_janela">Especificar uma janela</h2> - -<p>O popup é definido por um arquivo HTML, que pode incluir arquivos CSS e JavaScript, como uma página comum. Diferentemente de uma página comum, o código JavaScript pode usar todos os <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API">WebExtension APIs</a> que a extensão tem <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions">permissions</a> .</p> - -<p>O documento do popup é carregado toda vez que ele é exibido, e descarregado quando o popup é fechado.</p> - -<p>O arquivo HTML é incluído na extensão e especificado como parte do <code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_action">browser_action</a></code> ou chave <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/page_action">page_action</a> por <code>"default_popup"</code> no arquivo manifest.json:</p> - -<pre class="brush: json"> "browser_action": { - "default_icon": "icons/beasts-32.png", - "default_title": "Beastify", - "default_popup": "popup/choose_beast.html" - }</pre> - -<p>You can ask the browser to include a stylesheet in your popup that will make it look consistent with the browser's UI. To do this, include <code>"browser_style": true</code> in the <code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_action">browser_action</a></code> or <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/page_action">page_action</a> key.</p> - -<p>Popups have a Content Security Policy that restricts the sources from which they can load resources, and disallows some unsafe practices such as the use of <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval">eval()</a></code>. See <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_Security_Policy">Content Security Policy</a> for more details on this.</p> - -<h2 id="Depurar_janelas">Depurar janelas</h2> - -<p>You can debug a popup's markup and JavaScript using the Add-on Debugger, but you'll need to turn on the Disable popup auto hide feature to prevent popups from hiding when you click outside them.<a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Debugging#Debugging_popups"> Read about debugging popups</a>.</p> - -<h2 id="Redimensionar_janelas">Redimensionar janelas</h2> - -<p>Popups resize automatically to fit their content. The algorithm for this may differ from one browser to another.</p> - -<p>In Firefox, the size is calculated just before the popup is shown, and at most 10 times per second after DOM mutations. For strict mode documents, the size is calculated based on the layout size of the <code><a href="/en-US/docs/Web/HTML/Element/body"><body></a></code> element. For quirks mode, it's the <code><a href="/en-US/docs/Web/HTML/Element/html"><html></a></code> element. Firefox calculates the preferred width of the contents of that element, reflows it to that width, and then resizes so there's no vertical scrolling. It will grow to a size of <strong>800x600 pixels</strong> at most if that fits on the user's screen. If the user <a href="https://support.mozilla.org/en-US/kb/customize-firefox-controls-buttons-and-toolbars#w_customize-the-menu-or-the-toolbar">moves the extension's button to the menu</a> or it appears in the toolbar overflow, then the popup appears inside the menu's panel and is given a fixed width.</p> - -<p>No Firefox Android 57, <em>popup </em>é mostrada como uma página normal num novo separador.</p> - -<h2 id="Desenho_de_janela">Desenho de janela</h2> - -<p>Para obter detalhes sobre como desenhar a sua janela (popup) da página da Web para combinar com o estilo do Firefox, consulte a documentação <a class="grey-90 no-underline hover-no-underline" href="https://design.firefox.com/photon/index.html">Photon Design System</a>.</p> - -<h2 id="Exemplos">Exemplos</h2> - -<p>The <a href="https://github.com/mdn/webextensions-examples">webextensions-examples</a> repository on GitHub includes the <a href="https://github.com/mdn/webextensions-examples/tree/master/beastify">beastify</a> example which implements a browser action with a popup.</p> -</div> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/sidebars/index.html b/files/pt-pt/mozilla/add-ons/webextensions/user_interface/sidebars/index.html deleted file mode 100644 index 02509b9229..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/user_interface/sidebars/index.html +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: Barras laterais -slug: Mozilla/Add-ons/WebExtensions/user_interface/Sidebars -tags: - - Extensões da Web -translation_of: Mozilla/Add-ons/WebExtensions/user_interface/Sidebars -original_slug: Mozilla/Add-ons/WebExtensions/interface_do_utilizador/Barras_laterais ---- -<div>{{AddonSidebar}}</div> - -<div> -<p> </p> - -<p>Uma barra lateral é um painel que é exibido no lado esquerdo da janela do navegador, ao lado da página da Web. O navegador fornece uma IU que permite ao utilizador ver as barras laterais atualmente disponíveis e selecionar uma barra lateral para exibir. Por exemplo, o Firefox tem um menu 'Ver -> Barra lateral'. Apenas pode ser exibida uma barra lateral de cada vez, e essa barra lateral será exibida para todos os separadores e todas as janelas do navegador.</p> - -<p>O navegador poderá incluir uma série de barras laterais integradas. Por exemplo, o Firefox inclui uma barra lateral para interagir com marcadores:</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/14825/bookmarks-sidebar.png" style="display: block; height: 761px; margin-left: auto; margin-right: auto; width: 728px;">Using the <code>sidebar_action</code> manifest.json key, an extension can add its own sidebar to the browser. It will be listed alongside the built-in sidebars, and the user will be able to open it using the same mechanism as for the built-in sidebars.</p> - -<p>Like a browser action popup, you specify the sidebar's contents as an HTML document. When the user opens the sidebar, its document is loaded into every open browser window. Each window gets its own instance of the document. When new windows are opened, they get their own sidebar documents as well.</p> - -<p>You can set a document for a particular tab using the {{WebExtAPIRef("sidebarAction.setPanel()")}} function. A sidebar can figure out which window it belongs to using the {{WebExtAPIRef("windows.getCurrent()")}} API:</p> - -<pre class="brush: js">// sidebar.js -browser.windows.getCurrent({populate: true}).then((windowInfo) => { - myWindowId = windowInfo.id; -});</pre> - -<p>This is useful if a sidebar wants to display different content for different windows. For an example of this, see the <a href="https://github.com/mdn/webextensions-examples/tree/master/annotate-page">"annotate-page" example</a>.</p> - -<p>Sidebar documents get access to the same set of privileged JavaScript APIs that the extension's background and popup scripts get. They can get direct access to the background page (unless the sidebar belongs to incognito mode window) using {{WebExtAPIRef("runtime.getBackgroundPage()")}}, and can interact with content scripts or native applications using messaging APIs like {{WebExtAPIRef("tabs.sendMessage()")}} and {{WebExtAPIRef("runtime.sendNativeMessage()")}}.</p> - -<p>Sidebar documents are unloaded when their browser window is closed or when the user closes the sidebar. This means that unlike background pages, sidebar documents don't stay loaded all the time, but unlike browser action popups, they stay loaded while the user interacts with web pages.</p> - -<p>When an extension that defines a sidebar is first installed, its sidebar will be opened automatically. This is intended to help the user understand that the extension includes a sidebar. Note that it's not possible for extension to open sidebars programmatically: sidebars can only be opened by the user.</p> - -<h2 id="Especificar_barras_laterais">Especificar barras laterais</h2> - -<p>To specify a sidebar, define the default document with the <code><a href="/en-US/Add-ons/WebExtensions/manifest.json/sidebar_action">sidebar_action</a></code> manifest.json key, alongside a default title and icon:</p> - -<pre class="brush: json">"sidebar_action": { - "default_title": "My sidebar", - "default_panel": "sidebar.html", - "default_icon": "sidebar_icon.png" -}</pre> - -<p>You can change the title, panel, and icon programmatically using the {{WebExtAPIRef("sidebarAction")}} API.</p> - -<p>Title and icon are shown to the user in any UI provided by the browser to list sidebars, such as the "View > Sidebar" menu in Firefox.</p> - -<h2 id="Exemplo">Exemplo</h2> - -<p>O repositório de <a href="https://github.com/mdn/webextensions-examples">exemplos das extensões da Web</a> no GitHub, contém vários exemplos de extensões que utilizam a barra lateral:</p> - -<ul> - <li><a href="https://github.com/mdn/webextensions-examples/tree/master/annotate-page">annotate-page</a> utiliza uma barra lateral.</li> -</ul> -</div> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/what_are_webextensions/index.html b/files/pt-pt/mozilla/add-ons/webextensions/what_are_webextensions/index.html deleted file mode 100644 index ada2698b44..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/what_are_webextensions/index.html +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: O que são extensões? -slug: Mozilla/Add-ons/WebExtensions/What_are_WebExtensions -tags: - - Extensões - - Extensões da Web -translation_of: Mozilla/Add-ons/WebExtensions/What_are_WebExtensions -original_slug: Mozilla/Add-ons/WebExtensions/O_que_sao_WebExtensions ---- -<div>{{AddonSidebar}}</div> - -<p>Uma extensão adiciona funcionalidades e funções a um navegador. É criada, utilizando a tecnologia padrão baseada na Web - CSS, HTML e JavaScript. Esta tira vantagem de algumas APIs da Web, como JavaScript pode em uma página da web, mas uma extensão também tem acesso ao seu próprio conjunto de APIs de JavaScript. Isto significa que pode fazer muito mais numa extensão do que pode com o código numa página da Web. Aqui estão apenas alguns exemplos das coisas que pode fazer.</p> - -<p><strong>Melhore ou complemente um site da Web</strong>: utilize um extra para fornecer funcionalidades adicionais no navegador ou informação do seu site da Web. Permita que os utilizadores recolham detalhes das páginas que eles visitam, para melhorar o serviço que oferece.</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/15808/Amazon_add_on.png"></p> - -<p>Exemplos: <a href="https://addons.mozilla.org/en-US/firefox/addon/amazon-browser-bar/">Amazon Assistant para Firefox</a>, <a href="https://addons.mozilla.org/en-US/firefox/addon/onenote-clipper/">OneNote Web Clipper</a>, e <a href="https://addons.mozilla.org/en-US/firefox/addon/grammarly-1/">Grammarly for Firefox</a></p> - -<p><strong>Deixe que os utilizadores mostrem a sua personalidade</strong>: Browser extensions can manipulate the content of pages browsed by a user. Help the user add a favorite logo or picture as the background to every page they visit. Extensions also give you the ability to update the look of the Firefox UI. (Update the Firefox UI using standalone <a href="https://developer.mozilla.org/en-US/Add-ons/Themes/Theme_concepts">theme add-ons</a> too).</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/15809/MyWeb_New_Tab_add_on.png" style="height: 398px; width: 540px;"></p> - -<p>Exemplos: <a href="https://addons.mozilla.org/en-US/firefox/addon/myweb-new-tab/">MyWeb New Tab</a>, <a href="https://addons.mozilla.org/en-US/firefox/addon/tabliss/">Tabliss</a>, e <a href="https://addons.mozilla.org/en-US/firefox/addon/vivaldifox/">VivaldiFox</a></p> - -<p><strong>Adicionar ou remover conteúdo das páginas da Web</strong>: You might want to help users block intrusive ads from web pages, provide access to a travel guide whenever a country or city is mentioned in a web page, or reformat page content to offer a consistent reading experience. With the ability to access and update both a page’s HTML and CSS, you can help users see the web the way they want to.</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/15807/ublock_origin_add_on.png" style="height: 480px; width: 640px;"></p> - -<p>Exemplos: <a href="https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/">uBlock Origin</a>, <a href="https://addons.mozilla.org/en-US/firefox/addon/reader/">Reader</a>, e <a href="https://addons.mozilla.org/en-US/firefox/addon/toolbox-google-play-store/">Toolbox para Google Play Store™</a></p> - -<p><strong>Adicionar ferramentas e novas funcionalidades de navegação</strong>: Add new features to a taskboard, or generate QR code images from URLs, hyperlinks, or page text. With flexible UI options and the power of the WebExtensions APIs you can easily add new features to a browser. And, you can enhance almost any website’s features or functionality, it doesn't have to be your website.</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/15806/QR_Code_Image_Generator_add_on.png"></p> - -<p>Examples: <a href="https://addons.mozilla.org/en-US/firefox/addon/qr-code-image-generator/">QR Code Image Generator</a>, <a href="https://addons.mozilla.org/en-US/firefox/addon/swimlanes-for-trello/">Swimlanes for Trello</a>, and <a href="https://addons.mozilla.org/en-US/firefox/addon/tomato-clock/">Tomato Clock</a></p> - -<p><strong>Jogos</strong>: Offer traditional computer games, with off-line play features, but also explore new game possibilities, for example, by incorporating gameplay into everyday browsing.</p> - -<p> <img alt="" src="https://mdn.mozillademos.org/files/15805/Asteroids_in_Popup_add_on%20.png" style="height: 438px; width: 700px;"></p> - -<p>Examples: <a href="https://addons.mozilla.org/en-US/firefox/addon/asteroids-in-popup/">Asteroids in Popup</a>, <a href="https://addons.mozilla.org/en-US/firefox/addon/solitaire-card-game-new-tab/">Solitaire Card Game New Tab</a>, and <a href="https://addons.mozilla.org/en-US/firefox/addon/2048-prime/">2048 Prime</a>.</p> - -<p><strong>Adicionar ferramentas de desenvolvimento</strong>: You may provide web development tools as your business or have developed a useful technique or approach to web development that you want to share. Either way, you can enhance the built-in Firefox developer tools by adding a new tab to the developer toolbar.</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/15804/aXe_Developer_Tools_add_on.png" style="height: 261px; width: 700px;"></p> - -<p>Examples: <a href="https://addons.mozilla.org/en-US/firefox/addon/web-developer/">Web Developer</a>, <a href="https://addons.mozilla.org/en-US/firefox/addon/react-devtools/">Web React Developer Tools</a>, and <a href="https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/">aXe Developer Tools</a></p> - -<p>Extensions for Firefox are built using the WebExtensions APIs, a cross-browser system for developing extensions. To a large extent, the API is compatible with the <a class="external external-icon" href="https://developer.chrome.com/extensions">extension API</a> supported by Google Chrome and Opera. Extensions written for these browsers will in most cases run in Firefox or Microsoft Edge with just a few <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Porting_a_Google_Chrome_extension">changes</a>. The API is also fully compatible with <a href="/en-US/Firefox/Multiprocess_Firefox">multiprocess Firefox</a>.</p> - -<p>If you have ideas or questions, or need help migrating a legacy add-on to WebExtensions APIs, you can reach us on the <a class="external external-icon" href="https://mail.mozilla.org/listinfo/dev-addons">dev-addons mailing list</a> or in <a href="irc://irc.mozilla.org/extdev">#extdev</a> on <a class="external external-icon" href="https://wiki.mozilla.org/IRC">IRC</a>.</p> - -<h2 id="E_a_seguir">E a seguir?</h2> - -<ul> - <li>Consulte o desenvolvimento de uma extensão simples em <a href="https://developer.mozilla.org/pt-PT/Add-ons/WebExtensions/A_sua_primeira_extensao">A sua primeira extensão</a>.</li> - <li>Saiba sobre a estrutura de uma extensão em <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Anatomy_of_a_WebExtension">Anatomia de uma extensão</a>.</li> - <li>Experimente alguns exemplos de extensões em <a href="/pt-PT/Add-ons/WebExtensions/Exemplos_extensoes">Exemplos de extensões</a>.</li> -</ul> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/what_next_/index.html b/files/pt-pt/mozilla/add-ons/webextensions/what_next_/index.html deleted file mode 100644 index c4ac2a8348..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/what_next_/index.html +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: E a seguir? -slug: Mozilla/Add-ons/WebExtensions/What_next_ -tags: - - Extensão da Web - - Extensões - - Principiante -translation_of: Mozilla/Add-ons/WebExtensions/What_next_ -original_slug: Mozilla/Add-ons/WebExtensions/E_a_seguir ---- -<div>{{AddonSidebar}}</div> - -<p>Agora, irá estar pronto para começar a transformar a sua ideia de uma extensão de navegador em realidade. Antes de começar essa jornada, vale a pena estar ciente de algumas coisas que irão ajudar a facilitar.</p> - -<h2 id="O_seu_ambiente_de_desenvolvimento">O seu ambiente de desenvolvimento</h2> - -<p>You don't need any special development or build environment tools to create browser extensions: It's entirely possible to create great browser extensions with no more than a text editor. However, you may have been developing for the web and have a set of tools and an environment you want to reuse. If you do, you need to be aware of a couple of things.</p> - -<p>If you use minification or obfuscation tools to deliver your final code, you’ll need to provide your source code to <a href="#The_review_process">the AMO review process</a>. Also, the tools you use—those for minification, obfuscation, and build processes—will need to be open source (or offer unlimited free use) and be available to run on the reviewer’s computer (Windows, Mac, or Linux). Unfortunately, our reviewers can't work with commercial or web-based tools.</p> - -<p><a href="/en-US/Add-ons/Source_Code_Submission#About_build_tools">Learn more about build tools</a></p> - -<h2 id="Bibliotecas_de_terceiros">Bibliotecas de terceiros</h2> - -<p>Third-party libraries are a great way to add complex features or functionality to your browser extensions quickly. When you submit an extension to the <a href="#The_review_processv">AMO review process</a>, the process will also consider any third-party libraries used. To streamline the review, make sure you always download third-party libraries from their official website or repository, and if the library is minified provide a link to the source code. Please note that third-party libraries cannot be modified in any way.</p> - -<p><a href="/en-US/Add-ons/Source_Code_Submission">Learn more about submitting source code</a></p> - -<h2 id="O_Acordo_de_Distribuição_do_Extra_do_Firefox">O Acordo de Distribuição do Extra do Firefox</h2> - -<p>Browser extensions need to be signed to install into the release or beta versions of Firefox. Signing takes place in addons.mozilla.org (AMO) and is subject to the terms and conditions of the Firefox Add-on Distribution Agreement. The goal of the agreement is to ensure Firefox users get access to well supported, quality add-ons that enhance the Firefox experience.</p> - -<p><a href="/pt-PT/docs/Mozilla/Add-ons/AMO/Policy/Agreement">Leia o acordo</a></p> - -<p><a href="/en-US/Add-ons/WebExtensions/Distribution">Learn more about signing</a></p> - -<h2 id="O_processo_de_revisão">O processo de revisão</h2> - -<p>When a browser extension is submitted for signing, it's subject to automated review. It may also be subject to a manual review, when the automated review determines that a manual review is needed. Your browser extension won't be signed until it’s passed the automated review and may have its signing revoked if it fails to pass the manual review. The review process follows a strict set of guidelines, so it’s easy to check and avoid any likely review problems.</p> - -<p><a href="/en-US/Add-ons/AMO/Policy/Reviews">Check out the review policy and guidelines</a></p> - -<h2 id="Extensões_do_navegador_em_destaque_no_AMO">Extensões do navegador em destaque no AMO</h2> - -<p>If you choose to list your browser extension on AMO, your extension could be featured on the AMO website, in the Firefox browser’s add-on manager, or elsewhere on a Mozilla website. We've compiled a list of guidelines about how extensions are selected for featuring, by following these guidelines you give your extension the best chance of being featured.</p> - -<p><a href="/pt-PT/docs/Mozilla/Add-ons/AMO/Policy/Em_destaque">Saiba mais sobre como colocar os seus extras em destaque</a></p> - -<h2 id="Continue_a_sua_experiência_de_aprendizagem">Continue a sua experiência de aprendizagem</h2> - -<p>Now you know what lies ahead, it's time to dive into more details about browser extension development. In the sections that follow, you’ll discover:</p> - -<ul> - <li>More about the fundamental concepts behind browser extensions, starting with details on how to <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Using_the_JavaScript_APIs">use the JavaScript APIs</a>.</li> - <li>A guide to the <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface">user interface components</a> available to your browser extensions.</li> - <li>A collection of how-to guides on achieving key tasks in your extensions or making use of the JavaScript APIs.</li> - <li>Information on how to port other browser extensions to Firefox.</li> - <li>Details about the Firefox specific workflows you can use to develop browser extensions.</li> - <li>A full reference guide to the JavaScript APIs.</li> - <li>A full reference guide to the Manifest keys.</li> -</ul> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/your_first_webextension/index.html b/files/pt-pt/mozilla/add-ons/webextensions/your_first_webextension/index.html deleted file mode 100644 index 2b711124ca..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/your_first_webextension/index.html +++ /dev/null @@ -1,154 +0,0 @@ ---- -title: A sua primeira extensão -slug: Mozilla/Add-ons/WebExtensions/Your_first_WebExtension -tags: - - Extensões da Web - - Guía -translation_of: Mozilla/Add-ons/WebExtensions/Your_first_WebExtension -original_slug: Mozilla/Add-ons/WebExtensions/A_sua_primeira_extensao ---- -<div>{{AddonSidebar}}</div> - -<p>Neste artigo, nós iremos abordar a criação de uma extensão para o Firefox, do início até ao fim. A extensão adiciona apenas um contorno vermelho a qualquer página carregada de 'mozilla.org' ou qualquer um dos seus subdomínios.</p> - -<p>O código fonte para este exemplo está no GitHub: <em><a href="https://github.com/mdn/webextensions-examples/tree/master/borderify">borderify</a></em>.</p> - -<p>Primeiro, precisa de ter o Firefox - versão 45 ou superior.</p> - -<h2 id="Escrever_a_extensão">Escrever a extensão</h2> - -<p>Crie uma nova diretoria e vá para a mesma:</p> - -<pre class="brush: bash">mkdir borderify -cd borderify</pre> - -<h3 id="manifest.json">manifest.json</h3> - -<p>Now create a new file called "manifest.json" directly under the "borderify" directory. Give it the following contents:</p> - -<pre class="brush: json">{ - - "manifest_version": 2, - "name": "Borderify", - "version": "1.0", - - "description": "Adds a red border to all webpages matching mozilla.org.", - - "icons": { - "48": "icons/border-48.png" - }, - - "content_scripts": [ - { - "matches": ["*://*.mozilla.org/*"], - "js": ["borderify.js"] - } - ] - -}</pre> - -<ul> - <li>The first three keys: <code><a href="/en-US/Add-ons/WebExtensions/manifest.json/manifest_version">manifest_version</a></code>, <code><a href="/en-US/Add-ons/WebExtensions/manifest.json/name">name</a></code>, and <code><a href="/en-US/Add-ons/WebExtensions/manifest.json/version">version</a></code>, are mandatory and contain basic metadata for the extension.</li> - <li><code><a href="/en-US/Add-ons/WebExtensions/manifest.json/description">description</a></code> is optional, but recommended: it's displayed in the Add-ons Manager.</li> - <li><code><a href="/en-US/Add-ons/WebExtensions/manifest.json/icons">icons</a></code> is optional, but recommended: it allows you to specify an icon for the extension, that will be shown in the Add-ons Manager.</li> -</ul> - -<p>The most interesting key here is <code><a href="/en-US/Add-ons/WebExtensions/manifest.json/content_scripts">content_scripts</a></code>, which tells Firefox to load a script into Web pages whose URL matches a specific pattern. In this case, we're asking Firefox to load a script called "borderify.js" into all HTTP or HTTPS pages served from "mozilla.org" or any of its subdomains.</p> - -<ul> - <li><a href="/en-US/Add-ons/WebExtensions/Content_scripts">Learn more about content scripts.</a></li> - <li><a href="/en-US/Add-ons/WebExtensions/Match_patterns">Learn more about match patterns</a>.</li> -</ul> - -<div class="warning"> -<p><a href="/en-US/Add-ons/WebExtensions/WebExtensions_and_the_Add-on_ID#When_do_you_need_an_Add-on_ID">In some situations you need to specify an ID for your extension</a>. If you do need to specify an add-on ID, include the <code><a href="/en-US/Add-ons/WebExtensions/manifest.json/applications">applications</a></code> key in <code>manifest.json</code> and set its <code>gecko.id</code> property:</p> - -<pre class="brush: json">"applications": { - "gecko": { - "id": "borderify@example.com" - } -}</pre> -</div> - -<h3 id="iconsborder-48.png">icons/border-48.png</h3> - -<p>The extension should have an icon. This will be shown next to the extension's listing in the Add-ons Manager. Our manifest.json promised that we would have an icon at "icons/border-48.png".</p> - -<p>Create the "icons" directory directly under the "borderify" directory. Save an icon there named "border-48.png". You could use <a href="https://github.com/mdn/webextensions-examples/blob/master/borderify/icons/border-48.png">the one from our example</a>, which is taken from the Google Material Design iconset, and is used under the terms of the <a href="https://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike</a> license.</p> - -<p>If you choose to supply your own icon, It should be 48x48 pixels. You could also supply a 96x96 pixel icon, for high-resolution displays, and if you do this it will be specified as the <code>96</code> property of the <code>icons</code> object in manifest.json:</p> - -<pre class="brush: json">"icons": { - "48": "icons/border-48.png", - "96": "icons/border-96.png" -}</pre> - -<p>Alternatively, you could supply an SVG file here, and it will be scaled correctly. (Though: if you're using SVG and your icon includes text, you may want to use your SVG editor's "convert to path" tool to flatten the text, so that it scales with a consistent size/position.)</p> - -<ul> - <li><a href="/pt-PT/Add-ons/WebExtensions/manifest.json/icones">Saiba mais sobre a especificação de ícones (icons).</a></li> -</ul> - -<h3 id="borderify.js">borderify.js</h3> - -<p>Finally, create a file called "borderify.js" directly under the "borderify" directory. Give it this content:</p> - -<pre class="brush: js">document.body.style.border = "5px solid red";</pre> - -<p>This script will be loaded into the pages that match the pattern given in the <code>content_scripts</code> manifest.json key. The script has direct access to the document, just like scripts loaded by the page itself.</p> - -<ul> - <li><a href="/en-US/Add-ons/WebExtensions/Content_scripts">Learn more about content scripts.</a></li> -</ul> - -<h2 id="Testá-la">Testá-la</h2> - -<p>Primeiro, reverifique que tem os ficheiros corretos nos locais certos:</p> - -<pre>borderify/ - icons/ - border-48.png - borderify.js - manifest.json</pre> - -<h3 id="Instalar">Instalar</h3> - -<p>Open "about:debugging" in Firefox, click "Load Temporary Add-on" and select any file in your extension's directory:</p> - -<p>{{EmbedYouTube("cer9EUKegG4")}}</p> - -<p>The extension will now be installed, and will stay until you restart Firefox.</p> - -<p>Alternatively, you can run the extension from the command line using the <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Getting_started_with_web-ext">web-ext</a> tool.</p> - -<h3 id="Testar">Testar</h3> - -<p>Now try visiting a page under "mozilla.org", and you should see the red border round the page:</p> - -<p>{{EmbedYouTube("rxBQl2Z9IBQ")}}</p> - -<div class="note"> -<p>Don't try it on addons.mozilla.org, though! Content scripts are currently blocked on that domain.</p> -</div> - -<p>Try experimenting a bit. Edit the content script to change the color of the border, or do something else to the page content. Save the content script, then reload the extensions's files by clicking the "Reload" button in about:debugging. You can see the changes right away:</p> - -<p>{{EmbedYouTube("NuajE60jfGY")}}</p> - -<ul> - <li><a href="/en-US/Add-ons/WebExtensions/Temporary_Installation_in_Firefox">Learn more about loading extensions</a></li> -</ul> - -<h2 id="Empacotar_e_publicação">Empacotar e publicação</h2> - -<p>Para que as outras pessoas utilizem a sua extensão, precisa de empacotá-la e enviá-la para a assinar na Mozilla. Para saber mais sobre isto, consulte <a href="/pt-PT/Add-ons/WebExtensions/Publicar_a_sua_extensao">"Publicar a sua extensão"</a>.</p> - -<h2 id="E_a_seguir">E a seguir?</h2> - -<p>Agora tem uma idéia do processo de desenvolvimento de uma <strong>Extensão da Web</strong> para o Firefox, tente:</p> - -<ul> - <li><a href="/en-US/Add-ons/WebExtensions/Anatomy_of_a_WebExtension">reading more about the anatomy of an extension</a></li> - <li><a href="/en-US/Add-ons/WebExtensions/Your_second_WebExtension">writing a more complex extension</a></li> - <li><a href="/en-US/Add-ons/WebExtensions/API">reading about the JavaScript APIs available for extensions.</a></li> -</ul> diff --git a/files/pt-pt/mozilla/add-ons/webextensions/your_second_webextension/index.html b/files/pt-pt/mozilla/add-ons/webextensions/your_second_webextension/index.html deleted file mode 100644 index 9d3c22efac..0000000000 --- a/files/pt-pt/mozilla/add-ons/webextensions/your_second_webextension/index.html +++ /dev/null @@ -1,461 +0,0 @@ ---- -title: A sua segunda extensão -slug: Mozilla/Add-ons/WebExtensions/Your_second_WebExtension -tags: - - Extensões da Web -translation_of: Mozilla/Add-ons/WebExtensions/Your_second_WebExtension -original_slug: Mozilla/Add-ons/WebExtensions/A_sua_segunda_extensao ---- -<div>{{AddonSidebar}} -<p>Se já leu o artigo da <a href="/pt-PT/Add-ons/WebExtensions/A_sua_primeira_extensao">A sua primeira extens</a>ão, já tem uma ideia de como escrever uma extensão. Neste artigo, nós iremos escrever uma extensão um pouco mais complexa que demonstra algumas mais das APIs. <br> - <br> - A extensão adiciona um novo botão à barra de ferramentas do Firefox. Quando o utilizador clica no botão, nós exibimos uma janela que lhes permite escolher um animal. Uma vez que eles escolhem um animal, nós iremos substituir o conteúdo da página atual com uma fotografia do animal escolhido. <br> - <br> - Para implementar isto, nós iremos:.</p> - -<p>To implement this, we will:</p> - -<ul> - <li><strong>define a <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Browser_action">browser action</a>, which is a button attached to the Firefox toolbar</strong>.<br> - For the button we'll supply: - <ul> - <li>an icon, called "beasts-32.png"</li> - <li>a popup to open when the button is pressed. The popup will include HTML, CSS, and JavaScript.</li> - </ul> - </li> - <li><strong>define an icon for the extension</strong>, called "beasts-48.png". This will be shown in the Add-ons Manager.</li> - <li><strong>write a content script, "beastify.js" that will be injected into web pages</strong>.<br> - This is the code that will actually modify the pages.</li> - <li><strong>package some images of the animals, to replace images in the web page</strong>.<br> - We'll make the images "web accessible resources" so the web page can refer to them.</li> -</ul> - -<p>You could visualise the overall structure of the extension like this:</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/13671/Untitled-1.png" style="display: block; height: 1200px; margin-left: auto; margin-right: auto; width: 860px;"></p> - -<p>It's a simple extension, but shows many of the basic concepts of the WebExtensions API:</p> - -<ul> - <li>adding a button to the toolbar</li> - <li>defining a popup panel using HTML, CSS, and JavaScript</li> - <li>injecting content scripts into web pages</li> - <li>communicating between content scripts and the rest of the extension</li> - <li>packaging resources with your extension that can be used by web pages</li> -</ul> - -<p>You can find <a href="https://github.com/mdn/webextensions-examples/tree/master/beastify">complete source code for the extension on GitHub</a>.</p> - -<p>To write this extension, you'll need Firefox 45 or newer.</p> - -<h2 id="Escrever_a_extensão">Escrever a extensão</h2> - -<p>Create a new directory and navigate to it:</p> - -<pre class="brush: bash">mkdir beastify -cd beastify</pre> - -<h3 id="manifest.json">manifest.json</h3> - -<p>Now create a new file called "manifest.json", and give it the following contents:</p> - -<pre class="brush: json">{ - - "manifest_version": 2, - "name": "Beastify", - "version": "1.0", - - "description": "Adds a browser action icon to the toolbar. Click the button to choose a beast. The active tab's body content is then replaced with a picture of the chosen beast. See https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Examples#beastify", - "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/beastify", - "icons": { - "48": "icons/beasts-48.png" - }, - - "permissions": [ - "activeTab" - ], - - "browser_action": { - "default_icon": "icons/beasts-32.png", - "default_title": "Beastify", - "default_popup": "popup/choose_beast.html" - }, - - "web_accessible_resources": [ - "beasts/frog.jpg", - "beasts/turtle.jpg", - "beasts/snake.jpg" - ] - -} -</pre> - -<ul> - <li>The first three keys: <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/manifest_version">manifest_version</a></code>, <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/name">name</a></code>, and <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/version">version</a></code>, are mandatory and contain basic metadata for the extension.</li> - <li><code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/description">description</a></code> and <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/homepage_url">homepage_url</a></code> are optional, but recommended: they provide useful information about the extension.</li> - <li><code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/icons">icons</a></code> is optional, but recommended: it allows you to specify an icon for the extension, that will be shown in the Add-ons Manager.</li> - <li><code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions">permissions</a></code> lists permissions the extension needs. We're just asking for the <a href="/en-US/Add-ons/WebExtensions/manifest.json/permissions#activeTab_permission"><code>activeTab</code> permission</a> here.</li> - <li><code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_action">browser_action</a></code> specifies the toolbar button. We're supplying three pieces of information here: - <ul> - <li><code>default_icon</code> is mandatory, and points to the icon for the button</li> - <li><code>default_title</code> is optional, and will be shown in a tooltip</li> - <li><code>default_popup</code> is used if you want a popup to be shown when the user clicks the button. We do, so we've included this key and made it point to an HTML file included with the extension.</li> - </ul> - </li> - <li><code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/web_accessible_resources">web_accessible_resources</a></code> lists files that we want to make accessible to web pages. Since the extension replaces the content in the page with images we've packaged with the extension, we need to make these images accessible to the page.</li> -</ul> - -<p>Note that all paths given are relative to manifest.json itself.</p> - -<h3 id="O_ícone">O ícone</h3> - -<p>The extension should have an icon. This will be shown next to the extension's listing in the Add-ons Manager (you can open this by visiting the URL "about:addons"). Our manifest.json promised that we would have an icon for the toolbar at "icons/beasts-48.png".</p> - -<p>Create the "icons" directory and save an icon there named "beasts-48.png". You could use <a href="https://github.com/mdn/webextensions-examples/blob/master/beastify/icons/beasts-48.png">the one from our example</a>, which is taken from the <a href="https://www.iconfinder.com/iconsets/free-retina-icon-set">Aha-Soft’s Free Retina iconset</a>, and used under the terms of its <a href="http://www.aha-soft.com/free-icons/free-retina-icon-set/">license</a>.</p> - -<p>If you choose to supply your own icon, It should be 48x48 pixels. You could also supply a 96x96 pixel icon, for high-resolution displays, and if you do this it will be specified as the <code>96</code> property of the <code>icons</code> object in manifest.json:</p> - -<pre class="brush: json line-numbers language-json"><code class="language-json"><span class="key token">"icons":</span> <span class="punctuation token">{</span> - <span class="key token">"48":</span> <span class="string token">"icons/beasts-48.png"</span><span class="punctuation token">,</span> - <span class="key token">"96":</span> <span class="string token">"icons/beasts-96.png"</span> -<span class="punctuation token">}</span></code></pre> - -<h3 id="O_botão_de_barra_de_ferramentas">O botão de barra de ferramentas</h3> - -<p>The toolbar button also needs an icon, and our manifest.json promised that we would have an icon for the toolbar at "icons/beasts-32.png".</p> - -<p>Save an icon named "beasts-32.png" in the "icons" directory. You could use <a href="https://github.com/mdn/webextensions-examples/blob/master/beastify/icons/beasts-32.png">the one from our example</a>, which is taken from the <a href="http://www.iconbeast.com/free">IconBeast Lite icon set</a> and used under the terms of its <a href="http://www.iconbeast.com/faq/">license</a>.</p> - -<p>If you don't supply a popup, then a click event is dispatched to your extension when the user clicks the button. If you do supply a popup, the click event is not dispatched, but instead, the popup is opened. We want a popup, so let's create that next.</p> - -<h3 id="A_janela_(popup)">A janela (popup)</h3> - -<p>The function of the popup is to enable the user to choose one of three beasts.</p> - -<p>Create a new directory called "popup" under the extension root. This is where we'll keep the code for the popup. The popup will consist of three files:</p> - -<ul> - <li><strong><code>choose_beast.html</code></strong> defines the content of the panel</li> - <li><strong><code>choose_beast.css</code></strong> styles the content</li> - <li><strong><code>choose_beast.js</code></strong> handles the user's choice by running a content script in the active tab</li> -</ul> - -<pre class="brush: bash">mkdir popup -cd popup -touch choose_beast.html choose_beast.css choose_beast.js -</pre> - -<h4 id="choose_beast.html">choose_beast.html</h4> - -<p>The HTML file looks like this:</p> - -<pre class="brush: html"><!DOCTYPE html> - -<html> - <head> - <meta charset="utf-8"> - <link rel="stylesheet" href="choose_beast.css"/> - </head> - -<body> - <div id="popup-content"> - <div class="button beast">Frog</div> - <div class="button beast">Turtle</div> - <div class="button beast">Snake</div> - <div class="button reset">Reset</div> - </div> - <div id="error-content" class="hidden"> - <p>Can't beastify this web page.</p><p>Try a different page.</p> - </div> - <script src="choose_beast.js"></script> -</body> - -</html> -</pre> - -<p>We have a <code><a href="/en-US/docs/Web/HTML/Element/div"><div></a></code> element with an ID of <code>"popup-content"</code> that contains an element for each animal choice. We have another <code><div></code> with an ID of <code>"error-content"</code> and a class <code>"hidden"</code>. We'll use that in case there's a problem initializing the popup.</p> - -<p>Note that we include the CSS and JS files from this file, just like a web page.</p> - -<h4 id="choose_beast.css">choose_beast.css</h4> - -<p>The CSS fixes the size of the popup, ensures that the three choices fill the space, and gives them some basic styling. It also hides elements with <code>class="hidden"</code>: this means that our <code>"error-content"</code> <code><div></code> will be hidden by default.</p> - -<pre class="brush: css">html, body { - width: 100px; -} - -.hidden { - display: none; -} - -.button { - margin: 3% auto; - padding: 4px; - text-align: center; - font-size: 1.5em; - cursor: pointer; -} - -.beast:hover { - background-color: #CFF2F2; -} - -.beast { - background-color: #E5F2F2; -} - -.reset { - background-color: #FBFBC9; -} - -.reset:hover { - background-color: #EAEA9D; -} - -</pre> - -<h4 id="choose_beast.js">choose_beast.js</h4> - -<p>Here's the JavaScript for the popup:</p> - -<pre class="brush: js">/** - * CSS to hide everything on the page, - * except for elements that have the "beastify-image" class. - */ -const hidePage = `body > :not(.beastify-image) { - display: none; - }`; - -/** - * Listen for clicks on the buttons, and send the appropriate message to - * the content script in the page. - */ -function listenForClicks() { - document.addEventListener("click", (e) => { - - /** - * Given the name of a beast, get the URL to the corresponding image. - */ - function beastNameToURL(beastName) { - switch (beastName) { - case "Frog": - return browser.extension.getURL("beasts/frog.jpg"); - case "Snake": - return browser.extension.getURL("beasts/snake.jpg"); - case "Turtle": - return browser.extension.getURL("beasts/turtle.jpg"); - } - } - - /** - * Insert the page-hiding CSS into the active tab, - * then get the beast URL and - * send a "beastify" message to the content script in the active tab. - */ - function beastify(tabs) { - browser.tabs.insertCSS({code: hidePage}).then(() => { - let url = beastNameToURL(e.target.textContent); - browser.tabs.sendMessage(tabs[0].id, { - command: "beastify", - beastURL: url - }); - }); - } - - /** - * Remove the page-hiding CSS from the active tab, - * send a "reset" message to the content script in the active tab. - */ - function reset(tabs) { - browser.tabs.removeCSS({code: hidePage}).then(() => { - browser.tabs.sendMessage(tabs[0].id, { - command: "reset", - }); - }); - } - - /** - * Just log the error to the console. - */ - function reportError(error) { - console.error(`Could not beastify: ${error}`); - } - - /** - * Get the active tab, - * then call "beastify()" or "reset()" as appropriate. - */ - if (e.target.classList.contains("beast")) { - browser.tabs.query({active: true, currentWindow: true}) - .then(beastify) - .catch(reportError); - } - else if (e.target.classList.contains("reset")) { - browser.tabs.query({active: true, currentWindow: true}) - .then(reset) - .catch(reportError); - } - }); -} - -/** - * There was an error executing the script. - * Display the popup's error message, and hide the normal UI. - */ -function reportExecuteScriptError(error) { - document.querySelector("#popup-content").classList.add("hidden"); - document.querySelector("#error-content").classList.remove("hidden"); - console.error(`Failed to execute beastify content script: ${error.message}`); -} - -/** - * When the popup loads, inject a content script into the active tab, - * and add a click handler. - * If we couldn't inject the script, handle the error. - */ -browser.tabs.executeScript({file: "/content_scripts/beastify.js"}) -.then(listenForClicks) -.catch(reportExecuteScriptError); - -</pre> - -<p>The place to start here is line 96. The popup script executes a content script in the active tab as soon as the popup is loaded, using the <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/executeScript">browser.tabs.executeScript()</a></code> API. If executing the content script is successful, then the content script will stay loaded in the page until the tab is closed or the user navigates to a different page.</p> - -<p>A common reason the <code>browser.tabs.executeScript()</code> call might fail is that you can't execute content scripts in all pages. For example, you can't execute them in privileged browser pages like about:debugging, and you can't execute them on pages in the <a href="https://addons.mozilla.org/">addons.mozilla.org</a> domain. If it does fail, <code>reportExecuteScriptError()</code> will hide the <code>"popup-content"</code> <code><div></code>, show the <code>"error-content"</code> <code><div></code>, and log an error to the <a href="/en-US/Add-ons/WebExtensions/Debugging">console</a>.</p> - -<p>If executing the content script is successful, we call <code>listenForClicks()</code>. This listens for clicks on the popup.</p> - -<ul> - <li>If the click was on a button with <code>class="beast"</code>, then we call <code>beastify()</code>.</li> - <li>If the click was on a button with <code>class="reset"</code>, then we call <code>reset()</code>.</li> -</ul> - -<p>The <code>beastify()</code> function does three things:</p> - -<ul> - <li>map the button clicked to a URL pointing to an image of a particular beast</li> - <li>hide the page's whole content by injecting some CSS, using the <code><a href="/en-US/Add-ons/WebExtensions/API/tabs/insertCSS">browser.tabs.insertCSS()</a></code> API</li> - <li>send a "beastify" message to the content script using the <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/sendMessage">browser.tabs.sendMessage()</a></code> API, asking it to beastify the page, and passing it the URL to the beast image.</li> -</ul> - -<p>The <code>reset()</code> function essentially undoes a beastify:</p> - -<ul> - <li>remove the CSS we added, using the <code><a href="/en-US/Add-ons/WebExtensions/API/tabs/removeCSS">browser.tabs.removeCSS()</a></code> API</li> - <li>send a "reset" message to the content script asking it to reset the page.</li> -</ul> - -<h3 id="O_script_de_conteúdo">O <em>script</em> de conteúdo</h3> - -<p>Create a new directory, under the extension root, called "content_scripts" and create a new file in it called "beastify.js", with the following contents:</p> - -<pre class="brush: js">(function() { - /** - * Check and set a global guard variable. - * If this content script is injected into the same page again, - * it will do nothing next time. - */ - if (window.hasRun) { - return; - } - window.hasRun = true; - - /** - * Given a URL to a beast image, remove all existing beasts, then - * create and style an IMG node pointing to - * that image, then insert the node into the document. - */ - function insertBeast(beastURL) { - removeExistingBeasts(); - let beastImage = document.createElement("img"); - beastImage.setAttribute("src", beastURL); - beastImage.style.height = "100vh"; - beastImage.className = "beastify-image"; - document.body.appendChild(beastImage); - } - - /** - * Remove every beast from the page. - */ - function removeExistingBeasts() { - let existingBeasts = document.querySelectorAll(".beastify-image"); - for (let beast of existingBeasts) { - beast.remove(); - } - } - - /** - * Listen for messages from the background script. - * Call "beastify()" or "reset()". - */ - browser.runtime.onMessage.addListener((message) => { - if (message.command === "beastify") { - insertBeast(message.beastURL); - } else if (message.command === "reset") { - removeExistingBeasts(); - } - }); - -})(); -</pre> - -<p>The first thing the content script does is to check for a global variable <code>window.hasRun</code>: if it's set the script returns early, otherwise it sets <code>window.hasRun</code> and continues. The reason we do this is that every time the user opens the popup, the popup executes a content script in the active tab, so we could have multiple instances of the script running in a single tab. If this happens, we need to make sure that only the first instance is actually going to do anything.</p> - -<p>After that, the place to start is line 40, where the content script listens for messages from the popup, using the <code><a href="/en-US/Add-ons/WebExtensions/API/runtime/onMessage">browser.runtime.onMessage</a></code> API. We saw above that the popup script can send two different sorts of messages: "beastify" and "reset".</p> - -<ul> - <li>if the message is "beastify", we expect it to contain a URL pointing to a beast image. We remove any beasts that might have been added by previous "beastify" calls, then construct and append an <code><a href="/en-US/docs/Web/HTML/Element/img"><img></a></code> element whose <code>src</code> attribute is set to the beast URL.</li> - <li>if the message is "reset", we just remove any beasts that might have been added.</li> -</ul> - -<h3 id="As_feras">As feras</h3> - -<p>Finally, we need to include the images of the beasts.</p> - -<p>Create a new directory called "beasts", and add the three images in that directory, with the appropriate names. You can get the images from <a href="https://github.com/mdn/webextensions-examples/tree/master/beastify/beasts">the GitHub repository</a>, or from here:</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/11459/frog.jpg" style="display: inline-block; height: 200px; margin: 20px; width: 200px;"><img alt="" src="https://mdn.mozillademos.org/files/11461/snake.jpg" style="display: inline-block; height: 200px; margin: 20px; width: 200px;"><img alt="" src="https://mdn.mozillademos.org/files/11463/turtle.jpg" style="display: inline-block; height: 200px; margin: 20px; width: 200px;"></p> - -<h2 id="Testar_a_extensão">Testar a extensão</h2> - -<p>First, double check that you have the right files in the right places:</p> - -<pre>beastify/ - - beasts/ - frog.jpg - snake.jpg - turtle.jpg - - content_scripts/ - beastify.js - - icons/ - beasts-32.png - beasts-48.png - - popup/ - choose_beast.css - choose_beast.html - choose_beast.js - - manifest.json</pre> - -<p>Starting in Firefox 45, you can install extensions temporarily from disk.</p> - -<p>Open "about:debugging" in Firefox, click "Load Temporary Add-on", and select your manifest.json file. You should then see the extension's icon appear in the Firefox toolbar:</p> - -<p>{{EmbedYouTube("sAM78GU4P34")}}</p> - -<p>Open a web page, then click the icon, select a beast, and see the web page change:</p> - -<p>{{EmbedYouTube("YMQXyAQSiE8")}}</p> - -<h2 id="Programae_a_partir_da_linha_de_comando">Programae a partir da linha de comando</h2> - -<p>Pode automatizar o passo da instalação temporária utilizando a ferramenta <a href="/pt-PT/Add-ons/WebExtensions/Primeiros_passos_com_web-ext">web-ext</a>. Experimente isto:</p> - -<pre class="brush: bash">cd beastify -web-ext run</pre> -</div> diff --git a/files/pt-pt/mozilla/firefox/index.html b/files/pt-pt/mozilla/firefox/index.html deleted file mode 100644 index 2e57b0d4f0..0000000000 --- a/files/pt-pt/mozilla/firefox/index.html +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: Firefox -slug: Mozilla/Firefox -tags: - - Firefox - - Landing - - Mozilla -translation_of: Mozilla/Firefox ---- -<div>{{FirefoxSidebar}}</div> - -<p><a href="https://www.mozilla.org/firefox/">Firefox</a> é o navegador popular da Web da Mozilla, disponível para múltiplas plataformas, incluindo Linux, OS X e Windows para PC e em todos os dispositivos móveis Android e iOS. Com ampla compatibilidade, as tecnologias da Web mais recentes, e ferramentas de programação poderosas, o Firefox é uma excelente escolha, tanto para os programadores da Web como para os utilizadores finais.</p> - -<p>O Firefox é um projeto de código aberto; a maior parte do código é fornecido pela nossa comunidade enorme de voluntários. Aqui pode aprender sobre como contribuir para o projeto Firefox e irá encontrar também hiperligações para informação sobre a criação de <strong>Extras</strong> do Firefox, utilizando as ferramentas de programador no Firefox, e outros tópicos.</p> - -<div class="summary"> -<p>Aprenda a criar <strong>Extras</strong> para o <a href="https://www.mozilla.org/pt-PT/firefox/">Firefox</a>, como desenvolver e criar o próprio Firefox, e como os internos do Firefox e os respetivos subprojetos funcionam.</p> -</div> - -<ul class="card-grid"> - <li><span>Notas de lançamento do programador</span> - - <p><a href="/en-US/Firefox/Releases">Notas de lançamento focadas no Programador</a>; saiba quais as novas funcionalidades que chegam para ambos os websites e para os extras em cada versão do Firefox.</p> - </li> - <li><span>Documentação do projeto</span> - <p>Obtenha informação detalhada sobre <a href="/en-US/docs/Mozilla">os internos do Firefox</a> e o sistema operativo, para que você se possa orientar no código.</p> - </li> - <li><span>Guia do pogramador</span> - <p>O nosso <a href="/en-US/docs/Developer_Guide">guia do programador</a> fornece detalhes sobre como obter e compilar o código fonte do Firefox, como você se orientar, e como contribuir para o projeto.</p> - </li> -</ul> - -<h2 id="Canais_do_Firefox">Canais do Firefox</h2> - -<p>O Firefox está disponível em cinco <strong>canais</strong>.</p> - -<h3 id="Firefox_Nightly">Firefox Nightly</h3> - -<p>Todas as noites nós contruimos o Firefox a partir do último código disponível em <a href="/en-US/docs/mozilla-central">mozilla-central</a>. Estas configurações destinam-se aos programadores do Firefox ou para aqueles que desejam experimentar as últimas funcionalidades inovadoras enquanto estas estão ainda em fase de desenvolvimento.</p> - -<p><a href="https://download.mozilla.org/?product=firefox-nightly-stub&os=win&lang=pt-PT" style="width: 250px; display: block; margin-left: auto; margin-right: auto; padding: 10px; text-align: center; border-radius: 4px; background-color: #81BC2E; white-space: nowrap; color: white; text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.25); box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.2), 0px -1px 0px 0px rgba(0, 0, 0, 0.3) inset;">Transferir Firefox Nightly</a></p> - -<h3 id="Edição_do_Programador_do_Firefox">Edição do Programador do Firefox</h3> - -<p>Esta é uma versão do Firefox personalizada para programadores. A cada seis semanas, nós selecionamos as funcionalidades do Firefox Nightly que estão estáveis o suficiente e criamos uma nova versão da Edição do Programador do Firefox. Nós adicionamos também algumas funcionalidades extra para programadores, que estão apenas disponíveis neste canal.</p> - -<p><a href="/en-US/Firefox/Developer_Edition">Saiba mais acerca da Edição do Programador do Firefox</a>.</p> - -<p><a href="https://download.mozilla.org/?product=firefox-devedition-stub&os=win&lang=pt-PT" style="width: 250px; display: block; margin-left: auto; margin-right: auto; padding: 10px; text-align: center; border-radius: 4px; background-color: #81BC2E; white-space: nowrap; color: white; text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.25); box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.2), 0px -1px 0px 0px rgba(0, 0, 0, 0.3) inset;">Transferir Firefox Developer Edition</a></p> - -<h3 id="Firefox_Beta">Firefox Beta</h3> - -<p>Após utilizar a Edição do Programador do Firefox por seis semanas, nós selecionamos as funcionalidades que estão estáveis o suficiente e criamos uma nova versão do Firefox Beta. As configurações do Firefox Beta destinam-se a entusiastas do Firefox para testar as funcionalidades destinadas a serem lançadas na próxima versão do Firefox.</p> - -<p><a href="https://download.mozilla.org/?product=firefox-beta-stub&os=win&lang=pt-PT" style="width: 250px; display: block; margin-left: auto; margin-right: auto; padding: 10px; text-align: center; border-radius: 4px; background-color: #81BC2E; white-space: nowrap; color: white; text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.25); box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.2), 0px -1px 0px 0px rgba(0, 0, 0, 0.3) inset;">Transferir Firefox Beta</a></p> - -<h3 id="Firefox">Firefox</h3> - -<p>Após estabilizar para outras seis semanas com a versão Beta, nós estamos prontos para lançar as novas funcionalidades para milhões de utilizadores numa nova versão de lançamento do Firefox.</p> - -<p><a href="https://www.mozilla.org/pt-PT/firefox/" style="width: 250px; display: block; margin-left: auto; margin-right: auto; padding: 10px; text-align: center; border-radius: 4px; background-color: #81BC2E; white-space: nowrap; color: white; text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.25); box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.2), 0px -1px 0px 0px rgba(0, 0, 0, 0.3) inset;">Transferir Firefox</a></p> - -<h3 id="Firefox_Extended_Support_Release_(ESR)">Firefox Extended Support Release (ESR)</h3> - -<p>Firefox ESR is the long-term support edition of Firefox for desktop for use by organizations including schools, universities, businesses and others who need extended support for mass deployments.</p> - -<p><a href="/en-US/Firefox/Firefox_ESR">Learn more about Firefox Extended Support Release</a>.</p> - -<p><a href="https://www.mozilla.org/pt-PT/firefox/organizations/all/" style="width: 250px; display: block; margin-left: auto; margin-right: auto; padding: 10px; text-align: center; border-radius: 4px; background-color: #81BC2E; white-space: nowrap; color: white; text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.25); box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.2), 0px -1px 0px 0px rgba(0, 0, 0, 0.3) inset;">Transferir Firefox ESR</a></p> - -<h2 id="Perfis_do_Firefox">Perfis do Firefox</h2> - -<p>If you find yourself using multiple Firefox channels—or just multiple configurations—on a regular basis, you should read how to <a href="/en-US/docs/Mozilla/Firefox/Multiple_profiles">use multiple Firefox profiles</a> by turning Firefox's Profile Manager and other profile management tools to your advantage.</p> diff --git a/files/pt-pt/mozilla/firefox/releases/1.5/index.html b/files/pt-pt/mozilla/firefox/releases/1.5/index.html deleted file mode 100644 index 29dab49ca6..0000000000 --- a/files/pt-pt/mozilla/firefox/releases/1.5/index.html +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: Firefox 1.5 para Desenvolvedores -slug: Mozilla/Firefox/Releases/1.5 -translation_of: Mozilla/Firefox/Releases/1.5 -original_slug: Firefox_1.5_para_Desenvolvedores ---- -<div>{{FirefoxSidebar}}</div><p> </p> - -<h3 id="Firefox_1.5" name="Firefox_1.5">Firefox 1.5</h3> - -<p>Como o primeiro lançamento no ciclo de desenvolvimento de produto Firefox 1.5 dedicada a desenvolvedores web e autores de Extensões para teste de compatibilidade, Firefox 1.5, baseado no motor <a href="/pt/Gecko" title="pt/Gecko">Gecko</a> 1.8, melhora o já melhor na classe suporte de normas e providencia novas capacidades para suportar a próxima geração de aplicações web. Firefox 1.5 tem como características, melhor suporte para <a href="/pt/CSS" title="pt/CSS">CSS</a> 2 e <a href="/pt/CSS" title="pt/CSS">CSS</a> 3, APIs para gráficos 2D com scripts e programáveis com <a href="/pt/SVG" title="pt/SVG">SVG</a> 1.1 e <canvas>, <a href="/pt/XForms" title="pt/XForms">XForms</a> e eventos XML, e satisfatórios realces em <a href="/pt/DHTML" title="pt/DHTML">DHTML</a>, <a href="/pt/JavaScript" title="pt/JavaScript">JavaScript</a> e <a href="/pt/DOM" title="pt/DOM">DOM</a>.</p> - -<p>Firefox 1.5 está disponível para o download em: <a class="external" href="http://www.mozilla.com/firefox/" rel="freelink">http://www.mozilla.com/firefox/</a></p> - -<h3 id="Ferramentas_para_Desenvolvedores" name="Ferramentas_para_Desenvolvedores">Ferramentas para Desenvolvedores</h3> - -<p>Diversas ferramentas e extensões do browser estão disponíveis para ajudar no suporte do Firefox 1.5 aos desenvolvedores.</p> - -<ul> - <li><a href="/en/DOM_Inspector">DOM Inspector</a>, esta ferramenta permite que os colaboradores inspecionem e modifiquem documentos sem ter que editar o documento diretamente. O DOM Inspector está disponível como parte da instação personalizada do Firefox 1.5 nas Ferramentas para Desenvolvedores.</li> - <li>Console do Javascript, uma ferramenta para escrever e testar o código Javascript, exibe os erros do Javascript e CSS em uma página.</li> - <li>Exibir Código-fonte, com características de procura e destaque na sintaxe.</li> - <li><a class="link-https" href="https://addons.mozilla.org/extensions/showlist.php?application=firefox&category=Developer%20Tools">Extensões do browser</a> incluíndo a <a href="/en/Web_Developer_Firefox_Extension_(external)">Web Developer toolbar</a>, <a href="/en/Live_HTTP_Headers_(external)">Live HTTP Headers</a>, <a href="/en/HTML_Validator_(external)">HTML Validator</a> e muito mais.</li> -</ul> - -<p><strong>Nota:</strong> Algumas extensões não suportam atualmente o Firefox 1.5 e serão desabilitadas automaticamente.</p> diff --git a/files/pt-pt/mozilla/firefox/releases/2/index.html b/files/pt-pt/mozilla/firefox/releases/2/index.html deleted file mode 100644 index 3ba2adba19..0000000000 --- a/files/pt-pt/mozilla/firefox/releases/2/index.html +++ /dev/null @@ -1,94 +0,0 @@ ---- -title: Firefox 2 para desenvolvedores -slug: Mozilla/Firefox/Releases/2 -translation_of: Mozilla/Firefox/Releases/2 -original_slug: Firefox_2_para_desenvolvedores ---- -<div>{{FirefoxSidebar}}</div><h2 id="Novas_caracter.C3.ADsticas_para_desenvolvedores_no_Firefox_2" name="Novas_caracter.C3.ADsticas_para_desenvolvedores_no_Firefox_2">Novas características para desenvolvedores no Firefox 2</h2> - -<p>Firefox 2 introduz uma vasta gama de características e potencialidades novas.</p> - -<p><em>Se não houver um link para algum título abaixo, é um título provisório do MDC até que o artigo esteja escrito.</em></p> - -<h3 id="Para_desenvolvedores_de_aplica.C3.A7.C3.B5es_e_web_sites" name="Para_desenvolvedores_de_aplica.C3.A7.C3.B5es_e_web_sites">Para desenvolvedores de aplicações e web sites</h3> - -<dl> - <dt><a class="external" href="http://wiki.mozilla.org/Microsummaries">Microsummaries</a></dt> - <dd>Microsummaries são uma nova maneira de web sites fornecerem material de referência rápida para usuários. Páginas onde existe um gerador de microsummary podem ser adicionadas à barra de favoritos com conteúdo que atualiza periodicamente baseado na especificação microsummary.</dd> -</dl> - -<dl> - <dt><a href="/en/Creating_a_Microsummary">Creating a Microsummary</a></dt> - <dd>Um tutorial sobre como criar um gerador microsummary.</dd> -</dl> - -<dl> - <dt><a href="/en/Creating_MozSearch_plugins">Creating MozSearch plugins</a></dt> - <dd>Firefox 2 suporta MozSearch, um formato plugin de pesquisa baseado no OpenSearch.</dd> -</dl> - -<dl> - <dt><a href="/en/OpenSearch_support_in_Firefox">OpenSearch support in Firefox</a></dt> - <dd>Firefox 2 suporta também o formato Amazon A9's OpenSearch para plugins de pesquisa.</dd> -</dl> - -<dl> - <dt><a href="/en/Supporting_search_suggestions_in_search_plugins">Supporting search suggestions in search plugins</a></dt> - <dd>Como fazer seu plugin MozSearch suportar sugestões de pesquisa, que aparecem em uma caixa popup ao digitar na barra da busca.</dd> -</dl> - -<dl> - <dt><a href="/en/New_in_JavaScript_1.7">New in JavaScript 1.7</a></dt> - <dd>Firefox 2 suporta JavaScript 1.7, que possui novas características incluindo <code>let</code>, destructuring assignment, geradores e iteradores, e array comprehensions.</dd> -</dl> - -<dl> - <dt><a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#scs-client-side">WHATWG Client-side session and persistent storage</a></dt> - <dd>Sessão client-side e armazenamento permanente permitem que aplicações web armazenem dados estruturados no lado do cliente.</dd> -</dl> - -<dl> - <dt><a href="/en/SVG_in_Firefox">SVG in Firefox</a></dt> - <dd>Firefox 2 tem suporte à SVG (Scalable Vector Graphics) melhorado, implementando o elemento <code><textPath></code> e adicionando suporte a alguns atributos não suportados previamente.</dd> -</dl> - -<h3 id="Para_desenvolvedores_de_extens.C3.B5es_e_XUL" name="Para_desenvolvedores_de_extens.C3.B5es_e_XUL">Para desenvolvedores de extensões e XUL</h3> - -<dl> - <dt><a href="/en/Session_restore_API">Session restore API</a></dt> - <dd>Contribuindo com itens a serem salvos e restaurados através das sessões do Firefox.</dd> -</dl> - -<dl> - <dt>Feed content access API</dt> - <dd><em>Esta API ainda está sendo revisada; documentação estará disponível em breve.</em></dd> -</dl> - -<dl> - <dt><a href="/en/SAX">SAX support</a></dt> - <dd>Parser API baseada em eventos de XML.</dd> -</dl> - -<dl> - <dt><a href="/en/Adding_search_engines_from_web_pages">Adding search engines from web pages</a></dt> - <dd>Código Javascript pode instruir Firefox a instalar novos plugins de pesquisa escritos com o formato OpenSearch ou Sherlock.</dd> -</dl> - -<dl> - <dt><a href="/en/Adding_phishing_protection_data_providers">Adding phishing protection data providers</a></dt> - <dd>É possível realçar a proteção phishing<span class="comment">?</span> do Firefox adicionando fornecedores adicionais de dados ao sistema de navegação segura<span class="comment">ainda não encontrei um bom termo - Leandro o que voce acha - Kay - bom Kay, obrigado. :) Caso queira nos ajudar com outras traduções, entre em contato através da página MDC:Comunidade</span>.</dd> -</dl> - -<dl> - <dt><a href="/en/Storage">Storage</a></dt> - <dd>Firefox 2 introduz o mozStorage, uma arquitetura de base de dados baseada no sqlite.</dd> -</dl> - -<dl> - <dt><a href="/en/Best_practices_for_extension_versioning">Best practices for extension versioning</a></dt> - <dd>Como usar números de versão para tratar de todas as versões de pré-lançamento do firefox 2.</dd> -</dl> - -<h2 id="Novas_caracter.C3.ADsticas_para_usu.C3.A1rios_finais" name="Novas_caracter.C3.ADsticas_para_usu.C3.A1rios_finais">Novas características para usuários finais</h2> - -<p>Para conhecer as novidades para usuários finais das versões 2.0, visite o <a class="external" href="http://br.mozdev.org/noticias/2.0.html">br.mozdev</a>.</p> diff --git a/files/pt-pt/mozilla/firefox/releases/3.5/index.html b/files/pt-pt/mozilla/firefox/releases/3.5/index.html deleted file mode 100644 index d175b9cc1c..0000000000 --- a/files/pt-pt/mozilla/firefox/releases/3.5/index.html +++ /dev/null @@ -1,261 +0,0 @@ ---- -title: Firefox 3.5 para desenvolvedores -slug: Mozilla/Firefox/Releases/3.5 -translation_of: Mozilla/Firefox/Releases/3.5 -original_slug: Firefox_3.5_para_desenvolvedores ---- -<div>{{FirefoxSidebar}}</div><p>O Firefox 3.5 introduz várias funcionalidades novas, bem como suporte adicional e melhorado para uma larga variedade de padrões web. Este artigo oferece uma extensa lista, com links para artigos cobrindo as melhorias mais importantes.</p> -<h2 id="Novas_funcionalidades_para_desenvolvedores_no_Firefox_3.5">Novas funcionalidades para desenvolvedores no Firefox 3.5</h2> -<h3 id="Para_desenvolvedores_de_web_sites_e_aplicações">Para desenvolvedores de web sites e aplicações</h3> -<h4 id="Suporte_a_HTML_5">Suporte a HTML 5</h4> -<dl> - <dt> - <a class="internal" href="/Pt/Usando_%C3%A1udio_e_v%C3%ADdeo_no_Firefox" title="Pt/Usando áudio e vídeo no Firefox">Usando áudio e vídeo no Firefox</a></dt> - <dd> - O Firefox 3.5 adicionou suporte para os elementos de <a class="internal" href="/Pt/HTML/Elemento/Audio" title="Pt/HTML/Elemento/Audio"><code>áudio</code></a> e <a class="internal" href="/Pt/HTML/Elemento/Video" title="Pt/HTML/Elemento/Video"><code>vídeo</code></a> do HTML 5.</dd> - <dt> - <a class="internal" href="/en/Offline_resources_in_Firefox" title="En/Offline resources in Firefox">Recursos offline no Firefox</a> (EN)</dt> - <dd> - O Firefox 3.5 agora suporta totalmente as especificações de recursos <em>offline</em> do HTML 5.</dd> - <dt> - <a class="internal" href="/En/DragDrop/Drag_and_Drop" title="En/DragDrop/Drag and Drop">Arrastar e largar (drag and drop)</a> (EN)</dt> - <dd> - As APIs de arrastar e soltar do HTML 5 permitem o suporte para arrastar e soltar itens dentro e entre web sites. Isto também proporciona uma API simples para uso em extensões e aplicações baseadas no Mozilla.</dd> -</dl> -<h4 id="Novas_funcionalidades_do_CSS_suportadas">Novas funcionalidades do CSS suportadas</h4> -<dl> - <dt> - <a class="internal" href="/Pt/CSS/@font-face" title="Pt/CSS/@font-face">Suporte a fontes baixáveis</a></dt> - <dd> - A nova <code>@font-face</code> @rule permite que páginas web proporcionem fontes baixáveis, dessa forma estes sites podem ser renderizados exatamente como o autor da página espera.</dd> - <dt> - <a class="internal" href="/Pt/CSS/Consulta_de_m%C3%ADdia" title="Pt/CSS/Consulta de mídia">Consulta de mídia CSS</a></dt> - <dd> - O Firefox 3.5 suporta consulta de mídia CSS, que melhora o suporte às folhas de estilo dependentes de mídias.</dd> - <dt> - <a class="internal" href="/pt/CSS/:before" title="pt/CSS/:before"><code>:before</code></a> e <a class="internal" href="/pt/CSS/:after" title="pt/CSS/:after"><code>:after</code></a> atualizados para o CSS 2.1</dt> - <dd> - Os pseudo-elementos <code>:before</code> e <code>:after</code> foram atualizados para o suporte total do CSS 2.1, adicionando suporte para <code>position</code>, <code>float</code>, <code>list-style-*</code>, e algumas propriedades <code>display</code>.</dd> - <dt> - <a class="internal" href="/en/CSS/opacity" title="En/CSS/Opacity"><code>opacity</code></a><code> (en)</code></dt> - <dd> - A estensão Mozilla <code>-moz-opacity</code> para o CSS foi removida em favor da propriedade padrão <code>opacity</code>.</dd> - <dt> - <a class="internal" href="/en/CSS/text-shadow" title="En/CSS/Text-shadow"><code>text-shadow</code></a><code> (en)</code></dt> - <dd> - A propriedade <code>text-shadow</code>, que permite ao conteúdo web especificar efeitos de sombra para aplicar em textos e decorações de texto, agora é suportada.</dd> - <dt> - <a class="internal" href="/En/CSS/Word-wrap" title="En/CSS/Word-wrap"><code>word-wrap</code></a><code> (en)</code></dt> - <dd> - Esta nova propriedade suportada permite ao conteúdo especificar quando as linhas podem ou não serem quebradas no meio de palavras para prevenir o extravasamento quando uma outra <em>string</em> não-quebrável é muito longa para ocupar uma única linha.</dd> - <dt> - <a class="internal" href="/en/CSS/-moz-box-shadow" title="En/CSS/-moz-box-shadow"><code>-moz-box-shadow</code></a><code> (en)</code></dt> - <dt> - <a class="internal" href="/En/CSS/-moz-border-image" title="En/CSS/-moz-border-image"><code>-moz-border-image</code></a><code> (en)</code></dt> - <dt> - <a class="internal" href="/En/CSS/-moz-column-rule" title="En/CSS/-moz-column-rule"><code>-moz-column-rule</code></a><code> (en)</code></dt> - <dt> - <a class="internal" href="/En/CSS/-moz-column-rule-width" title="En/CSS/-moz-column-rule-width"><code>-moz-column-rule-width</code></a><code> (en)</code></dt> - <dt> - <a class="internal" href="/En/CSS/-moz-column-rule-style" title="En/CSS/-moz-column-rule-style"><code>-moz-column-rule-style</code></a><code> (en)</code></dt> - <dt> - <a class="internal" href="/En/CSS/-moz-column-rule-color" title="En/CSS/-moz-column-rule-color"><code>-moz-column-rule-color</code></a><code> (en)</code></dt> - <dt> - <a class="internal" href="/en/CSS/-moz-column-gap" title="En/CSS/-moz-column-gap"><code>-moz-column-gap</code></a><code> (en)</code></dt> - <dd> - O Firefox 3.5 adicionou suporte para estas extensões Mozilla ao CSS.</dd> - <dt> - O valor de cor <a class="internal" href="/en/CSS/color#Mozilla_Specific_Colors" title="En/CSS/color#Mozilla Specific Colors"><code>-moz-nativehyperlinktext</code></a><code> (en)</code></dt> - <dd> - Este novo valor de cores representa a cor de <em>hiperlink</em> padrão do sistema do usuário.</dd> - <dt> - As novas propriedades <a class="internal" href="/En/CSS/-moz-window-shadow" title="En/CSS/-moz-window-shadow"><code>-moz-window-shadow</code></a> <code>(en) </code>e <a class="internal" href="/En/CSS/:-moz-system-metric(mac-graphite-theme)" title="En/CSS/:-moz-system-metric(mac-graphite-theme)"><code>-moz-system-metric(mac-graphite-theme)</code></a><code> (en)</code></dt> - <dd> - Estas novas propriedades CSS foram adicionadas para facilitar as edições de temas.</dd> - <dt> - Novos valores para <a class="internal" href="/en/CSS/-moz-appearance" title="En/CSS/-moz-appearance"><code>-moz-appearance</code></a> <code>(en)</code></dt> - <dd> - Os valores <code>-moz-win-glass</code> e <code>-moz-mac-unified-toolbar</code> foram adicionados em <code>-moz-appearance</code>.</dd> - <dt> - <a class="internal" href="/Pt/CSS/Usando_transforma%C3%A7%C3%B5es_CSS" title="Pt/CSS/Usando transformações CSS">Usando transformações CSS</a></dt> - <dd> - O Firefox 3.5 suporta transformações CSS. Veja <a class="internal" href="/En/CSS/-moz-transform" title="En/CSS/-moz-transform"><code>-moz-transform</code></a> <code>(en) </code>e <a class="internal" href="/En/CSS/-moz-transform-origin" title="En/CSS/-moz-transform-origin"><code>-moz-transform-origin</code></a> <code>(en) </code>para detalhes.</dd> - <dt> - <a class="internal" href="/en/CSS/:nth-child" title="En/CSS/:nth-child"><code>:nth-child</code></a> <code>(en)</code></dt> - <dt> - <code><a class="internal" href="/en/CSS/:nth-last-child" title="En/CSS/:nth-last-child">:nth-last-child</a></code> <code>(en)</code></dt> - <dt> - <code><a class="internal" href="/en/CSS/:nth-of-type" title="En/CSS/:nth-of-type">:nth-of-type</a></code> <code>(en)</code></dt> - <dt> - <code><a class="internal" href="/en/CSS/:nth-last-of-type" title="En/CSS/:nth-last-of-type">:nth-last-of-type</a></code> <code>(en)</code></dt> - <dt> - <code><a class="internal" href="/en/CSS/:first-of-type" title="En/CSS/:first-of-type">:first-of-type</a></code> <code>(en)</code></dt> - <dt> - <code><a class="internal" href="/en/CSS/:nth-last-of-type" title="En/CSS/:nth-last-of-type">:last-of-type</a></code> <code>(en)</code></dt> - <dt> - <a class="internal" href="/en/CSS/:only-of-type" title="En/CSS/:only-of-type"><code>:only-of-type</code></a> <code>(en)</code></dt> - <dd> - Todos estes seletores são agora suportados pelo Firefox 3.5.</dd> -</dl> -<h4 id="Novas_funcionalidades_da_DOM">Novas funcionalidades da DOM</h4> -<dl> - <dt> - <a class="internal" href="/Pt/DOM/Storage#localStorage" title="pt/DOM/Storage#localStorage">localStorage</a></dt> - <dd> - O Firefox 3.5 adiciona suporte para a propriedade <code>localStorage do</code> HTML 5, que proporciona uma maneira para as aplicações web armazenarem dados localmente no computador do cliente.</dd> - <dt> - <a class="internal" href="/En/Using_web_workers" title="En/Using DOM workers">Using DOM workers</a> (EN)</dt> - <dd> - O Firefox 3.5 suporta que trabalhadores (<em>workers</em>) DOM permitam facilmente o suporte para <em>multi-threading</em> em aplicações web.</dd> - <dt> - <a class="internal" href="/En/Using_geolocation" title="En/Using geolocation">Using geolocation</a> (EN)</dt> - <dd> - O Firefox 3.5 suporta a API de Geolocalização (<em>Geolocation API</em>), que permite a aplicações web obterem informações sobre a localização atual dos usuários se um provedor desta informação estiver instalado e habilitado.</dd> - <dt> - <a class="internal" href="/En/Using_native_JSON" title="En/Using JSON in Firefox">Using JSON in Firefox</a> (EN)</dt> - <dd> - O supore para <a class="internal" href="/en/JSON" title="En/JSON">JSON</a> está agora integrado ao DOM.</dd> - <dt> - <a class="internal" href="/En/DOM/Locating_DOM_elements_using_selectors" title="en/DOM/Locating DOM elements using selectors">Locating DOM elements using selectors</a> (EN)</dt> - <dd> - A API de seletores (<em>selectors API</em>) permite consultar um documento para localizar os elementos que combinam com uma regra de seleção dada.</dd> - <dt> - <a class="internal" href="/En/DOM/NodeIterator" title="En/DOM/NodeIterator">The <code>NodeIterator</code> object</a> (EN)</dt> - <dd> - O objeto <code>NodeIterator</code> proporciona suporte para iteração sobre a lista de nós em uma subárvore DOM.</dd> - <dt> - <a class="internal" href="/en/Gecko-Specific_DOM_Events#MozAfterPaint" title="en/Gecko-Specific DOM Events#MozAfterPaint">The MozAfterPaint event</a> (EN)</dt> - <dd> - Este novo evento DOM é enviado após realizar atualizações de pintura em janelas.</dd> - <dt> - <a class="internal" href="/en/Gecko-Specific_DOM_Events#MozMousePixelScroll" title="en/Gecko-Specific DOM Events#MozMousePixelScroll">The MozMousePixelScroll event</a> (EN)</dt> - <dd> - Este novo evento DOM permite a detecção de eventos de rolagem do mouse baseada em pixels ao invés de eventos de rolagem baseados em linhas.</dd> -</dl> -<h4 id="Novas_funcionalidades_JavaScript">Novas funcionalidades JavaScript</h4> -<dl> - <dt> - <a class="internal" href="/En/Core_JavaScript_1.5_Reference/Global_Objects/Object/GetPrototypeOf" title="En/Core JavaScript 1.5 Reference/Global Objects/Object/GetPrototypeOf"><code>Object.getPrototypeOf()</code></a> (EN)</dt> - <dd> - Este novo método retorna o protótipo de um objeto específico.</dd> - <dt> - Novos métodos trim no objeto String</dt> - <dd> - O objeto <a class="internal" href="/en/Core_JavaScript_1.5_Reference/Global_Objects/String" title="en/Core JavaScript 1.5 Reference/Global Objects/String"><code>String</code></a> (en) tem agora os métodos <a class="internal" href="../../../../En/Core_JavaScript_1.5_Reference/Global_Objects/String/Trim" rel="internal"><code>trim()</code></a> (en), <a class="internal" href="../../../../En/Core_JavaScript_1.5_Reference/Global_Objects/String/TrimLeft" rel="internal"><code>trimLeft()</code></a> (en) e <a class="internal" href="../../../../En/Core_JavaScript_1.5_Reference/Global_Objects/String/TrimRight" rel="internal"><code>trimRight()</code></a> (en).</dd> -</dl> -<h4 id="Rede">Rede</h4> -<dl> - <dt> - <a class="internal" href="/En/HTTP_access_control" title="En/HTTP access control">Cross-site access controls for HTTP</a> (EN)</dt> - <dd> - No Firefox 3.5, agora é possível para requisições HTTP, incluindo as feitas por <a class="internal" href="/en/XMLHttpRequest" title="En/XMLHttpRequest"><code>XMLHttpRequest</code></a> (en), trabalhar através de domínios, se o servidor suportar isso.</dd> - <dt> - <a class="internal" href="/En/Using_XMLHttpRequest#Monitoring_progress" title="En/Using XMLHttpRequest#Monitoring progress">Progress events for </a><code><a class="internal" href="/En/Using_XMLHttpRequest#Monitoring_progress" title="En/Using XMLHttpRequest#Monitoring progress">XMLHttpRequest</a></code> (EN)</dt> - <dd> - Eventos de progresso agora são oferecidos para permitir que extensões monitorem o progresso de requisições.</dd> - <dt> - Suporte a <code>XMLHttpRequest</code> síncrona melhorado</dt> - <dd> - <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=340345" title="https://bugzilla.mozilla.org/show_bug.cgi?id=340345">DOM Timeout</a> e <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=333198" title="https://bugzilla.mozilla.org/show_bug.cgi?id=333198">Input Events</a> agora são omitidos durante uma <code>XMLHttpRequest</code> síncrona.</dd> - <dt> - <a class="internal" href="/En/Controlling_DNS_prefetching" title="en/Controlling DNS prefetching">Controlling DNS prefetching</a> (EN)</dt> - <dd> - O Firefox 3.5 proporciona pré-carregamento DNS (<em>DNS prefetching</em>), através do qual realiza a resolução do nome do domínio antes do tempo para links incluídos na página atual, com o objetivo de poupar tempo quando os links forem realmente clicados. Este artigo descreve como você pode modificar seu web site para desabilitar o pré-carregamento, ou para ajustar como o pré-carregamento opera.</dd> -</dl> -<h4 id="Novas_funcionalidades_Canvas">Novas funcionalidades Canvas</h4> -<dl> - <dt> - <a class="internal" href="/en/Drawing_text_using_a_canvas" title="en/Drawing text using a canvas">HTML 5 text API for <code>canvas</code> elements</a> (EN)</dt> - <dd> - Os elementos Canvas agora suportam a API de texto do HTML 5.</dd> - <dt> - <a class="internal" href="/en/Canvas_tutorial/Applying_styles_and_colors#Shadows" title="en/Canvas tutorial/Applying styles and colors#Shadows">Shadow effects in a <code>canvas</code></a> (EN)</dt> - <dd> - Os efeitos de sombra do Canvas agora são suportados.</dd> - <dt> - atributo <code>moz-opaque</code></dt> - <dd> - Adicionado o atributo DOM, <code>moz-opaque</code>, que permite ao canvas saber quando a translucidez será um fator ou não. Se o canvas sabe que não há translucidez, a performance de pintura pode ser otimizada.</dd> -</dl> -<h4 id="Novas_funcionalidades_SVG">Novas funcionalidades SVG</h4> -<dl> - <dt> - <a class="internal" href="/En/Applying_SVG_effects_to_HTML_content" title="en/Applying SVG effects to HTML content">Applying SVG effects to HTML content</a> (EN)</dt> - <dd> - Você pode aplicar efeitos SVG ao conteúdo HTML e XHTML; este artigo descreve como.</dd> -</dl> -<h4 id="Novas_funcionalidades_-_Miscelânea">Novas funcionalidades - Miscelânea</h4> -<dl> - <dt> - <a class="internal" href="/En/ICC_color_correction_in_Firefox" title="en/ICC color correction in Firefox">ICC color correction in Firefox</a> (EN)</dt> - <dd> - O Firefox 3.5 agora suporta a correção de cores ICC para imagens marcadas.</dd> - <dt> - O atributo <code>defer</code> é agora suportado no elemento <a class="internal" href="/En/HTML/Element/Script" title="En/HTML/Element/script"><code>script</code></a> (EN)</dt> - <dd> - Este atributo indica ao navegador que ele pode optar por continuar a analisar e renderizar a página sem aguardar o término da execução do script.</dd> -</dl> -<h3 id="Outras_melhorias">Outras melhorias</h3> -<ul> - <li>A unidade <code>ch</code> pode agora ser usada em qualquer lugar que aceite uma <a class="internal" href="/en/length" title="En/Length">unidade de comprimento</a> (en); "1ch" é a largura do caractere "0" (zero).</li> - <li>A propriedade <a class="internal" href="/en/CSS/white-space" title="En/CSS/White-space"><code>white-space</code></a> <code>(en) </code>agora aceita o valor <code>pre-line</code>.</li> - <li>A propridedade <code><a class="internal" href="../../../../En/DOM/Text.wholeText" rel="internal">wholeText</a></code> <code>(en)</code> e o método <code><a class="internal" href="../../../../En/DOM/Text.replaceWholeText" rel="internal">replaceWholeText()</a></code> <code>(en)</code> dos nós de texto foram implementados.</li> - <li>A propriedade <code><a class="internal" href="../../../../En/DOM/Element.children" rel="internal">element.children</a></code> <code>(en)</code> foi adicionada. Ela retorna uma <em>coleção</em> de elementos filhos do elemento dado.</li> - <li>A API Traversal Element é agora suportada pelo objeto DOM <a class="internal" href="../../../../en/DOM/element" rel="internal">Element</a> <code>(en)</code>.</li> - <li>Nós HTML podem ser clonados usando <a class="internal" href="/En/DOM/Node/CloneNode" title="En/DOM/Node/CloneNode"><code>cloneNode()</code></a> <code>(en)</code>.</li> - <li>Os elementos DOM enviados agora podem ser reenviados. Isto faz o Firefox 3.5 passar o teste 30 do Acid 3.</li> - <li>Melhorias forma feitas na manipulação do DOM 2 Range.</li> - <li>No escopo <em>não-chrome</em>, objetos pegos como exceções são agora os reais objetos lançados ao invés de um wrapper <a class="internal" href="/en/XPConnect" title="En/XPConnect">XPConnect</a> <code>(en) </code>contendo o objeto lançado.</li> - <li>A referência ID do SVG está agora viva.</li> - <li>Os filtros SVG agora funcionam para <code>foreignObject</code>.</li> - <li>O método <code>GetSVGDocument()</code> foi adicionado ao elementos <a class="internal" href="/en/HTML/Element/object" title="En/HTML/Element/Object"><code>object</code></a> <code>(en) </code>e <a class="internal" href="/en/HTML/Element/iframe" title="en/HTML/Element/Iframe"><code>iframe</code></a> <code>(en)</code> para compatibilidade.</li> -</ul> -<h3 id="Para_desenvolvedores_XUL_e_de_complementos">Para desenvolvedores XUL e de complementos</h3> -<p>Se você é um desenvolvedor de extensões, você deve começar lendo <a class="internal" href="/Pt/Atualizando_extens%C3%B5es_para_o_Firefox_3.5" title="Pt/Atualizando extensões para o Firefox 3.5">Atualizando extensões para o Firefox 3.5</a>, que oferece um panorama útil de mudanças que podem afetar a sua extensão.</p> -<h4 id="Novos_componentes_e_funcionalidades">Novos componentes e funcionalidades</h4> -<dl> - <dt> - <a class="internal" href="/En/Supporting_private_browsing_mode" title="En/Supporting private browsing mode">Supporting private browsing mode</a> (EN)</dt> - <dd> - O Firefox 3.5 oferece o modo de Navegação Privada, que não grava as atividades do usuário. Extensões podem suportar a navegação privada seguindo as orientações oferecidas por este artigo.</dd> - <dt> - <a class="internal" href="/En/Security_changes_in_Firefox_3.5" title="En/Security changes in Firefox 3.5">Security changes in Firefox 3.5</a> (EN)</dt> - <dd> - Este artigo cobre as mudanças relacionadas à segurança no Firefox 3.5.</dd> - <dt> - <a class="internal" href="/En/Theme_changes_in_Firefox_3.5" title="En/Theme changes in Firefox 3.5">Theme changes in Firefox 3.5</a> (EN)</dt> - <dd> - Este artigo cobre as mudanças relacionadas à temas no Firefox 3.5.</dd> - <dt> - <a class="internal" href="/En/Monitoring_WiFi_access_points" title="En/Monitoring WiFi access points">Monitoring WiFi access points</a> (EN)</dt> - <dd> - Código com privilégios UniversalXPConnect agora podem monitorar a lista dos pontos de acesso disponíveis, obtendo informações de seus SSIDs, endereços MAC, e força de sinal. Isto pode ser usado em conjunto com geolocalização (<em>Geolocation</em>) para oferecer serviço de localização baseado em WiFi.</dd> -</dl> -<h4 id="Mudanças_e_melhorias_notáveis">Mudanças e melhorias notáveis</h4> -<ul> - <li>O <em>widget</em> XUL, <code><a class="internal" href="../../../../en/XUL/textbox" rel="internal">textbox</a></code> <code>(en)</code> agora oferece o tipo <code><a class="internal" href="../../../../en/XUL/Attribute/textbox.type" rel="internal">search</a></code> <code>(en)</code>, para uso como campos de busca.</li> - <li>Com o objetivo de suportar o arrastamento e lançamento de abas entre janelas, o <em>widget</em> <a class="internal" href="/en/XUL/browser" title="En/XUL/Browser"><code>browser</code></a> <code>(en)</code> agora possui o método <a class="internal" href="/En/XUL/Method/SwapDocShells" title="En/XUL/Method/SwapDocShells"><code>swapDocShells()</code></a> <code>(en)</code>.</li> - <li>Adicionado o atributo <a class="internal" href="/En/XUL/Attribute/Panel.level" title="en/XUL/Attribute/panel.level"><code>level</code></a> <code>(en)</code> ao elemento <a class="internal" href="/en/XUL/panel" title="En/XUL/Panel"><code>panel</code></a> <code>(en)</code><code>;</code> ele especifica se painéis aparecem no topo de outras aplicações, ou somente no topo da janela em que o painel está contido.</li> - <li>Elementos XUL agora suportam as propriedades <code>clientXXX</code> e <code>scrollXXX</code>.</li> - <li><a class="internal" href="/en/XUL/keyset" title="En/XUL/Keyset"><code>keysets</code></a> <code>(en) </code>agora incluem um atributo <code>disabled</code>.</li> - <li>Em adição, <code>keyset</code>s podem agora ser removidos usando o método de nós <a class="internal" href="/En/DOM/Node.removeChild" title="En/DOM/Node.removeChild"><code>removeChild()</code></a> <code>(en)</code>.</li> - <li><span class="lang lang-en"><code><a href="../../../../en/mozIStorageStatement" rel="internal">mozIStorageStatement</a></code> </span><code>(en)</code> teve o método <code>initialize()</code> removido; desenvolvedores devem usar o método <span class="lang lang-en"><code><a href="../../../../en/mozIStorageConnection#createStatement()" rel="internal">createStatement()</a></code></span> <code>(en)</code> ao invés de obter uma nova declaração de objeto.</li> - <li>A API <a class="internal" href="/en/Storage" title="En/Storage">Storage</a> <code>(en)</code> agora oferece suporte para requisições assíncronas.</li> - <li>A interface <a class="internal" href="/en/nsICookie2" title="En/NsICookie2"><code>nsICookie2</code></a> <code>(en) </code>agora expõe o tempo que os cookies foram criados no seu novo atributo <code>creationTime</code>.</li> - <li>Adicionada um indicador à <code><a class="internal" href="../../../../en/nsIProtocolHandler" rel="internal">nsIProtocolHandler</a></code> <code>(en)</code>(<code>URI_IS_LOCAL_RESOURCE</code>) que é checada durante o registro do <em>chrome</em> para assegurar que um protocolo tenha permissão para ser registrado. </li> - <li>O Firefox agora procura por plugins em <code>/usr/lib/mozilla/plugins</code> no Linux, assim como as localizações anteriormente suportadas.</li> - <li>A API plugin foi atualizada para incluir suporte para o modo de navegação privada; você pode usar agora <a class="internal" href="/en/NPN_GetValue" title="En/NPN GetValue"><code>NPN_GetValue()</code></a> <code>(en)</code> para consultar o estado do modo de navegação privada usando a variável <code>NPNVprivateModeBool</code>.</li> -</ul> -<h2 id="Novas_características_para_usuários_finais">Novas características para usuários finais</h2> -<h3 id="Experiência_do_usuário">Experiência do usuário</h3> - -<h3 id="Segurança_e_Privacidade">Segurança e Privacidade</h3> - -<h3 id="Performance">Performance</h3> - -<h2 id="Veja_também">Veja também</h2> -<ul> - <li><a class="internal" href="/pt/Firefox_3_para_desenvolvedores" title="pt/Firefox 3 para desenvolvedores">Firefox 3 para desenvolvedores</a></li> - <li><a class="internal" href="/pt/Firefox_2_para_desenvolvedores" title="pt/Firefox 2 para desenvolvedores">Firefox 2 para desenvolvedores</a></li> - <li><a class="internal" href="/pt/Firefox_1.5_para_Desenvolvedores" title="pt/Firefox 1.5 para Desenvolvedores">Firefox 1.5 para desenvolvedores</a></li> -</ul> diff --git a/files/pt-pt/mozilla/firefox/releases/3.5/updating_extensions/index.html b/files/pt-pt/mozilla/firefox/releases/3.5/updating_extensions/index.html deleted file mode 100644 index d385b99b81..0000000000 --- a/files/pt-pt/mozilla/firefox/releases/3.5/updating_extensions/index.html +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: Atualizando extensões para o Firefox 3.5 -slug: Mozilla/Firefox/Releases/3.5/Updating_extensions -translation_of: Mozilla/Firefox/Releases/3.5/Updating_extensions -original_slug: Atualizando_extensões_para_o_Firefox_3.5 ---- -<div>{{FirefoxSidebar}}</div> -<p>Este artigo proporciona informação útil para desenvolvedores tentando atualizar suas extensões para trabalharem corretamente no Firefox 3.5.</p> -<h2 id="Atualizações_básicas">Atualizações básicas</h2> -<p>Esta seção cobre o básico do que você necessita fazer sempre que você atualiza uma extensão para uma nova versão do Firefox.</p> -<h3 id="Teste_sua_extensão">Teste sua extensão</h3> -<p>Começe editando o arquivo <code>install.rdf</code> da sua extensão, atualizando maxVersion para 3.5b4 (if you're testing on Firefox 3.5 beta 4), e aumente a versão da sua extensão.<br> - <br> - Crie então um novo perfil no Firefox, para que os testes não coloquem em risco seu perfil usual. Navegue até o diretório contendo Firefox, e então digite o comando:</p> -<pre>firefox -createProfile testBeta4 -</pre> -<p>No Mac, você precisa navegar por todo o caminho da <strong>bundle</strong> aplicação Firefox:</p> -<pre>cd /Applications/Firefox.app/Contents/MacOS/ -firefox -createProfile testBeta4 -</pre> -<p>Inicie o Firefox usando o novo perfil digitando este comando na linha de comeando:</p> -<pre>firefox -P testBeta4 -</pre> -<p>Teste a sua extensão cuidadosamente. Nós sugerimos que você configure as seguintes preferências para verdadeiro (true) com a finalidade de ser alertado para qualquer advertência ou exceção do JavaScript:</p> -<ul> - <li><code>javascript.options.strict</code></li> - <li><code>javascript.options.showInConsole</code></li> -</ul> -<h3 id="Atualize_sua_extensão">Atualize sua extensão</h3> -<p>Se você encontrar algum problema durante o teste, atualize seu código para corrigir os problemas. Este artigo contém informação sobre coisas que podem requisitar algum trabalho.<br> - <br> - Uma vez que tenha feito isto, tente usar sua extensão novamente, desta vez com o perfil normal. Isto ajudará a assegurar a compatibilidade com qualquer dado existente salvo.</p> -<h3 id="Atualize_sua_extensão_em_addons.mozilla.org">Atualize sua extensão em addons.mozilla.org</h3> -<p>Finalmente, é hora de lançar sua extensão atualizada. Se a sua extensão não necessita de qualquer mudança no código, você pode simplesmente conectar-se ao painel AMO e atualizar a compatibilidade da versão por ali. Caso contrário será necessário enviar uma nova versão para o AMO.<br> - <br> - Veja <a class="internal" href="/en/Submitting_an_add-on_to_AMO" title="En/Submitting an add-on to AMO">Submitting an add-on to AMO</a> (EN) para informações adicionais.</p> -<h2 id="Acessando_o_banco_de_dados_do_Places">Acessando o banco de dados do Places</h2> -<p>Antes do Firefox 3.5, acessar o banco de dados do Places diretamente usando a API de Armazenamento (<a class="internal" href="/en/Storage" title="En/Storage">Storage API</a> (EN)) requeria alguns truques:</p> -<pre class="brush: js">var places = Components.classes["@mozilla.org/file/directory_service;1"]. - getService(Components.interfaces.nsIProperties). - get("ProfD", Components.interfaces.nsIFile); -places.append("places.sqlite"); -var db = Components.classes["@mozilla.org/storage/service;1"]. - getService(Components.interfaces.mozIStorageService).openDatabase(places); -</pre> -<p>Isto constrói um caminho manual para o arquivo do banco de dados <code>places.sqlite</code> database, então abre o arquivo para o acesso ao armazenamento.</p> -<p>O Firefox 3.5 adiciona um serviço dedicado que oferece uma maneira mais conveniente para acessar o banco de dados do Places; a técnica a seguir não funciona no Firefox 3.5 ou anteriores.</p> -<pre class="brush: js">var db = Components.classes["@mozilla.org/browser/nav-history-service;1"]. - getService(Components.interfaces.nsPIPlacesDatabase).DBConnection; -</pre> -<h2 id="Caixas_de_texto_de_Pesquisa">Caixas de texto de Pesquisa</h2> -<p>O tipo de caixa de texto (<a class="internal" href="/en/XUL/textbox" title="En/XUL/Textbox"><code>textbox</code></a> (EN)) <code>timed</code> está depreciado; ao invés disso, você deve usar <code>search</code>.</p> -<p>No Firefox 3, você pode ter usado:</p> -<pre><textbox type="timed" timeout="1000" oncommand="alert(this.value);"/> -</pre> -<p>No Firefox 3.5, você deve mudar para:</p> -<pre><textbox type="search" timeout="1000" oncommand="alert(this.value);"/> -</pre> -<h2 id="JSON">JSON</h2> -<p>O módulo JavaScript JSON.jsm foi removido no Firefox 3.5 em favor do suporte nativo ao objeto JSON. Para detalhes, veja <a class="internal" href="/En/Using_native_JSON" title="/en/Using JSON in Firefox">Using JSON in Firefox</a> (EN) e o artigo em <a class="internal" href="/en/JSON" title="En/JSON">JSON</a> (EN) para uma introdução mais geral sobre o JSON e como usá-lo em várias versões do Firefox.</p> -<p>Para assegurar a compatibilidade com o Firefox 3 e Firefox 3.5, você pode fazer o que segue:</p> -<pre class="brush: js">if (typeof(JSON) == "undefined") { - Components.utils.import("resource://gre/modules/JSON.jsm"); - JSON.parse = JSON.fromString; - JSON.stringify = JSON.toString; -} -</pre> -<p>Isto funciona importando o módulo JavaScript JSON.jsm se o JSON não for suportado nativamente, mapeando então os métodos proporcionados por este módulo aos usados nativamente no JSON, então as mesmas chamadas funcinam.</p> -<p>Você pode também contornar este problema usando a interface {{ interface("nsIJSON") }} diretamente.</p> -<h2 id="Mudanças_nos_menus_de_contexto">Mudanças nos menus de contexto</h2> -<p>Com o objetivo de suportar as novas características de áudio e vídeo adicionadas ao Gecko 1.9.1, a classe de <code>nsContextMenu</code> foi renomeada de <code>imageURL</code> para <code>mediaURL</code>; entretanto, <code>imageURL</code> foi adicionado novamente em 9 de junho de, 2009.</p> -<h2 id="Mudanças_no_registro_chrome">Mudanças no registro chrome</h2> -<p>O Firefox 3.5 corrige falhas de segurança que tornam possível o uso remoto do chrome. Isto afetará qualquer complemento que inclua recursos em seu arquivo <code>chrome.manifest</code> que referencie a um web site, dados ou urls de recursos. Veja <a class="internal" href="/En/Security_changes_in_Firefox_3.5" title="En/Security changes in Firefox 3.5">Security changes in Firefox 3.5</a> (EN) para detalhes.</p> -<h2 id="Conseguindo_um_contexto_carregado_através_de_requisição">Conseguindo um contexto carregado através de requisição</h2> -<p>Anteriormente, era possível conseguir um contexto carregado a partir de uma requisição por consulta a várias APIs docShell. Uma maneira correta e confiável de fazer isso é usar um {{ interface("nsILoadContext") }}.</p> -<p>Com o C++, você pode fazer como mostrado abaixo:</p> -<pre class="brush: cpp">nsCOMPtr<nsILoadContext> loadContext; -nsCOMPtr<nsIChannel> channel = do_QueryInterface(aRequest); -NS_QueryNotificationCallbacks(channel, loadContext); -</pre> -<p>Com o JavaScript, você pode fazer desta maneira:</p> -<pre class="brush: js">var loadContext; -try { - loadContext = - aRequest.queryInterface(Components.interfaces.nsIChannel) - .notificationCallbacks - .getInterface(Components.interfaces.nsILoadContext); -} catch (ex) { - try { - loadContext = - aRequest.loadGroup.notificationCallbacks - .getInterface(Components.interfaces.nsILoadContext); - } catch (ex) { - loadContext = null; - } -} -</pre> -<h2 id="Barra_de_ferramentas_customizável">Barra de ferramentas customizável</h2> -<p>No Firefox 3.5, o comportamento da barra de ferramentas customizável mudou, tal que o vínculo<code> <xul:toolbar/> <span style="font-family: Verdana,Tahoma,sans-serif;">agora remove itens da barra de ferramentas do seu associado</span></code> <code><xul:toolbarpalette/></code> e os adiciona na barra de ferramentas, ao invés de cloná-los e copiá-os para a barra de ferramentas. Isto significa que a paleta conterá agora somente itens não presentes na barra de ferramentas, ao contrário do comportamento anterior de conter todos os elementos, customizáveis ou não, exibidos na barra de ferramentas. Isto pode causar problemas para complementos dependendo da possibilidade de recuperar os itens da barra de ferramentas customizável através de <code><xul:toolbarpalette/></code>, ou de tentar dinamicamente inserir itens na paleta para torná-la disponível durante a customização da barra de ferramentas. Mais informações está disponível em {{ Bug(407725) }} e {{ Bug(467045) }}.</p> -<h2 id="XPCNativeWrapper">XPCNativeWrapper</h2> -<p>Iniciando o Firefox 3.5, você não pode mais usar <code><span style="font-family: Verdana,Tahoma,sans-serif;">data</span>:</code> you can no longer use <code>data:</code> <strong>bindings</strong> em pacotes chromeque possuem automatização <code>XPCNativeWrapper</code>. Isto resolve um potencial problema de segurança.</p> -<p>Documentos XUL agora tem o tratamento <code>XPCNativeWrapper</code>, então você agora precisa usar o método <code>getAttribute()</code> para buscar valores de atributo ao invés de simplesmente lê-los diretamente.</p> -<p>Se a sua extensão está usando <code>xpcnativewrappers=no</code> (o que não deveria ser feito em primeiro lugar, uma vez que não é seguro fazê-lo), o XBL desta extensão não será aplicado a documentos que estejam usando automatização <code>XPCNativeWrapper</code>, começando no Firefox 3.5.</p> -<h2 id="Novas_características_interessantes">Novas características interessantes</h2> -<h3 id="Listening_eventos_em_todas_as_abas">"Listening" eventos em todas as abas</h3> -<p>O Firefox 3.5 adicionou suporte para a adição e remoção de <em>listeners</em> que <em>listen</em> em todas as abas. Veja <a class="internal" href="/En/Listening_to_events_on_all_tabs" title="en/Listening to events on all tabs">Listening to events on all tabs</a> (EN) para detalhes.</p> -<h2 id="Para_desenvolvedores_de_temas">Para desenvolvedores de temas:</h2> -<ul> - <li>Cheque <a class="internal" href="../../../../En/Theme_changes_in_Firefox_3.1" rel="internal">Theme changes in Firefox 3.1</a> (EN).</li> - <li>Acesse o fórum Mozillazine <a class="topictitle external" href="http://forums.mozillazine.org/viewtopic.php?f=18&t=665138" title="http://forums.mozillazine.org/viewtopic.php?f=18&t=665138">Theme changes for FF3.1</a> (EN) para uma introdução/listagem de todas as mudanças entre o Firefox 3.0 e 3.5 que trazem impactos para os desenvolvedores. Isto diz respeito às novas características do CSS (como nth-child, -moz-box-shadow, etc), mudanças para <em>widgets</em> existentes, todas as melhorias da UI (<em>User Interface</em> - Interface do Usuário) e novas características do FF3.5 (suporte de áudio/vídeo, navegação privada, restauração de sessão extendida, sombras de caixas/janelas/textos).</li> -</ul> -<p> </p> diff --git a/files/pt-pt/mozilla/firefox/releases/3.6/index.html b/files/pt-pt/mozilla/firefox/releases/3.6/index.html deleted file mode 100644 index 1413f08199..0000000000 --- a/files/pt-pt/mozilla/firefox/releases/3.6/index.html +++ /dev/null @@ -1,310 +0,0 @@ ---- -title: Firefox 3.6 para desenvolvedores -slug: Mozilla/Firefox/Releases/3.6 -translation_of: Mozilla/Firefox/Releases/3.6 -original_slug: Firefox_3.6_para_desenvolvedores ---- -<div><section class="Quick_links" id="Quick_Links"> - <ol> - <li class="toggle"> - <details> - <summary>Firefox developer release notes</summary> - <ol> - <li><a href="/pt-PT/docs/Mozilla/Firefox/Releases">Firefox developer release notes</a></li> - </ol> - </details> - </li> - <li class="toggle"> - <details> - <summary>Add-ons</summary> - <ol> - <li><a href="/pt-PT/Add-ons/WebExtensions">Browser extensions</a></li> - <li><a href="/pt-PT/Add-ons/Themes">Themes</a></li> - </ol> - </details> - </li> - <li class="toggle"> - <details> - <summary>Firefox internals</summary> - <ol> - <li><a href="/pt-PT/docs/Mozilla/">Mozilla project</a></li> - <li><a href="/pt-PT/docs/Mozilla/Gecko">Gecko</a></li> - <li><a href="/pt-PT/docs/Mozilla/Firefox/Headless_mode">Headless mode</a></li> - <li><a href="/pt-PT/docs/Mozilla/JavaScript_code_modules">JavaScript code modules</a></li> - <li><a href="/pt-PT/docs/Mozilla/js-ctypes">JS-ctypes</a></li> - <li><a href="/pt-PT/docs/Mozilla/MathML_Project">MathML project</a></li> - <li><a href="/pt-PT/docs/Mozilla/MFBT">MFBT</a></li> - <li><a href="/pt-PT/docs/Mozilla/Projects">Mozilla projects</a></li> - <li><a href="/pt-PT/docs/Mozilla/Preferences">Preference system</a></li> - <li><a href="/pt-PT/docs/Mozilla/WebIDL_bindings">WebIDL bindings</a></li> - <li><a href="/pt-PT/docs/Mozilla/Tech/XPCOM">XPCOM</a></li> - <li><a href="/pt-PT/docs/Mozilla/Tech/XUL">XUL</a></li> - </ol> - </details> - </li> - <li class="toggle"> - <details> - <summary>Building and contributing</summary> - <ol> - <li><a href="/pt-PT/docs/Mozilla/Developer_guide/Build_Instructions">Build instructions</a></li> - <li><a href="/pt-PT/docs/Mozilla/Developer_guide/Build_Instructions/Configuring_Build_Options">Configuring build options</a></li> - <li><a href="/pt-PT/docs/Mozilla/Developer_guide/Build_Instructions/How_Mozilla_s_build_system_works">How the build system works</a></li> - <li><a href="/pt-PT/docs/Mozilla/Developer_guide/Source_Code/Mercurial">Mozilla source code</a></li> - <li><a href="/pt-PT/docs/Mozilla/Localization">Localization</a></li> - <li><a href="/pt-PT/docs/Mozilla/Mercurial">Mercurial</a></li> - <li><a href="/pt-PT/docs/Mozilla/QA">Quality assurance</a></li> - <li><a href="/pt-PT/docs/Mozilla/Using_Mozilla_code_in_other_projects">Using Mozilla code in other projects</a></li> - </ol> - </details> - </li> - </ol> -</section></div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">O <a class="external" href="http://www.firefox.com/" title="http://www.firefox.com/">Firefox 3.6</a> oferece suporte para padrões web novos e em desenvolvimento, performance melhorada e uma boa experiência para usuários web e desenvolvedores. Está página proporciona links para artigos cobrindo as novas capacidades do Firefox 3.6.</p> - -<h2 id="Para_desenvolvedores_de_websites_e_aplicações">Para desenvolvedores de websites e aplicações</h2> - -<h3 id="CSS">CSS</h3> - -<dl style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> - <dt style="font-style: normal; font-weight: bold;"><a href="/en/Using_gradients" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/Using gradients">Using gradients</a></dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">Firefox 3.6 adicionou o suporte às propriedades sugeridas <a href="/pt-PT/docs/Web/CSS/-moz-linear-gradient" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-linear-gradient</code></a> e <a href="/pt-PT/docs/Web/CSS/-moz-radial-gradient" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-radial-gradient</code></a> para <a href="/pt-PT/docs/Web/CSS/background" title="A propriedade background é usada para ajustar os valores do fundo em um único lugar na folha de estilos. background pode ser usada com os seguintes valores adicionais: background-attachment, background-color, background-image, background-position, background-repeat."><code>background</code></a>.</dd> - <dt style="font-style: normal; font-weight: bold;"><a href="/en/CSS/Multiple_backgrounds" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/CSS/Multiple backgrounds">Multiple backgrounds</a></dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">A propriedade <a href="/pt-PT/docs/Web/CSS/background" title="A propriedade background é usada para ajustar os valores do fundo em um único lugar na folha de estilos. background pode ser usada com os seguintes valores adicionais: background-attachment, background-color, background-image, background-position, background-repeat."><code>background</code></a> (assim como <a href="/pt-PT/docs/Web/CSS/background-color" title="background-color configura a cor de fundo de um elemento, com qualquer valor de cor ou a palavra-chave transparent."><code>background-color</code></a>, <a href="/pt-PT/docs/Web/CSS/background-image" title="A propriedade background-image configura a imagem de fundo para um elemento."><code>background-image</code></a>, <a href="/pt-PT/docs/Web/CSS/background-position" title="The documentation about this has not yet been written; please consider contributing!"><code>background-position</code></a>, <a href="/pt-PT/docs/Web/CSS/background-repeat" title="background-repeat specifies whether the image is repeated (tiled), and how."><code>background-repeat</code></a> e <a href="/pt-PT/docs/Web/CSS/background-attachment" title="Se um background-image é especificado, background-attachment determina se a posição da imagem é fixa na tela, ou rola junto com o bloco que a contém."><code>background-attachment</code></a>) agora suporta múltiplos fundos de tela. Isto permite a especificação de múltiplos fundos de tela que são renderizados um sobre o outro, em camadas.</dd> - <dt style="font-style: normal; font-weight: bold;"><a href="/En/CSS/Media_queries#Mozilla-specific_media_features" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="En/CSS/Media queries#Mozilla-specific media features">Mozilla-specific media features</a></dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">Características de mídia foram adicionadas para o sistema de métricas específico da Mozilla, então <a href="/pt/CSS/Consulta_de_Mídia" title="pt/CSS/Consulta de Mídia">consultas de mídia</a> podem ser usadas para checar mais seguramente a disponibilidade de características como o suporte a toque.</dd> - <dt style="font-style: normal; font-weight: bold;"><a href="/en/CSS/Scaling_background_images" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/CSS/Scaling background images">Scaling background images</a></dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">A propriedade <code style="color: inherit; font-weight: inherit;">background-size </code>do <a class="external" href="http://dev.w3.org/csswg/css3-background/" title="http://dev.w3.org/csswg/css3-background/#the-background-size-property">CSS 3 Backgrounds and Borders draft</a> é agora suportada sob o nome <a href="/pt-PT/docs/Web/CSS/-moz-background-size" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-background-size</code></a>.</dd> - <dt style="font-style: normal; font-weight: bold;"><a href="/en/About_WOFF" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/About WOFF">WOFF font support</a></dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;"><a href="/pt-PT/docs/Web/CSS/@font-face" title="@font-face permite que autores especifiquem fontes online para exibir texto em suas páginas web. Permitindo autores a proporcionar suas próprias fontes, @font-face elimina a necessidade de depender do limitado número de fontes que os usuários tem instalado em seus computadores."><code>@font-face</code></a> agora suporta arquivos de fonte baixáveis no formato WOFF.</dd> - <dt style="font-style: normal; font-weight: bold;"><a href="/en/CSS/pointer-events" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/CSS/pointer-events">Pointer events</a></dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">A propriedade <a href="/pt-PT/docs/Web/CSS/pointer-events" title="The documentation about this has not yet been written; please consider contributing!"><code>pointer-events</code></a> permite ao conteúdo especificar quando um elemento pode ser o alvo ou não de eventos com o ponteiro do mouse.</dd> -</dl> - -<h4 id="Miscelânea_de_mudanças_no_CSS">Miscelânea de mudanças no CSS</h4> - -<ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 25px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> - <li style="margin-bottom: 0.25em;">A unidade de comprimento <a href="/en/CSS/length#Relative_length_units" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/CSS/length#Relative length units"><code style="color: inherit; font-weight: inherit;">rem</code></a> do <a class="external" href="http://www.w3.org/TR/css3-values/#lengths" title="http://www.w3.org/TR/css3-values/#lengths">CSS3 Values and Units</a> é agora suportada. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=472195" title="FIXED: support css3 root em ('rem' or 're') units">bug 472195</a></li> - <li style="margin-bottom: 0.25em;"><a href="/pt-PT/docs/Web/CSS/image-rendering" title="The documentation about this has not yet been written; please consider contributing!"><code>image-rendering</code></a> é suportada para imagens, imagens de fundo, vídeos e canvas. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=423756" title="FIXED: Request: Switch for authors to turn on/off bilinear filtering when enlarging images">bug 423756</a></li> - <li style="margin-bottom: 0.25em;"><a href="/pt-PT/docs/Web/CSS/text-align" title="The documentation about this has not yet been written; please consider contributing!"><code>text-align</code></a>:end é agora suportada. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=299837" title="FIXED: [FIX]add support for text-align: end">bug 299837</a></li> - <li style="margin-bottom: 0.25em;">Mudanças no DOM para elementos usando os tipos <a href="/pt-PT/docs/Web/CSS/display" title="Esta propriedade display de CSS especifica o tipo de caixa de renderização utilizado para um elemento. Em HTML, os valores da propriedade display predefinidos têm o seu comportamento descrito nas especificações de HTML ou de uma folha de estilo predefinida do navegador ou do utilizador. O valor predefinido no XML é inline, incluindo os elementos de SVG ."><code>display</code></a> de tabela agora funcionam muito melhor.</li> - <li style="margin-bottom: 0.25em;">Adicionado <a href="/pt-PT/docs/Web/CSS/:-moz-locale-dir(ltr)" title="The documentation about this has not yet been written; please consider contributing!"><code>:-moz-locale-dir(ltr)</code></a> e <a href="/pt-PT/docs/Web/CSS/:-moz-locale-dir(rtl)" title="The documentation about this has not yet been written; please consider contributing!"><code>:-moz-locale-dir(rtl)</code></a> para facilitar a customização de <em>layouts</em> baseados na interface de usuário que está sendo exibida, usando uma localidade da esquerda para a direita ou da direita para a esquerda. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=478416" title="FIXED: Replace chromedir with something more sane">bug 478416</a></li> - <li style="margin-bottom: 0.25em;">Adicionado suporte para a pseudo-classe <a href="/pt-PT/docs/Web/CSS/:indeterminate" title="The documentation about this has not yet been written; please consider contributing!"><code>:indeterminate</code></a>, que combina com elementos <code style="color: inherit; font-weight: inherit;">checkbox</code> <a class="internal" href="/en/HTML/Element/Input" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/HTML/Element/input"><code style="color: inherit; font-weight: inherit;">input</code></a> aos quais o atributo <code style="color: inherit; font-weight: inherit;">indeterminate</code> é <code style="color: inherit; font-weight: inherit;">true</code>.</li> - <li style="margin-bottom: 0.25em;">Plugins em janelas não são mais exibidos em CSS transforms, pois eles não podem ser transformados corretamente pelo compositor.</li> -</ul> - -<h3 id="HTML">HTML </h3> - -<dl style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> - <dt style="font-style: normal; font-weight: bold;"><a href="/en/Using_files_from_web_applications" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/Using files from web applications">Using files from web applications</a></dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">Suporte para a nova API de Arquivos HTML5 foi adicionada ao Gecko, tornando possível para aplicações web acessar arquivos locais selecionados pelo usuário. Isto inclui suporte para a seleção de múltiplos arquivos usando o novo atributo multiple do elemento HTML <code style="color: inherit; font-weight: inherit;">input type="file"</code>.</dd> - <dt style="font-style: normal; font-weight: bold;">HTML5 vídeo suporta quadros <em>poster</em></dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">O atributo <code style="color: inherit; font-weight: inherit;">poster</code> é agora suportado pelo elemento <a class="internal" href="/En/HTML/Element/Video" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="En/HTML/Element/Video"><code style="color: inherit; font-weight: inherit;">video</code></a>, permitindo ao conteúdo especificar um quadro <em>poster</em> a ser exibido até que o vídeo comece a tocar.</dd> - <dt style="font-style: normal; font-weight: bold;">Checkboxes e radio buttons suportam a propriedade <code style="color: inherit; font-weight: inherit;">indeterminate</code></dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">Os elementos HTML <a class="internal" href="/en/HTML/Element/Input" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/HTML/Element/input"><code style="color: inherit; font-weight: inherit;">input</code></a> dos tipos <code style="color: inherit; font-weight: inherit;">checkbox</code> e <code style="color: inherit; font-weight: inherit;">radio</code> agora suportam a propriedade <code>indeterminate</code>, que permite um terceiro estado "indeterminado".</dd> - <dt style="font-style: normal; font-weight: bold;">A suavização de imagens em canvas pode ser controlada</dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">A nova propriedade <a class="internal" href="/en/Canvas_tutorial/Using_images#Controlling_image_scaling_behavior" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/Canvas tutorial/Using images#Controlling image scaling behavior"><code style="color: inherit; font-weight: inherit;">mozImageSmoothingEnabled</code></a> pode ser usada para ativar e desativar a suavização de imagens quando mudando a escala em elementos <a class="internal" href="/en/HTML/Element/canvas" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/HTML/Element/canvas"><code style="color: inherit; font-weight: inherit;">canvas</code></a>.</dd> - <dt style="font-style: normal; font-weight: bold;">Execução de script assíncrona</dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">Configurando o atributo <code style="color: inherit; font-weight: inherit;">async</code> no elemento <a href="/En/HTML/Element/Script" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="En/HTML/Element/Script"><code style="color: inherit; font-weight: inherit;">script</code></a>, o <code style="color: inherit; font-weight: inherit;">script</code> não bloqueará o carregamento ou exibição do resto da página. Ao invés, o <code style="color: inherit; font-weight: inherit;">script</code> executa assim que for baixado.</dd> -</dl> - -<h3 id="JavaScript">JavaScript</h3> - -<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">O Gecko 1.9.2 introduz o JavaScript 1.8.2, o qual adiciona algumas características da linguagem do <a href="/En/JavaScript/ECMAScript_5_support_in_Mozilla" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="https://developer.mozilla.org/En/JavaScript/ECMAScript_5_support_in_Mozilla">ECMAScript 5 standard</a>:</p> - -<ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 25px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> - <li style="margin-bottom: 0.25em;"><a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/parse" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/Core JavaScript 1.5 Reference/Global Objects/Date/parse"><code style="color: inherit; font-weight: inherit;">Date.parse()</code></a> agora pode analizar datas ISO 8601 como YYYY-MM-DD.</li> - <li style="margin-bottom: 0.25em;"> - <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">A propriedade <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/prototype" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/Core JavaScript 1.5 Reference/Global Objects/Function/prototype"><code style="color: inherit; font-weight: inherit;">prototype</code></a> das funções de instâncias não são mais enumeráveis.</p> - </li> -</ul> - -<h3 id="DOM">DOM</h3> - -<dl style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> -</dl> - -<h4 id="Miscelânea_de_mudanças_no_DOM">Miscelânea de mudanças no DOM</h4> - -<ul> - <li style="margin-bottom: 0.25em;">O método <code style="color: inherit; font-weight: inherit;">getBoxObjectFor()</code> foi <strong>removido</strong>, pois não era um padrão e expunha ainda mais coisas fora do padrão na web. Veja <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=340571" title="FIXED: getBoxObjectFor leaking-onto-the-Web disaster">bug 340571</a>. Também afeta <a class="external" href="http://mootools.net/" title="http://mootools.net/">MooTools</a> a qual usa esta chamada para a detecção do Gecko; isto foi resolvido na última versão de MooTools, então, certifique-se de atualizar.</li> - <li style="margin-bottom: 0.25em;">As novas propriedades <a class="internal" href="/en/DOM/window.mozInnerScreenX" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/DOM/window.mozInnerScreenX"><code style="color: inherit; font-weight: inherit;">mozInnerScreenX</code></a> e <a class="internal" href="/en/DOM/window.mozInnerScreenY" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/DOM/window.mozInnerScreenY"><code style="color: inherit; font-weight: inherit;">mozInnerScreenY</code></a> nas janelas do DOM foram adicionadas; estas retornam coordenadas da tela do canto superior esquerdo do visor da janela.</li> - <li style="margin-bottom: 0.25em;">A nova propriedade <a class="internal" href="/en/DOM/window.mozScreenPixelsPerCSSPixel" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/DOM/window.mozScreenPixelsPerCSSPixel"><code style="color: inherit; font-weight: inherit;">mozScreenPixelsPerCSSPixel</code></a>, acessível somente ao chrome, proporciona um fator de conversão entre pixels CSS e pixels da tela; este valor pode variar baseado no nível de zoom do conteúdo.</li> - <li style="margin-bottom: 0.25em;">Quando o identificador de fragmentos de documentos URI's da página (a parte após o caractere "#" (hash)) muda, um novo evento <code style="color: inherit; font-weight: inherit;">hashchange</code> é enviado à página. Veja <a class="internal" href="/en/DOM/window.onhashchange" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="window.onhashchange">window.onhashchange</a> para mais informações. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=385434" title="FIXED: Add support for HTML5 onhashchange (event for named anchor changes)">bug 385434</a></li> - <li style="margin-bottom: 0.25em;">O atributo <a class="internal" href="/en/DOM/document.readyState" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/DOM/document.readyState"><code style="color: inherit; font-weight: inherit;">document.readyState</code></a> é agora suportado. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=347174" title='FIXED: Implement document.readystate == "complete"'>bug 347174</a></li> - <li style="margin-bottom: 0.25em;">Suporte ao <code style="color: inherit; font-weight: inherit;"><a class="internal" href="/en/DOM/element.classList" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="element.classList">element.classList</a></code> HTML5 para permitir a fácil manibulação do atributo <code>class.</code> <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=501257" title="FIXED: Implement HTML 5's HTMLElement.classList property">bug 501257</a></li> - <li style="margin-bottom: 0.25em;"><code style="color: inherit; font-weight: inherit;">localName</code> e <code style="color: inherit; font-weight: inherit;">namespaceURI</code> em documentos HTML agora comportam-se agora assim como nos documentos XHTML: <code style="color: inherit; font-weight: inherit;">localName</code> retorna em minúsculas e <code style="color: inherit; font-weight: inherit;">namespaceURI</code> para elementos HTML é <code style="color: inherit; font-weight: inherit;">"<a class="external" href="http://www.w3.org/1999/xhtml" rel="freelink">http://www.w3.org/1999/xhtml</a>"</code>.</li> - <li style="margin-bottom: 0.25em;"><a href="/en/DOM/element.getElementsByTagNameNS" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/DOM/element.getElementsByTagNameNS"><code style="color: inherit; font-weight: inherit;">element.getElementsByTagNameNS</code></a> não mais suporta minúsculas em seus argumentos, então letras maiúsculas ASCII no argumento evitam a falha de elementos HTML. O mesmo é verdadeiro para <a href="/en/DOM/document.getElementsByTagNameNS" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/DOM/document.getElementsByTagNameNS"><code style="color: inherit; font-weight: inherit;">document.getElementsByTagNameNS</code></a>.</li> - <li style="margin-bottom: 0.25em;">O suporte foi adicionado para endereços em geolocalização pela interface <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMGeoPositionAddress" title="">nsIDOMGeoPositionAddress</a></code> e um novo campo adicionado a <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMGeoPosition" title="">nsIDOMGeoPosition</a></code>.</li> - <li style="margin-bottom: 0.25em;">A função <a href="/pt-PT/docs/Web/API/Window/getComputedStyle" title="The documentation about this has not yet been written; please consider contributing!"><code>window.getComputedStyle</code></a> agora retorna dentro de aspas os valores (URL).</li> -</ul> - -<dl style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> - <dt style="font-style: normal; font-weight: bold;">Web workers podem agora se auto-terminar</dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">Workers agora suportam o método <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/nsIWorkerScope#close()">nsIWorkerScope.close()</a></code>, que permite a eles, terminá-los eles mesmos.</dd> - <dt style="font-style: normal; font-weight: bold;">Arrastar e soltar (drag and drop) agora suportam arquivos</dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">O objeto <a href="/En/DragDrop/DataTransfer" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/DragDrop/DataTransfer"><code style="color: inherit; font-weight: inherit;">DataTransfer</code></a> previsto para arrastar <em>listeners</em> agora inclui uma lista de arquivos que foram arrastados.</dd> - <dt style="font-style: normal; font-weight: bold;">Checando para ver se um elemento combina com um seletor CSS especificado</dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">O novo método <a href="/pt-PT/docs/Web/API/Node/mozMatchesSelector" title="The documentation about this has not yet been written; please consider contributing!"><code>element.mozMatchesSelector</code></a> permite a determinação se um elemento combina ou não com um seletor CSS especificado. Veja <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=518003" title="FIXED: implement function to check whether element matches a CSS selector">bug 518003</a>.</dd> - <dt style="font-style: normal; font-weight: bold;"><a href="/en/Detecting_device_orientation" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/Detecting device orientation">Detecting device orientation</a></dt> - <dt style="font-style: normal; font-weight: bold;"> </dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">O conteúdo pode agora detectar a orientação do dispositivo se ele possuir um acelerômetro suportado, usando o evento <code style="color: rgb(37, 34, 29); font-weight: inherit;">MozOrientation</code>; veja <a href="/en/DOM/window.onmozorientation" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/DOM/window.onmozorientation"><code style="color: inherit; font-weight: inherit;">window.onmozorientation</code></a> para detalhes. O Firefox 3.6 suporta o acelerômetro em laptops Mac.</dd> - <dt style="font-style: normal; font-weight: bold;"><a href="/en/DOM/Detecting_document_width_and_height_changes" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/DOM/Detecting document width and height changes">Detecting document width and height changes</a></dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">O novo evento <code style="color: rgb(37, 34, 29); font-weight: inherit;">MozScrollAreaChanged</code> é despachado sempre que as propriedades <code style="color: rgb(37, 34, 29); font-weight: inherit;">scrollWidth</code> e/ou <code style="color: rgb(37, 34, 29); font-weight: inherit;">scrollHeight</code> do documento mudam.</dd> - <dt> </dt> -</dl> - -<h3 id="XPath">XPath</h3> - -<dl style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> - <dt style="font-style: normal; font-weight: bold;">O método choose() do XPath é agora suportado</dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">O método <a href="/en/XPath/Functions/choose" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/XPath/Functions/choose"><code style="color: inherit; font-weight: inherit;">choose()</code></a> é agora suportado pela nossa implementação do <a href="/en/XPath" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/XPath">XPath</a>.</dd> -</dl> - -<h2 id="Para_desenvolvedores_XUL_e_de_complementos">Para desenvolvedores XUL e de complementos</h2> - -<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">Se você é um desenvolvedor de extensões, deveria começar lendo <a class="internal" href="/en/Updating_extensions_for_Firefox_3.6" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/Updating extensions for Firefox 3.6">Updating extensions for Firefox 3.6</a>, o qual oferece uma introdução útil de que mudanças podem afetar sua extensão. Desenvolvedores de plug-ins deveriam ler <a class="internal" href="/en/Updating_plug-ins_for_Firefox_3.6" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/Updating plug-ins for Firefox 3.6">Updating plug-ins for Firefox 3.6</a>.</p> - -<h3 id="Novas_Características">Novas Características</h3> - -<dl style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> - <dt style="font-style: normal; font-weight: bold;"><a href="/en/Detecting_device_orientation" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/Detecting device orientation">Detecting device orientation</a></dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">O conteúdo pode agora detectar a orientação do dispositivo se ele possuir um acelerômetro suportado, usando o evento <code style="color: rgb(37, 34, 29); font-weight: inherit;">MozOrientation</code>; veja <a href="/en/DOM/window.onmozorientation" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/DOM/window.onmozorientation"><code style="color: inherit; font-weight: inherit;">window.onmozorientation</code></a> para detalhes. O Firefox 3.6 suporta o acelerômetro em laptops Mac.</dd> - <dt style="font-style: normal; font-weight: bold;"><a href="/en/Monitoring_HTTP_activity" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/Monitoring HTTP activity">Monitoring HTTP activity</a></dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">É possível agora monitorar transações HTTP para observar requisições e respostas em tempo real.</dd> - <dt style="font-style: normal; font-weight: bold;"><a href="/en/Working_with_the_Windows_taskbar" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/Working with the Windows taskbar">Working with the Windows taskbar</a></dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">É possível agora customizar a aparência das janelas na barra de tarefas no Windows 7 ou mais recentes.</dd> -</dl> - -<h3 id="Places">Places</h3> - -<ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 25px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> - <li style="margin-bottom: 0.25em;">Consultas ao Places podem agora especificar quando incluir ou não páginas redirecionadas nos resultados. Veja <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=428690" title="FIXED: Two entries added to history menu when visiting a page that redirects">bug 428690</a>.</li> - <li style="margin-bottom: 0.25em;">Adicionado o novo método <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/nsIFaviconService#expireAllFavicons()">nsIFaviconService.expireAllFavicons()</a></code> à interface <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFaviconService" title="">nsIFaviconService</a></code>.</li> -</ul> - -<h3 id="Storage">Storage</h3> - -<dl style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> - <dt style="font-style: normal; font-weight: bold;"><a href="/en/Storage#Collation_(sorting)" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/Storage#Collation (sorting)">Locale-aware collation of data is now supported by the Storage API</a></dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">O Gecko 1.9.2 adicionou várias novos métodos de agrupamento para proporcionar o agrupamento otimizado (classificação) de resultados usando técnicas de localização-consciente.</dd> - <dt style="font-style: normal; font-weight: bold;"><a href="/en/mozIStorageStatementParams#Enumeration_of_properties" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/mozIStorageStatementParams#Enumeration of properties">Properties on a statement can now be enumerated</a></dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">Você pode agora usar a enumeração <code style="color: rgb(37, 34, 29); font-weight: inherit;"><a class="internal" href="/en/Core_JavaScript_1.5_Reference/Statements/for...in" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="En/Core JavaScript 1.5 Reference/Statements/For...in">for..in</a></code> para enumerar todas as propriedades de uma declaração.</dd> - <dt style="font-style: normal; font-weight: bold;">mozIStorageStatement's getParameterIndex teve o comportamento alterado entre 3.5 e 3.6.</dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">Veja <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=528166" title="mozIStorageStatement getParameterIndex causes NS_ERROR_ILLEGAL_VALUE">bug 528166</a> para detalhes.</dd> - <dt style="font-style: normal; font-weight: bold;">Ligar vários conjuntos de parâmetros assincronamente para executar uma declaração.</dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">Veja <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=490085" title="FIXED: Add ability to bind multiple sets of parameters and execute asynchronously">bug 490085</a> para detalhes. A documentação virá em breve.</dd> -</dl> - -<h3 id="Preferências">Preferências</h3> - -<ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 25px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> - <li style="margin-bottom: 0.25em;">A interface <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIContentPrefService" title="">nsIContentPrefService</a></code> possui dois novos métodos: <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/nsIContentPrefService#getPrefsByName()">nsIContentPrefService.getPrefsByName()</a></code> e <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/nsIContentPrefService#removePrefsByName()">nsIContentPrefService.removePrefsByName()</a></code>.</li> -</ul> - -<h3 id="Temas">Temas</h3> - -<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">Veja <a class="internal" href="/en/Updating_themes_for_Firefox_3.6" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/Updating themes for Firefox 3.6">Updating themes for Firefox 3.6</a> para detalhes.</p> - -<dl style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> - <dt style="font-style: normal; font-weight: bold;"><a href="/en/Themes/Lightweight_themes" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/Themes/Lightweight themes">Lightweight themes</a></dt> - <dd style="margin-left: 0px; margin-bottom: 20px; padding-left: 16px; border-bottom-width: 1px; border-bottom-style: dashed; margin-top: 0px; margin-right: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 4px;">O Firefox 3.6 suporta temas leves; estes são temas fáceis de criar que simplesmente aplicam uma imagem de fundo ao topo (barra de endereços e barra de botões) e inferior (barra de estado (status)) das janelas do navegador. Esta é uma integração à arquitetura de temas existente <a class="external" href="http://www.getpersonas.com/" title="http://www.getpersonas.com/">Personas</a> no Firefox.</dd> -</dl> - -<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> </p> - -<h3 id="Miscelânea">Miscelânea</h3> - -<ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 25px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> - <li style="margin-bottom: 0.25em;">O Firefox não carregará mais componentes de terceiros instalados em seu diretório interno de componentes. Isto ajuda a assegurar estabilidade, prevenindo componentes defeituosos de terceiros de serem executados. Desenvolvedores que instalarem componentes desta maneira devem<a href="/en/Migrating_raw_components_to_add-ons" title="en/Migrating raw components to add-ons"> re-empacotar seus componentes como pacotes XPI</a> (en) para então poderem ser instalados como complementos padrão.</li> - <li style="margin-bottom: 0.25em;"><code style="color: rgb(37, 34, 29); font-weight: inherit;">contents.rdf</code> não é mais suportado para o registro do chrome nas extensões. Ao invés disso, deve-se agora usar o arquivo <a class="internal" href="/en/Install_Manifests" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/Install manifests"><code style="color: inherit; font-weight: inherit;">chrome.manifest</code></a>. Veja <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=492008" title="FIXED: Drop support for contents.rdf chrome registrations">bug 492008</a>.</li> - <li style="margin-bottom: 0.25em;">Adicionado suporte para ocultar a barra de menus automaticamente. Veja <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=477256" title="FIXED: Implement menubar auto-hiding in toolkit">bug 477256</a>.</li> - <li style="margin-bottom: 0.25em;">Adicionado suporte para o atributo <code style="color: rgb(37, 34, 29); font-weight: inherit;">container-live-role</code> para objetos. Veja <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=391829" title="FIXED: Add support for container-live-role to object attributes">bug 391829</a>.</li> - <li style="margin-bottom: 0.25em;">O obrigatório <code style="color: rgb(37, 34, 29); font-weight: inherit;">tabs-closebutton</code> foi removido. Veja <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=500971" title="FIXED: Remove obsolete tabs-closebutton binding">bug 500971</a>.</li> - <li style="margin-bottom: 0.25em;">Adicionado suporte a <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISound" title="">nsISound</a></code> para tocar sons baseados em eventos que tenham ocorrido. Veja <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=502799" title="FIXED: add new nsISound method for the event sounds">bug 502799</a>.</li> - <li style="margin-bottom: 0.25em;">A sintaxe para os métodos <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/nsITreeView#canDrop()">nsITreeView.canDrop()</a></code> e <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/nsITreeView#drop()">nsITreeView.drop()</a></code> de <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITreeView" title="">nsITreeView</a></code> foi mudada para suportar a nova API de arrastar e soltar (drag & drop) introduzida no Gecko 1.9. Veja <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=455590" title="FIXED: Allow new dnd api with tree views">bug 455590</a>.</li> - <li style="margin-bottom: 0.25em;">Adicionado suporte para trocar o cursor do mouse para o botão padrão de diálogo ou assistente no Windows, veja <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=76053" title='FIXED: Windows mouse integration: "Snap to default button in dialog boxes"'>bug 76053</a>. Isto é processdo automaticamente pelo elemento de diálogo ou assistente, mas se uma aplicação XUL cria uma janela usando o elemento <code style="color: rgb(37, 34, 29); font-weight: inherit;">window</code> e ele possui um botão padrão, é necessário chamar <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/nsIDOMChromeWindow#notifyDefaultButtonLoaded()">nsIDOMChromeWindow.notifyDefaultButtonLoaded()</a></code> durante o evento manipulador <code style="color: rgb(37, 34, 29); font-weight: inherit;">onload</code> da janela.</li> - <li style="margin-bottom: 0.25em;">A interface <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsILocalFileMac" title="">nsILocalFileMac</a></code> teve dos elementos removidos: <code style="color: rgb(37, 34, 29); font-weight: inherit;">setFileTypeAndCreatorFromMIMEType()</code> e <code style="color: rgb(37, 34, 29); font-weight: inherit;">setFileTypeAndCreatorFromExtension()</code>.</li> - <li style="margin-bottom: 0.25em;">O novo módulo de código <a class="internal" href="/en/JavaScript/Code_modules/NetUtil.jsm" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/JavaScript code modules/NetUtil.jsm"><code style="color: inherit; font-weight: inherit;">NetUtils.jsm</code></a> proporciona um método fácil de usar para a cópia de dados assíncrona de um fluxo de entrada para um fluxo de saída.</li> - <li style="margin-bottom: 0.25em;">O novo módulo de código <a class="internal" href="/en/JavaScript/Code_modules/openLocationLastURL.jsm" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/JavaScript code modules/openLocationLastURL.jsm"><code style="color: inherit; font-weight: inherit;">openLocationLastURL.jsm</code></a> permite a facilidade para ler e mudar o valor de "Open Location" das URLs lembradas pela caixa de diálogo adequadamente enquanto no modo de navegação privativa.</li> - <li style="margin-bottom: 0.25em;">No Windows, a interface <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIScreen" title="">nsIScreen</a></code> agora reporta profundidades de cor de 24 bits por pixel quando o driver gráfico solicita 32 bits, uma vez que 24 representa mais acuradamente o número atual de pixels de cor em uso.</li> - <li style="margin-bottom: 0.25em;">Barras de menu podem agora ser ocultadas no Windows, usando o novo atributo <code id="a-autohide"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/autohide">autohide</a></code> no elemento XUL <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/toolbar" title="toolbar">toolbar</a></code>.</li> - <li style="margin-bottom: 0.25em;">Os métodos <span id="m-loadOneTab"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/loadOneTab">loadOneTab</a></code></span> e <span id="m-addTab"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/addTab">addTab</a></code></span> agora aceitam um novo parâmetro <code style="color: rgb(37, 34, 29); font-weight: inherit;">relatedToCurrent</code> e, em adição, permitem aos parâmetros serem especificados pelo nome, uma vez que quase todos os parâmetros são opcionais.</li> - <li style="margin-bottom: 0.25em;">A propriedade "<a href="/en/Install_Manifests#hidden" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/Install Manifests#hidden">hidden</a>" não é mais suportada em manifestos de instalação; não é mais possível evitar que o usuário veja complementos na janela do gerenciador de complementos.</li> - <li style="margin-bottom: 0.25em;">O componente <code style="color: rgb(37, 34, 29); font-weight: inherit;">@mozilla.org/webshell;1</code> não existe mais; é necessário usar <code style="color: rgb(37, 34, 29); font-weight: inherit;">@mozilla.org/docshell;1</code> ao invés.</li> - <li style="margin-bottom: 0.25em;">É possível agora registrar com a categoria update-timer para agendar eventos de tempo sem precisar instanciar o objeto que o contador eventualmente chamará; ao invés disso, ele será instanciado quando for necessário. Veja <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/nsIUpdateTimerManager#registerTimer()">nsIUpdateTimerManager.registerTimer()</a></code> para detalhes.</li> - <li style="margin-bottom: 0.25em;">A função <a href="/en/NPN_GetValue" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/NPN GetValue"><code style="color: inherit; font-weight: inherit;">NPN_GetValue()</code></a> não mais provê acesso ao XPCOM através dos valores das variáveis <code style="color: inherit; font-weight: inherit;">NPNVserviceManager</code>, <code style="color: inherit; font-weight: inherit;">NPNVDOMelement</code> e <code style="color: inherit; font-weight: inherit;">NPNVDOMWindow</code>. Isto é parte do trabalho de fazer com que os plugins rodem processos separados em uma versão futura do Gecko.</li> - <li style="margin-bottom: 0.25em;">Os plugins não são mais <em>scriptable</em> através das interfaces do XPCOM (IDL), <a href="/en/Gecko_Plugin_API_Reference/Scripting_plugins" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/Gecko Plugin API Reference:Scripting plugins">NPRuntime</a> é a API a ser usada para tornar estes plugins <em>scriptable</em>, e <a href="/en/NPP_GetValue" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/NPP GetValue"><code style="color: inherit; font-weight: inherit;">NPP_GetValue()</code></a> não é mais chamado com o valor de <code style="color: inherit; font-weight: inherit;">NPPVpluginScriptableInstance</code> ou <code style="color: inherit; font-weight: inherit;">NPPVpluginScriptableIID</code>. Isto é parte do trabalho de fazer com que os plugins rodem processos separados em uma versão futura do Gecko.</li> -</ul> - -<h2 id="Para_desenvolvedores_FirefoxGecko">Para desenvolvedores Firefox/Gecko</h2> - -<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">Algumas mudanças são interessantes somente se você trabalha internamente no próprio Firefox.</p> - -<h3 id="Interfaces_mescladas">Interfaces mescladas</h3> - -<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">As seguintes interfaces foram unidas:</p> - -<ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 25px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> - <li style="margin-bottom: 0.25em;"><code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIPluginTagInfo2</code> foi mesclada em <code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIPluginTagInfo</code>.</li> - <li style="margin-bottom: 0.25em;"><code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIPluginInstanceInternal</code>, <code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIPPluginInstancePeer</code>, <code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIPluginInstancePeer1</code>, <code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIPluginInstancePeer2 e </code><code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIPluginInstancePeer3</code> foram todas mescladas em <code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIPluginInstance</code>.</li> - <li style="margin-bottom: 0.25em;"><code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIWindowlessPlugInstPeer</code> foi mesclada em <code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIPluginInstance</code>.</li> - <li style="margin-bottom: 0.25em;"><code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIPluginManager </code>e <code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIPluginManager2</code> foram mescladas em <code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIPluginHost</code>.</li> -</ul> - -<h3 id="Interfaces_removidas">Interfaces removidas</h3> - -<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">As seguintes interfaces foram removidas inteiramente porque eram obsoletas, não utilizadas ou não implementadas:</p> - -<ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 25px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> - <li style="margin-bottom: 0.25em;"><code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIFullScreen</code></li> - <li style="margin-bottom: 0.25em;"><code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIDOMSVGListener</code></li> - <li style="margin-bottom: 0.25em;"><code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIDOMSVGZoomListener</code></li> - <li style="margin-bottom: 0.25em;"><code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIInternetConfigService</code></li> - <li style="margin-bottom: 0.25em;"><code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIDKey</code></li> - <li style="margin-bottom: 0.25em;"><code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIEventHandler</code></li> - <li style="margin-bottom: 0.25em;"><code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIJRILiveConnectPIPeer</code></li> - <li style="margin-bottom: 0.25em;"><code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIJRILiveConnectPlugin</code></li> - <li style="margin-bottom: 0.25em;"><code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIScriptablePlugin</code></li> - <li style="margin-bottom: 0.25em;"><code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIClassicPluginFactory</code></li> - <li style="margin-bottom: 0.25em;"><code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIFileUtilities</code></li> -</ul> - -<h3 id="Interfaces_movidas">Interfaces movidas</h3> - -<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">As seguintes interfaces foram realocadas de seus arquivos IDL anteriores em novos:</p> - -<ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 25px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> - <li style="margin-bottom: 0.25em;"><code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIDOMNSCSS2Properties</code> está agora localizada em seu próprio arquivo IDL (<code style="color: rgb(37, 34, 29); font-weight: inherit;">dom/interfaces/css/nsIDOMCSS2Properties.idl</code>).</li> - <li style="margin-bottom: 0.25em;"><code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIUpdateTimerManager" title="">nsIUpdateTimerManager</a></code> está agora localizada em seu próprio arquivo IDL.</li> -</ul> - -<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">Um grande número de interfaces foram movidas. Veja <a href="/en/Interfaces_moved_in_Firefox_3.6" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="en/Interfaces moved in Firefox 3.6">Interfaces moved in Firefox 3.6</a> para uma lista completa.</p> - -<h3 id="Outras_mudanças_na_interface">Outras mudanças na interface</h3> - -<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">As seguintes alterações foram feitas:</p> - -<ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 25px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> - <li style="margin-bottom: 0.25em;">A interface <code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIPlugin</code> agora herda de <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code> ao invés de <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFactory" title="">nsIFactory</a></code>.</li> - <li style="margin-bottom: 0.25em;">A interface <code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIPluginHost</code> agora herda de <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code> ao invés de <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFactory" title="">nsIFactory</a></code>.</li> - <li style="margin-bottom: 0.25em;">A interface <code style="color: rgb(37, 34, 29); font-weight: inherit;">nsIFrame</code> agora herda de <code style="color: rgb(37, 34, 29); font-weight: inherit;">nsQueryFrame</code> ao invés de <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code>.</li> - <li style="margin-bottom: 0.25em;">O método getPaletteInfo() de <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDeviceContext" title="">nsIDeviceContext</a></code> foi removido, haja vista que ele nunca foi implementado.</li> - <li style="margin-bottom: 0.25em;">O método reportPendingException() de <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIScriptContext" title="">nsIScriptContext</a></code> foi removido, já que ele não estava mais sendo usado.</li> -</ul> - -<p> </p> - -<h3 id="Mudanças_na_acessibilidade_do_código">Mudanças na acessibilidade do código</h3> - -<ul> - <li>O <a href="/en/XPCOM_Interface_Reference/nsIAccessibleEvent" title="en/XPCOM Interface Reference/nsIAccessibleEvent">evento de acessibilidade</a> (en) <code style="color: rgb(37, 34, 29); font-weight: inherit;">EVENT_REORDER</code> é agora enviado quando os "filhos" dos frames e iframes mudam, assim como quando os "filhos" do documento principal mudam. Veja <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=420845" title="FIXED: Fire event_reorder on any embedded frames/iframes whos document has just loaded.">bug 420845</a>.</li> - <li>O <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/nsIAccessibleTable#selectRow()">nsIAccessibleTable.selectRow()</a></code> agora remove corretamente qualquer seleção corrente antes de selecionar uma linha específica.</li> -</ul> - -<h3 id="Veja_também">Veja também</h3> - -<ul> - <li><a href="/Pt/Firefox_3.5_para_desenvolvedores" title="Pt/Firefox 3.5 para desenvolvedores">Firefox 3.5 para desenvolvedores</a></li> - <li style="margin-bottom: 0.25em;"><a class="internal" href="/pt/Firefox_3_para_desenvolvedores" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="pt/Firefox 3 para desenvolvedores">Firefox 3 para desenvolvedores</a></li> - <li style="margin-bottom: 0.25em;"><a class="internal" href="/pt/Firefox_2_para_desenvolvedores" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="pt/Firefox 2 para desenvolvedores">Firefox 2 para desenvolvedores</a></li> - <li style="margin-bottom: 0.25em;"><a class="internal" href="/pt/Firefox_1.5_para_Desenvolvedores" style="text-decoration: none; color: rgb(4, 137, 183) !important; cursor: default;" title="pt/Firefox 1.5 para Desenvolvedores">Firefox 1.5 para desenvolvedores</a></li> -</ul> diff --git a/files/pt-pt/mozilla/firefox/releases/3/index.html b/files/pt-pt/mozilla/firefox/releases/3/index.html deleted file mode 100644 index 129fa2fc1e..0000000000 --- a/files/pt-pt/mozilla/firefox/releases/3/index.html +++ /dev/null @@ -1,298 +0,0 @@ ---- -title: Firefox 3 for developers -slug: Mozilla/Firefox/Releases/3 -tags: - - Firefox 3 - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Firefox/Releases/3 ---- -<div>{{FirefoxSidebar}}</div><p>If you're a developer trying to get a handle on all the new features in Firefox 3, this is the perfect place to start. This article provides a list of the new articles covering features added to Firefox 3. While it doesn't necessarily cover every little change, it will help you learn about the major improvements.</p> -<h2 id="New_developer_features_in_Firefox_3" name="New_developer_features_in_Firefox_3">New developer features in Firefox 3</h2> -<h3 id="For_web_site_and_application_developers" name="For_web_site_and_application_developers">For web site and application developers</h3> -<dl> - <dt> - <a href="/en-US/docs/Updating_web_applications_for_Firefox_3" title="en-US/docs/Updating_web_applications_for_Firefox_3">Updating web applications for Firefox 3</a></dt> - <dd> - Provides information about changes you may need to make to your web site or web application to take advantage of new features in Firefox 3.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Online_and_offline_events" title="en-US/docs/Online_and_offline_events">Online and offline events</a></dt> - <dd> - Firefox 3 supports WHATWG online and offline events, which let applications and extensions detect whether or not there's an active Internet connection, as well as to detect when the connection goes up and down.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Web-based_protocol_handlers" title="en-US/docs/Web-based_protocol_handlers">Web-based protocol handlers</a></dt> - <dd> - You can now register web applications as protocol handlers using the <code>navigator.registerProtocolHandler()</code> method.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Drawing_text_using_a_canvas" title="en-US/docs/Drawing_text_using_a_canvas">Drawing text using a canvas</a></dt> - <dd> - You can now draw text in a canvas using a non-standardized API supported by Firefox 3.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Canvas_tutorial/Transformations#Transforms" title="en-US/docs/Canvas_tutorial/Transformations#Transforms">Transform support for canvas</a></dt> - <dd> - Firefox now supports the <code>transform()</code> and <code>setTransform()</code> methods on canvases.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Using_microformats" title="en-US/docs/Using_microformats">Using microformats</a></dt> - <dd> - Firefox now has APIs for working with microformats.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Drag_and_drop_events" title="en-US/docs/Drag_and_drop_events">Drag and drop events</a></dt> - <dd> - Firefox 3 supports new events that are sent to the source node for a drag operation when the drag begins and ends.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Focus_management_in_HTML" title="en-US/docs/Focus_management_in_HTML">Focus management in HTML</a></dt> - <dd> - The new HTML 5 <code>activeElement</code> and <code>hasFocus</code> attributes are supported.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Offline_resources_in_Firefox" title="en-US/docs/Offline_resources_in_Firefox">Offline resources in Firefox</a></dt> - <dd> - Firefox now lets web applications request that resources be cached to allow the application to be used while offline.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/CSS_improvements_in_Firefox_3" title="en-US/docs/CSS_improvements_in_Firefox_3">CSS improvements in Firefox 3</a></dt> - <dd> - Firefox 3 features a number of improvements in its CSS support.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/DOM_improvements_in_Firefox_3" title="en-US/docs/DOM_improvements_in_Firefox_3">DOM improvements in Firefox 3</a></dt> - <dd> - Firefox 3 offers a number of new features in Firefox 3's DOM implementation, including support for several Internet Explorer extensions to the DOM.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/New_in_JavaScript_1.8" title="en-US/docs/New_in_JavaScript_1.8">JavaScript 1.8 support</a></dt> - <dd> - Firefox 3 offers JavaScript 1.8.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/EXSLT" title="en-US/docs/EXSLT">EXSLT support</a></dt> - <dd> - Firefox 3 provides support for a substantial subset of the <a href="/en-US/docs/EXSLT" title="en-US/docs/EXSLT">EXSLT</a> extensions to <a href="/en-US/docs/XSLT" title="en-US/docs/XSLT">XSLT</a>.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/SVG_improvements_in_Firefox_3" title="en-US/docs/SVG_improvements_in_Firefox_3">SVG improvements in Firefox 3</a></dt> - <dd> - SVG support in Firefox 3 has been upgraded significantly, with support for over two dozen new filters, several new elements and attributes, and other improvements.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Animated_PNG_graphics" title="en-US/docs/Animated_PNG_graphics">Animated PNG graphics</a></dt> - <dd> - Firefox 3 supports the animated PNG (APNG) image format.</dd> -</dl> -<h3 id="For_XUL_and_extension_developers" name="For_XUL_and_extension_developers">For XUL and extension developers</h3> -<h4 id="Notable_changes_and_improvements" name="Notable_changes_and_improvements">Notable changes and improvements</h4> -<dl> - <dt> - <a href="/en-US/docs/Updating_extensions_for_Firefox_3" title="en-US/docs/Updating_extensions_for_Firefox_3">Updating extensions for Firefox 3</a></dt> - <dd> - Provides a guide to the things you'll need to do to update your extension to work with Firefox 3.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/XUL_improvements_in_Firefox_3" title="en-US/docs/XUL_improvements_in_Firefox_3">XUL improvements in Firefox 3</a></dt> - <dd> - Firefox 3 offers a number of new XUL elements, including new sliding scales, the date and time pickers, and spin buttons.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Templates_in_Firefox_3" title="en-US/docs/Templates_in_Firefox_3">Templates in Firefox 3</a></dt> - <dd> - Templates have been significantly improved in Firefox 3. The key improvement allows the use of custom query processors to allow data sources other than RDF to be used.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Extension_Versioning,_Update_and_Compatibility#Securing_Updates" title="en-US/docs/Extension_Versioning,_Update_and_Compatibility#Securing_Updates">Securing updates</a></dt> - <dd> - In order to provide a more secure add-on upgrade path for users, add-ons are now required to provide a secure method for obtaining updates before they can be installed. Add-ons hosted at <a class="external" href="http://addons.mozilla.org">AMO</a> automatically provide this. Any add-ons installed that do not provide a secure update method when the user upgrades to Firefox 3 will be automatically disabled. Firefox will however continue to check for updates to the extension over the insecure path and attempt to install any update offered (installation will fail if the update also fails to provide a secure update method).</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Places_Developer_Guide" title="en-US/docs/Places_migration_guide">Places migration guide</a></dt> - <dd> - An article about how to update an existing extension to use the Places API.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Download_Manager_improvements_in_Firefox_3" title="en-US/docs/Download_Manager_improvements_in_Firefox_3">Download Manager improvements in Firefox 3</a></dt> - <dd> - The Firefox 3 Download Manager features new and improved APIs, including support for multiple progress listeners.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/XPCOM_Interface_Reference/Using_nsILoginManager" title="en-US/docs/Using_nsILoginManager">Using nsILoginManager</a></dt> - <dd> - The Password Manager has been replaced by the new Login Manager.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/XBL/XBL_1.0_Reference/Elements#binding" title="en-US/docs/XBL/XBL_1.0_Reference/Elements#binding">Embedding XBL bindings</a></dt> - <dd> - You can now use the <code>data:</code> URL scheme from chrome code to embed XBL bindings directly instead of having them in separate XML files.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Localizing_extension_descriptions" title="en-US/docs/Localizing_extension_descriptions">Localizing extension descriptions</a></dt> - <dd> - Firefox 3 offers a new method for localizing add-on metadata. This lets the localized details be available as soon as the add-on has been downloaded, as well as when the add-on is disabled.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Localization_and_Plurals" title="en-US/docs/Localization_and_Plurals">Localization and Plurals</a></dt> - <dd> - Firefox 3 adds the new PluralForm module, which provides tools to aid in correctly pluralizing words in multiple localizations.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Theme_changes_in_Firefox_3" title="en-US/docs/Theme_changes_in_Firefox_3">Theme changes in Firefox 3</a></dt> - <dd> - Notes and information of use to people who want to create themes for Firefox 3.</dd> -</dl> -<h4 id="New_components_and_functionality" name="New_components_and_functionality">New components and functionality</h4> -<dl> - <dt> - <a href="/en-US/docs/Toolkit_API/FUEL" title="en-US/docs/FUEL">FUEL Library</a></dt> - <dd> - FUEL is about making it easier for extension developers to be productive, by minimizing some of the XPCOM formality and adding some "modern" JavaScript ideas.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Places" title="en-US/docs/Places">Places</a></dt> - <dd> - The history and bookmarks APIs have been completely replaced by the new <a href="/en-US/docs/Places" title="en-US/docs/Places">Places</a> API.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/nsIIdleService" title="en-US/docs/nsIIdleService">Idle service</a></dt> - <dd> - Firefox 3 offers the new {{Interface("nsIIdleService")}} interface, which lets extensions determine how long it's been since the user last pressed a key or moved their mouse.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/nsIZipWriter" title="en-US/docs/nsIZipWriter">ZIP writer</a></dt> - <dd> - The new {{Interface("nsIZipWriter")}} interface lets extensions create ZIP archives.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Full_page_zoom" title="en-US/docs/Full_page_zoom">Full page zoom</a></dt> - <dd> - Firefox 3 improves the user experience by offering full page zoom in addition to text-only zoom.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Interfacing_with_the_XPCOM_cycle_collector" title="en-US/docs/Interfacing_with_the_XPCOM_cycle_collector">Interfacing with the XPCOM cycle collector</a></dt> - <dd> - XPCOM code can now take advantage of the cycle collector, which helps ensure that unused memory gets released instead of leaking.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/The_Thread_Manager" title="en-US/docs/The_Thread_Manager">The Thread Manager</a></dt> - <dd> - Firefox 3 provides the new {{Interface("nsIThreadManager")}} interface, along with new interfaces for threads and thread events, which provides a convenient way to create and manage threads in your code.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/JavaScript_code_modules" title="en-US/docs/JavaScript_modules">JavaScript modules</a></dt> - <dd> - Firefox 3 now offers a new shared code module mechanism that lets you easily create modules in JavaScript that can be loaded by extensions and applications for use, much like shared libraries.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/nsIJSON" title="en-US/docs/nsIJSON">The <code>nsIJSON</code> interface</a></dt> - <dd> - Firefox 3 offers the new {{Interface("nsIJSON")}} interface, which offers high-performance encoding and decoding of <a href="/en-US/docs/JSON" title="en-US/docs/JSON">JSON</a> strings.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/XPCOM_Interface_Reference/nsIParentalControlsService" title="en-US/docs/nsIParentalControlsService">The nsIParentalControlsService interface</a></dt> - <dd> - Firefox 3 now supports the Microsoft Windows Vista parental controls feature, and allows code to interact with it.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Using_content_preferences" title="en-US/docs/Using_content_preferences">Using content preferences</a></dt> - <dd> - Firefox 3 includes a new service for getting and setting arbitrary site-specific preferences that extensions as well as core code can use to keep track of their users' preferences for individual sites.</dd> -</dl> -<dl> - <dt> - <a href="/en-US/docs/Monitoring_plugins" title="en-US/docs/Monitoring_plugins">Plug-in Monitoring</a></dt> - <dd> - A new component of the plugin system is now available to measure how long it takes plugins (e.g., Macromedia Flash) to execute their calls.</dd> -</dl> -<h4 id="Fixed_bugs" name="Fixed_bugs">Fixed bugs</h4> -<dl> - <dt> - <a href="/en-US/docs/Notable_bugs_fixed_in_Firefox_3" title="en-US/docs/Notable_bugs_fixed_in_Firefox_3">Notable bugs fixed in Firefox 3</a></dt> - <dd> - This article provides information about bugs that have been fixed in Firefox 3.</dd> -</dl> -<h2 id="New_features_for_end_users" name="New_features_for_end_users">New features for end users</h2> -<h3 id="User_experience" name="User_experience">User experience</h3> -<ul> - <li><strong>Easier password management.</strong> An information bar at the top of the browser window now appears to allow you to save passwords after a successful login.</li> - <li><strong>Simplified add-on installation.</strong> You can now install extensions from third-party download sites in fewer clicks, thanks to the removal of the add-on download site whitelist.</li> - <li><strong>New Download Manager.</strong> The download manager makes it easier to locate your downloaded files.</li> - <li><strong>Resumable downloads.</strong> You can now resume downloads after restarting the browser or resetting your network connection.</li> - <li><strong>Full page zoom.</strong> From the View menu and using keyboard shortcuts, you can now zoom in and out on the content of entire pages -- this scales not just the text but the layout and images as well.</li> - <li><strong>Tab scrolling and quickmenu.</strong> Tabs are easier to locate with the new tab scrolling and tab quickmenu features.</li> - <li><strong>Save what you were doing.</strong> Firefox 3 prompts you to see if you'd like to save your current tabs when you exit Firefox.</li> - <li><strong>Optimized Open in Tabs behavior.</strong> Opening a folder of bookmarks in tabs now appends the new tabs instead of replacing the existing ones.</li> - <li><strong>Easier to resize location and search bars.</strong> You can now easily resize the location and search bars using a simple resize handle between them.</li> - <li><strong>Text selection improvements.</strong> You can now select multiple ranges of text using the Control (Command on Macintosh) key. Double-clicking and dragging now selects in "word-by-word" mode. Triple-clicking selects an entire paragraph.</li> - <li><strong>Find toolbar.</strong> The Find toolbar now opens with the current selection.</li> - <li><strong>Plugin management.</strong> Users can now disable individual plugins in the Add-on Manager.</li> - <li><strong>Integration with Windows Vista.</strong> Firefox's menus now display using Vista's native theme.</li> - <li><strong>Integration with Mac OS X.</strong> Firefox now supports <a class="external" href="http://growl.info/">Growl</a> for notifications of completed downloads and available updates.</li> - <li><strong>Star button.</strong> The new star button in the location bar lets you quickly add a new bookmark with a single click. A second click lets you file and tag your new bookmark.</li> - <li><strong>Tags.</strong> You can now associate keywords with your bookmarks to easily sort them by topic.</li> - <li><strong>Location bar and auto-complete.</strong> Type the title or tag of a page in the location bar to quickly find the site you were looking for in your history and bookmarks. Favicons, bookmark, and tag indicators help you see where the results are coming from.</li> - <li><strong>Smart Bookmarks folder.</strong> Firefox's new Smart Bookmarks folder offers quick access to your recently bookmarked and tagged places, as well as pages you visit frequently.</li> - <li><strong>Bookmarks and History Organizer.</strong> The new unified bookmarks and history organizer lets you easily search your history and bookmarks with multiple views and smart folders for saving your frequent searches.</li> - <li><strong>Web-based protocol handlers.</strong> Web applications, such as your favorite web mail provider, can now be used instead of desktop applications for handling <code>mailto:</code> links from other sites. Similar support is provided for other protocols as well. (Note that web applications do have to register themselves with Firefox before this will work.)</li> - <li><strong>Easy to use Download Actions.</strong> A new Applications preferences pane provides an improved user interface for configuring handlers for various file types and protocol schemes.</li> - <li><strong>Improved look and feel.</strong> Graphics and font handling have been improved to make web sites look better on your screen, including sharper text rendering and better support for fonts with ligatures and complex scripts. In addition, Mac and Linux (Gnome) users will find that Firefox feels more like a native application for their platform than ever, with a new, native, look and feel.</li> - <li><strong>Color management support.</strong> By setting the <code>gfx.color_management.enabled</code> preference in <code>{{mediawiki.external('about:config')}}</code>, you can ask Firefox to use the color profiles embedded in images to adjust the colors to match your computer's display.</li> - <li><strong>Offline support.</strong> Web applications can take advantage of new features to support being used even when you don't have an Internet connection.</li> -</ul> -<h3 id="Security_and_privacy" name="Security_and_privacy">Security and privacy</h3> -<ul> - <li><strong>One-click site information.</strong> Want to know more about the site you're visiting? Click the site's icon in the location bar to see who owns it. Identify information is prominently displayed and easier than ever to understand.</li> - <li><strong>Malware protection.</strong> Firefox 3 warns you if you arrive at a web site that is known to install viruses, spyware, trojans, or other dangerous software (known as malware). You can see what the warning looks like by <a class="link-https" href="https://www.mozilla.com/firefox/its-an-attack.html">clicking here</a>.</li> - <li><strong>Web forgery protection enhanced.</strong> Now when you visit a page that's suspected of being a forgery, you're shown a special page instead of the contents of the page with a warning. <a class="link-https" href="https://www.mozilla.com/firefox/its-a-trap.html">Click here</a> to see what it looks like.</li> - <li><strong>Easier to understand SSL errors.</strong> The errors presented when an invalid SSL certificate is encountered have been clarified to make it easier to understand what the problem is.</li> - <li><strong>Out-of-date add-on protection.</strong> Firefox 3 now automatically checks add-on and plugin versions and disables older, insecure versions.</li> - <li><strong>Secure add-on updates.</strong> Add-on update security has been improved by disallowing add-ons that use an insecure update mechanism.</li> - <li><strong>Anti-virus integration.</strong> Firefox 3 now informs anti-virus software when executable files are downloaded.</li> - <li><strong>Windows Vista parental controls support.</strong> Firefox 3 supports the Vista system-wide parental control setting for disabling file downloads.</li> -</ul> -<h3 id="Performance" name="Performance">Performance</h3> -<ul> - <li><strong>Reliability.</strong> Firefox 3 now stores bookmarks, history, cookies, and preferences in a transactionally secure database format. This means your data is protected against loss even if your system crashes.</li> - <li><strong>Speed.</strong> Firefox 3 has gotten a performance boost by completely replacing the part of the software that handles drawing to your screen, as well as to how page layout work is handled.</li> - <li><strong>Memory use reduced.</strong> Firefox 3 is more memory efficient than ever, with over 300 memory "leak" bugs fixed and new features to help automatically locate and dispose of leaked memory blocks.</li> -</ul> -<h2 id="See_also" name="See_also">See also</h2> - -<div>{{Firefox_for_developers('2')}}</div> diff --git a/files/pt-pt/mozilla/firefox/releases/3/site_compatibility/index.html b/files/pt-pt/mozilla/firefox/releases/3/site_compatibility/index.html deleted file mode 100644 index 3c8b290205..0000000000 --- a/files/pt-pt/mozilla/firefox/releases/3/site_compatibility/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: Mudanças no Gecko 1.9 que afetam websites -slug: Mozilla/Firefox/Releases/3/Site_compatibility -tags: - - Desenvolvimento_Web - - Gecko - - Todas_as_Categorias -translation_of: Mozilla/Firefox/Releases/3/Site_compatibility -original_slug: Mudanças_no_Gecko_1.9_que_afetam_websites ---- -<div>{{FirefoxSidebar}}</div> - -<p>Esta página tenta dar uma introdução das mudanças entre o <a href="pt/Gecko">Gecko</a> 1.8 e o Gecko 1.9, que poderia possivelmente afetar websites em seu comportamento ou interpretação. Veja também <a href="pt/Firefox_3_para_desenvolvedores">Firefox 3 para desenvolvedores</a>.</p> - -<h2 id="Eventos" name="Eventos">Eventos</h2> - -<h3 id="Capturando_ouvintes_de_carregamento_de_eventos" name="Capturando_ouvintes_de_carregamento_de_eventos">Capturando ouvintes de carregamento de eventos</h3> - -<p>No Gecko 1.8, não era possível configurar a captura de ouvintes de carregamento de eventos em imagens. No Gecko 1.9, isto foi corrigido por {{ Bug(234455) }}. Mas isto pode causar problemas em websites que tenham seus ouvintes de eventos incorretamente configurados para capturar o carregamento de evento. Veja a discussão em {{ Bug(335251) }}. Para corrigir este problema, a página problemática em questão não deve configurar uma captura de ouvintes de carregamento de eventos.</p> - -<p>Por exemplo, isto:</p> - -<pre class="eval">window.addEventListener('load', yourFunction, true); -</pre> - -<p>deve ser mudado nisto:</p> - -<pre class="eval">window.addEventListener('load', yourFunction, false); -</pre> - -<p>Para uma explanação de como eventos de captura trabalham, veja <a class="external" href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow-capture">DOM Level 2 Event capture</a></p> - -<h3 id="preventBubble_foi_removido" name="preventBubble_foi_removido"><code>preventBubble</code> foi removido</h3> - -<p>No Gecko 1.8, o método <code>preventBubble</code> existia em eventos para previnir eventos de "borbulhar para cima". No Gecko 1.9 este método foi removido. Dessa forma, você deve usar o padrão <a href="pt/DOM/event.stopPropagation">stopPropagation()</a>, o qual também trabalha bem no Gecko 1.8. O<em>patch</em> em {{ Bug(330494) }} fez isto acontecer. Veja também {{ Bug(105280) }}.</p> - -<h3 id="Algumas_outras_APIs_de_evento_antigas_n.C3.A3o_s.C3.A3o_mais_suportadas" name="Algumas_outras_APIs_de_evento_antigas_n.C3.A3o_s.C3.A3o_mais_suportadas">Algumas outras APIs de evento antigas não são mais suportadas</h3> - -<p><a href="pt/DOM/window.captureEvents">window.captureEvents</a>, <a href="pt/DOM/window.releaseEvents">window.releaseEvents</a>, e <code>window.routeEvent</code> são são mais suportadas ({{ Obsolete_inline() }}) no Gecko 1.9.</p> - -<h2 id="DOM" name="DOM">DOM</h2> - -<h3 id="WRONG_DOCUMENT_ERR" name="WRONG_DOCUMENT_ERR"><code>WRONG_DOCUMENT_ERR</code></h3> - -<p></p><p>Nodes from external documents should be cloned using <a class="new" href="/pt-PT/docs/Web/API/Document/importNode" rel="nofollow" title="The documentation about this has not yet been written; please consider contributing!"><code>document.importNode()</code></a> (or adopted using <a class="new" href="/pt-PT/docs/Web/API/Document/adoptNode" rel="nofollow" title="The documentation about this has not yet been written; please consider contributing!"><code>document.adoptNode()</code></a>) before they - can be inserted into the current document. For more on the <a class="new" href="/pt-PT/docs/Web/API/Node/ownerDocument" rel="nofollow" title="The documentation about this has not yet been written; please consider contributing!"><code>Node.ownerDocument</code></a> issues, see the - <a class="external" href="http://www.w3.org/DOM/faq.html#ownerdoc" rel="noopener">W3C DOM FAQ</a>.</p> - - <p>Firefox doesn't currently enforce this rule (it did for a while during the development of Firefox 3, but too many - sites break when this rule is enforced). We encourage Web developers to fix their code to follow this rule for - improved future compatibility.</p><p></p> - -<h2 id="Alcances" name="Alcances">Alcances</h2> - -<h3 id="intersectsNode_foi_removido" name="intersectsNode_foi_removido"><code>intersectsNode</code> foi removido</h3> - -<p>No Gecko 1.8 a função do código <code>intersectsNode</code> é usada para testar se um nó intercepta um alcance. Entretanto os valores de retorno desta função estavam confusos e raramente eram úteis, conseqüentemente foram removidos no Gecko 1.9. Dessa forma use a função mais precisa e padrão <a href="pt/DOM/range.compareBoundaryPoints">compareBoundaryPoints</a>. O<em>patch</em> em {{ Bug(358073) }} removeu esta função.</p> - -<p>Veja a documentação para <a href="pt/DOM/range.intersectsNode">intersectsNode</a> para como usar <code>compareBoundaryPoints</code> em vez disso.</p> - -<h3 id="compareNode_foi_removido" name="compareNode_foi_removido"><code>compareNode</code> foi removido</h3> - -<p>No Gecko 1.8 a função do código <code>compareNode</code> é usada para testar como um nó intercepta um alcante. Entretanto os valores de retorno desta função estavam confusos e raramente eram úteis, conseqüentemente foram removidos no Gecko 1.9. Em vez disso use a função mais precisa e padrão <a href="pt/DOM/range.compareBoundaryPoints">compareBoundaryPoints</a>. O<em>patch</em> em {{ Bug(358073) }} removeu esta função.</p> - -<p>Veja a documentação para <a href="pt/DOM/range.compareNode">compareNode</a> para como usar <code>compareBoundaryPoints</code> em vez disso.</p> - -<h2 id="HTML" name="HTML">HTML</h2> - -<h3 id="Muitos_bugs_em_.3Cobject.3E_foram_corrigidos" name="Muitos_bugs_em_.3Cobject.3E_foram_corrigidos">Muitos<em>bugs</em> em <code><object></code> foram corrigidos</h3> - -<p>Os elementos <code>object</code> e <code>embed</code> não precisam mais do atributo <code>type</code> para interpretar. Mudando o atributo <code>src</code> (de <code><embed></code>) ou o atributo <code>data</code> (de <code><object></code>) via JavaScript agora trabalha corretamente. O cabeçalho Conteúdo-Tipo enviado pelo servidor (se algum) agora toma procedências sobre o atributo <code>type</code> de um elemento <code><object></code> de acordo com a especificação HTML. (este não é o caso de <code>embed</code>).</p> - -<p><br> - <span class="comment">Categorias</span></p> - -<p><span class="comment">Interwiki Language Links</span></p> - -<p>{{ languages( { "en": "en/Gecko_1.9_Changes_affecting_websites", "fr": "fr/Changements_dans_Gecko_1.9_affectant_les_sites_Web", "ja": "ja/Gecko_1.9_Changes_affecting_websites", "ko": "ko/Gecko_1.9_Changes_affecting_websites", "pl": "pl/Zmiany_w_Gecko_1.9_wp\u0142ywaj\u0105ce_na_wy\u015bwietlanie_stron" } ) }}</p> diff --git a/files/pt-pt/mozilla/firefox/releases/3/updating_extensions/index.html b/files/pt-pt/mozilla/firefox/releases/3/updating_extensions/index.html deleted file mode 100644 index d213047978..0000000000 --- a/files/pt-pt/mozilla/firefox/releases/3/updating_extensions/index.html +++ /dev/null @@ -1,210 +0,0 @@ ---- -title: Atualização das extensões para o Firefox 3 -slug: Mozilla/Firefox/Releases/3/Updating_extensions -tags: - - Firefox 3 -translation_of: Mozilla/Firefox/Releases/3/Updating_extensions -original_slug: Atualizando_extensões_para_o_Firefox_3 ---- -<div><section class="Quick_links" id="Quick_Links"> - <ol> - <li class="toggle"> - <details> - <summary>Firefox developer release notes</summary> - <ol> - <li><a href="/pt-PT/docs/Mozilla/Firefox/Releases">Firefox developer release notes</a></li> - </ol> - </details> - </li> - <li class="toggle"> - <details> - <summary>Add-ons</summary> - <ol> - <li><a href="/pt-PT/Add-ons/WebExtensions">Browser extensions</a></li> - <li><a href="/pt-PT/Add-ons/Themes">Themes</a></li> - </ol> - </details> - </li> - <li class="toggle"> - <details> - <summary>Firefox internals</summary> - <ol> - <li><a href="/pt-PT/docs/Mozilla/">Mozilla project</a></li> - <li><a href="/pt-PT/docs/Mozilla/Gecko">Gecko</a></li> - <li><a href="/pt-PT/docs/Mozilla/Firefox/Headless_mode">Headless mode</a></li> - <li><a href="/pt-PT/docs/Mozilla/JavaScript_code_modules">JavaScript code modules</a></li> - <li><a href="/pt-PT/docs/Mozilla/js-ctypes">JS-ctypes</a></li> - <li><a href="/pt-PT/docs/Mozilla/MathML_Project">MathML project</a></li> - <li><a href="/pt-PT/docs/Mozilla/MFBT">MFBT</a></li> - <li><a href="/pt-PT/docs/Mozilla/Projects">Mozilla projects</a></li> - <li><a href="/pt-PT/docs/Mozilla/Preferences">Preference system</a></li> - <li><a href="/pt-PT/docs/Mozilla/WebIDL_bindings">WebIDL bindings</a></li> - <li><a href="/pt-PT/docs/Mozilla/Tech/XPCOM">XPCOM</a></li> - <li><a href="/pt-PT/docs/Mozilla/Tech/XUL">XUL</a></li> - </ol> - </details> - </li> - <li class="toggle"> - <details> - <summary>Building and contributing</summary> - <ol> - <li><a href="/pt-PT/docs/Mozilla/Developer_guide/Build_Instructions">Build instructions</a></li> - <li><a href="/pt-PT/docs/Mozilla/Developer_guide/Build_Instructions/Configuring_Build_Options">Configuring build options</a></li> - <li><a href="/pt-PT/docs/Mozilla/Developer_guide/Build_Instructions/How_Mozilla_s_build_system_works">How the build system works</a></li> - <li><a href="/pt-PT/docs/Mozilla/Developer_guide/Source_Code/Mercurial">Mozilla source code</a></li> - <li><a href="/pt-PT/docs/Mozilla/Localization">Localization</a></li> - <li><a href="/pt-PT/docs/Mozilla/Mercurial">Mercurial</a></li> - <li><a href="/pt-PT/docs/Mozilla/QA">Quality assurance</a></li> - <li><a href="/pt-PT/docs/Mozilla/Using_Mozilla_code_in_other_projects">Using Mozilla code in other projects</a></li> - </ol> - </details> - </li> - </ol> -</section></div> - -<p> Este artigo proporciona informações úteis para desenvolvedores que desejam atualizar suas extensões para que funcionem corretamente no Firefox 3.</p> - -<p>Antes de continuar, há uma sugestão útil que podemos oferecer: se a única mudança que sua extensão requere é uma atualização no campo <code>maxVersion</code> no seu manifesto de instalação, e você hospedou sua extensão em <a class="link-https" href="https://addons.mozilla.org">addons.mozilla.org</a>, você atualmente não precisa disponibilizar uma nova versão da sua extensão! Simplesmente use o Painel de Controle de Desenvolvedores em AMO para ajustar o <code>maxVersion</code>. Você pode evitar de ter sua extensão re-revisada por este caminho.</p> - -<h3 id="1.C2.B0_Passo_Atualize_o_manifesto_de_instala.C3.A7.C3.A3o" name="1.C2.B0_Passo:_Atualize_o_manifesto_de_instala.C3.A7.C3.A3o">Passo 1: Atualizar o manifesto de instalação</h3> - -<p>O primeiro passo -- e, para muitas das extensões, o único que será necessário -- é atualizar o arquivo <a href="/pt/install.rdf" title="pt/install.rdf">manifesto de instalação</a>, <code>install.rdf</code>, para indicar compatibilidade com o Firefox 3.</p> - -<p>Simplesmente ache a linha que indica a máxima versão compatível do Firefox (que, para o Firefox 2, pode indicar como aqui):</p> - -<pre class="eval"> <span class="nowiki"><em:maxVersion>2.0.0.*</em:maxVersion></span> -</pre> - -<p>Mude isto para indicar compatibilidade com o Firefox 3:</p> - -<pre class="eval"> <span class="nowiki"><em:maxVersion>3.0.*</em:maxVersion></span> -</pre> - -<p>Então reinstale sua extensão.</p> - -<p>Note que o Firefox 3 acaba com o ".0" extra no número da versão, então, ao invés de usar "3.0.0.*", você precisa usar somente "3.0.*".</p> - -<div class="note"><strong>Nota:</strong> Note que neste ponto mais mudanças no Firefox 3 são esperadas. Estas mudanças podem quebrar algumas extensões, então você não precisa lançar sua extensão com <code>3.0.*</code> <code>maxVersion</code> para os usuários antes que o Firefox 3 candidato a liberação seja lançado. Durante o período do Firefox 3 Beta, você pode usar <code>3.0b5</code> como sua <code>maxVersion</code>.</div> - -<p>Tem havido (e continuará a haver) um número de mudanças na API que poderão quebrar algumas extensões. Nós estamos trabalhando na compilação de uma lista completa destas mudanças.</p> - -<div class="note"><strong>Nota:</strong> Se a sua extensão ainda usa um script <code><a href="/en/Install.js">Install.js</a></code> ao invés de um <a href="/pt/install.rdf" title="pt/install.rdf">manifesto de instalação</a>, você precisa fazer a transição para um manifesto de instalação agora. O Firefox 3 não mais suporta os scripts <code>install.js</code> em arquivos XPI.</div> - -<h4 id="Adicionando_localiza.C3.A7.C3.B5es_para_o_manifesto_de_instala.C3.A7.C3.A3o" name="Adicionando_localiza.C3.A7.C3.B5es_para_o_manifesto_de_instala.C3.A7.C3.A3o">Adicionando localizações para o manifesto de instalação</h4> - -<p>O Firefox 3 suporta novas propriedades no manifesto de instalação para especificar descrições localizadas. Os antigos métodos ainda funcionam, entretanto o novo Firefox permite pegar as localizações sempre que os complementos estiverem desabilitados e com instalação pendente. Veja <a href="/pt/Localizar_descrições_de_extensões" title="pt/Localizar_descrições_de_extensões">Localizar descrições de extensões</a> para mais detalhes.</p> - -<h3 id="2.C2.B0_Passo_Assegure-se_de_estar_oferecendo_atualiza.C3.A7.C3.B5es_seguras" name="2.C2.B0_Passo:_Assegure-se_de_estar_oferecendo_atualiza.C3.A7.C3.B5es_seguras">Passo 2: Certificar-se de que está a proporcionar atualizações seguras</h3> - -<p>Se você está hospedando complementos por si mesmo e não em um provedor de hospedagem de complementos seguro como <a class="link-https" href="https://addons.mozilla.org">addons.mozilla.org</a> então você precisa oferecer um método seguro de atualizar seu complemento. Isto poderá envolver a hospedagem das suas atualizações em um website SSL, ou usando chaves criptográficas para assinar a informação da atualização. Leia <a href="/en/Extension_Versioning,_Update_and_Compatibility#Securing Updates">Securing Updates</a> para mais informações.</p> - -<h3 id="3.C2.B0_Passo_Lidar_com_APIs_mudadas" name="3.C2.B0_Passo:_Lidar_com_APIs_mudadas">Passo 3: Lidar com APIs alteradas</h3> - -<p>Várias APIs foram alterados de maneira significativa. O mais significativo destes, que provavelmente afetará um grande número de extensões, são:</p> - -<h4 id="DOM" name="DOM">DOM</h4> - -<p>Nodes from external documents should be cloned using <a class="new" href="/pt-PT/docs/Web/API/Document/importNode" rel="nofollow" title="The documentation about this has not yet been written; please consider contributing!"><code>document.importNode()</code></a> (or adopted using <a class="new" href="/pt-PT/docs/Web/API/Document/adoptNode" rel="nofollow" title="The documentation about this has not yet been written; please consider contributing!"><code>document.adoptNode()</code></a>) before they - can be inserted into the current document. For more on the <a class="new" href="/pt-PT/docs/Web/API/Node/ownerDocument" rel="nofollow" title="The documentation about this has not yet been written; please consider contributing!"><code>Node.ownerDocument</code></a> issues, see the - <a class="external" href="http://www.w3.org/DOM/faq.html#ownerdoc" rel="noopener">W3C DOM FAQ</a>.</p> - - <p>Firefox doesn't currently enforce this rule (it did for a while during the development of Firefox 3, but too many - sites break when this rule is enforced). We encourage Web developers to fix their code to follow this rule for - improved future compatibility.</p> - -<h4 id="Favoritos__Hist.C3.B3rico" name="Favoritos_&_Hist.C3.B3rico">Marcadores & Histórico</h4> - -<p>Se sua extensão acessa dados dos favoritos ou do histórico de alguma maneira, ela precisará de um trabalho substancial para tornar-se compatível com o Firefox 3. As antigas APIs de acesso a estas informações foram substituidas pela nova arquitetura <a href="/en/Places">en:Places</a>. Veja <a href="/en/Places/Migration_Guide">Migration Guide for Places</a> para detalhes na atualização da sua extensão existente para usar a API Places.</p> - -<h4 id="Gerenciador_de_Downloads" name="Gerenciador_de_Downloads">Gestor de Descargas</h4> - -<p>A API do Gestor de Descargas foi alterado ligeiramente devido à transição de um RDF para armazenar dados usando a API <a href="/en/Storage">en:Storage</a>. Esta pode ser uma transição muito fácil de fazer. Além disso, a API de monitoramento do progesso de downloads mudou para suportar múltiplos <em>receptores</em> no gestor de descargas. Consulte <a href="/en/nsIDownloadManager">en:nsIDownloadManager</a>, <a href="/en/nsIDownloadProgressListener">en:nsIDownloadProgressListener</a>, e <a href="/en/Monitoring_downloads">en:Monitoring downloads</a> para mais informação.</p> - -<h4 id="Gerenciador_de_Senhas" name="Gerenciador_de_Senhas">Gestor de Palavras-passe</h4> - -<p>Se sua extensão acessa informações do login de usuário usando o Gerenciador de Senhas, será necessário atualizá-la para usar a nova API de Gerenciamento de Login.</p> - -<ul> - <li>O artigo <a href="/en/Using_nsILoginManager">en:Using nsILoginManager</a> inclui exemplos, incluindo uma demonstração de como escrever sua extensão para que trabalhe tanto com o Gerenciador de Senhas quanto com o Gerenciador de Login, então ela irá funcionar tanto no Firefox quanto em versões anteriores.</li> - <li><code><a href="/en/nsILoginInfo">en:nsILoginInfo</a></code></li> - <li><code><a href="/en/nsILoginManager">en:nsILoginManager</a></code></li> -</ul> - -<p>Você pode também sobrepor o armazenamento do gerenciador de senhas construído se você desejar fornecer a implementação de seu próprio armazenamento de senhas nas suas extensões. Veja Criando um módulo de armazenamento de Gerenciador de Login para mais detalhes.</p> - -<h4 id="Popups_.28Menus.2C_Menus_de_Contexto.2C_Dicas_e_Pain.C3.A9is.29" name="Popups_.28Menus.2C_Menus_de_Contexto.2C_Dicas_e_Pain.C3.A9is.29">janelas (Menus, Menus de Contexto, Dicas de Ferramenta e Painéis)</h4> - -<p>O sistema de Popup XUL foi bastante modificado no Firefox 3. O sistema de Popup inclui menus principais, menus de contexto e painéis popup. Um guia sobre como <a href="/en/XUL/PopupGuide">usar Popups</a> foi criado, detalhando como o sistema trabalha. Uma coisa a se notar é que <code>popup.<span id="m-showPopup"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/showPopup">showPopup</a></code></span></code> foi depreciado em favor do novo <code>popup.<span id="m-openPopup"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/openPopup">openPopup</a></code></span></code> e <code>popup.<span id="m-openPopupAtScreen"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/openPopupAtScreen">openPopupAtScreen</a></code></span></code>.</p> - -<h4 id="Autocompletar" name="Autocompletar">Auto Completar</h4> - -<p>O método <code><a href="/en/nsIAutoCompleteController#handleEnter()">handleEnter()</a></code> da interface <a href="/en/nsIAutoCompleteController">en:nsIAutoCompleteController</a> foi alterado para aceitar um argumento que indica quando o texto foi selecionado do popup autocompletar ou pelo usuário pressionando enter depois de digitar o texto.</p> - -<h4 id="DOMParser" name="DOMParser">DOMParser</h4> - -<ul> - <li>Quando um <code>DOMParser</code> é instanciado, este herda o código principal dito e os <code>documentURI</code> e <code>baseURI</code> da janela de onde o construtor vier.</li> - <li>Se o chamador tiver privilégios UniversalXPConnect, ele pode passar parâmetros para <code> new DOMParser()</code>. Se menos de três parâmetros forem passados, os parâmetros restantes serão padronizados para <code>null</code>. - <ul> - <li>O primeiro parâmetro é o principal para uso; ele sobrepõe o padrão principal normalmente herdado.</li> - <li>O segundo parâmetro é o <code>documentURI</code> para uso.</li> - <li>O terceiro parâmetro é o <code>baseURI</code> para uso.</li> - </ul> - </li> - <li>Se inicializa um <code>DOMParser</code> usando um contrato, somente através de uma chamada <code>createInstance()</code>, e não fizer a chamada do método <code>init()</code> do <code>DOMParser</code>, tentando iniciar a operação de análise será criada automaticamente a inicialização de <code>DOMParser</code> com um nulo principal e apontadores <code>null</code> para <code>DocumentURI</code> e <code>baseURI</code>.</li> -</ul> - -<h4 id="Interfaces_removidas" name="Interfaces_removidas">Interfaces removidas</h4> - -<p>As seguintes interfaces foram removidas do Gecko 1.9, que direcionam o Firefox 3. Se sua extensão faz uso de alguma destas, você precisará atualizar seu código:</p> - -<ul> - <li><code>nsIDOMPaintListener</code></li> - <li><code>nsIDOMScrollListener</code></li> - <li><code>nsIDOMMutationListener</code></li> - <li><code>nsIDOMPageTransitionListener</code></li> - <li><code>nsICloseAllWindows</code> (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=386200" title='FIXED: SeaMonkey only: no "view cert button" in untrusted cert error dialog'>bug 386200</a>)</li> -</ul> - -<h3 id="4.C2.B0_Passo_Cheque_por_mudan.C3.A7as_relevantes_no_chrome" name="4.C2.B0_Passo:_Cheque_por_mudan.C3.A7as_relevantes_no_chrome">Passo 4: Procurar por alterações relevantes no chrome</h3> - -<p>Houveram menores mudanças no chrome que podem requisitar mudanças no seu código. Uma nova <code>vbox</code> foi adicionada, chamada "browser-bottombox", que inclui a barra de procura e a barra de estado à janela do navegador. Embora ela não afete a aparência da exibição, ela pode afetar sua extensão se ela sobrepuser o chrome em relação a estes elementos.</p> - -<p>Por exemplo, se você anteriormente sobrepôs algum chrome antes da barra de estado, como isto:</p> - -<pre><window id="main-window"> - <something insertbefore="status-bar" /> -</window> -</pre> - -<p>Você deve agora sobrepor desta maneira:</p> - -<pre><vbox id="browser-bottombox"> - <something insertbefore="status-bar" /> -</vbox> -</pre> - -<h3 id="Outras_mudan.C3.A7as" name="Outras_mudan.C3.A7as">Outras alterações</h3> - -<p><em>Mudanças simples adicionais que tiver de fazer enquanto atualiza sua extensão para trabalhar com o Firefox 3, aqui.</em></p> - -<ul> - <li><code><a class="external" rel="freelink">chrome://browser/base/utilityOverlay.js</a></code> não é mais suportada por razões de segurança. Se você previamente utilizava-a, você pode mudar para <code><a class="external" rel="freelink">chrome://browser/content/utilityOverlay.js</a></code>.</li> - <li><a href="/en/nsIAboutModule">en:nsIAboutModule</a> implementações são agora requeridas para suportar o método <code>getURIFlags</code>. Veja <a href="https://dxr.mozilla.org/mozilla-central/source/netwerk/protocol/about/public/nsIAboutModule.idl" rel="custom">nsIAboutModule.idl</a> para documentação. Isto afeta extensões que provém novas URIs <code>about:</code>. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=337746" title='FIXED: [FIX]Move "safe about" hardcoding out of security manager'>bug 337746</a>)</li> - <li>O elemento <code><tabbrowser></code> não é mais parte do "kit de ferramentas" (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=339964" title="FIXED: move tabbrowser.xml out of mozilla/toolkit and into mozilla/browser">bug 339964</a>). Isto significa que este elemento não está mais disponível para aplicações XUL e extensões. Ele continua a ser usado na janela principal do Firefox (browser.xul).</li> - <li>Mudanças em <a href="/en/nsISupports_proxies">en:nsISupports proxies</a> e possivelmente relacionado ao encadeamento de interfaces que precisam ser documentadas.</li> - <li>Se você usa instruções de processamento XML, como <code><?xml-stylesheet ?></code> em seus arquivos XUL, fique atento às mudanças feitas em <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=319654" title="FIXED: Processing instructions in XUL are not added to the content model">bug 319654</a>: - <ol> - <li>XML PIs foram agora adicionadas a um documento XML DOM. Isto significa que <a href="/pt-PT/docs/Web/API/Document/firstChild" title="The documentation about this has not yet been written; please consider contributing!"><code>Document.firstChild</code></a> não é mais garantida como o elemento raiz. Se você precisa pegar o documento raiz no seu script, use <a href="/pt-PT/docs/Web/API/Document/documentElement" title="The documentation about this has not yet been written; please consider contributing!"><code>Document.documentElement</code></a> ao invés.</li> - <li>as instruções de processamento <code><?xml-stylesheet ?></code> e <code><?xul-overlay ?></code> agora não tem efeito fora do documento prolog.</li> - </ol> - </li> - <li><code>window.addEventListener("load", myFunc, true)</code> não é mais ativado no carregamento de conteúdo web (carregamento de páginas no navegador). Isto foi devido ao <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=296639" title="FIXED: Split windows into an inner and outer object">bug 296639</a> que altera a maneira como as janelas internas e externas se comunicam. O simples conserto é para o uso de <code>gBrowser.addEventListener("load", myFunc, true)</code> como descrito <a href="/en/Code_snippets:Tabbed_browser#Detecting page load">aqui</a> e trabalha no Firefox 2 muito bem.</li> - <li><code>content.window.getSelection()</code> dá um objeto (que pode ser convertido para uma string por <code>toString()</code>) diferentemente do agora depreciado <code>content.document.getSelection()</code> que retorna uma string</li> - <li><code>event.preventBubble()</code> foi depreciado no Firefox 2 e foi removido no Firefox 3. Use <a href="/en/DOM/event.stopPropagation">event.stopPropagation()</a>, que funciona bem no Firefox 2.</li> - <li>Contadores que são inciados usando <code>setTimeout()</code> estão agora bloquados por janelas modais devido à correção para <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=52209" title="FIXED: JS timers can fire while a modal dialog is open">bug 52209</a>. Você pode usar <code>nsITimer</code> no lugar.</li> -</ul> - -<p><span class="comment">Categorias</span></p> - -<p><span class="comment">Interwiki Language Links</span></p> diff --git a/files/pt-pt/mozilla/firefox/releases/4/index.html b/files/pt-pt/mozilla/firefox/releases/4/index.html deleted file mode 100644 index a79356442c..0000000000 --- a/files/pt-pt/mozilla/firefox/releases/4/index.html +++ /dev/null @@ -1,657 +0,0 @@ ---- -title: Firefox 4 para desenvolvedores -slug: Mozilla/Firefox/Releases/4 -tags: - - CSS - - Firefox - - Firefox 4 - - Gecko - - Gecko 2.0 - - HTML - - JavaScript - - XPCOM - - XUL -translation_of: Mozilla/Firefox/Releases/4 -original_slug: Firefox_4_para_desenvolvedores ---- -<div><section class="Quick_links" id="Quick_Links"> - <ol> - <li class="toggle"> - <details> - <summary>Firefox developer release notes</summary> - <ol> - <li><a href="/pt-PT/docs/Mozilla/Firefox/Releases">Firefox developer release notes</a></li> - </ol> - </details> - </li> - <li class="toggle"> - <details> - <summary>Add-ons</summary> - <ol> - <li><a href="/pt-PT/Add-ons/WebExtensions">Browser extensions</a></li> - <li><a href="/pt-PT/Add-ons/Themes">Themes</a></li> - </ol> - </details> - </li> - <li class="toggle"> - <details> - <summary>Firefox internals</summary> - <ol> - <li><a href="/pt-PT/docs/Mozilla/">Mozilla project</a></li> - <li><a href="/pt-PT/docs/Mozilla/Gecko">Gecko</a></li> - <li><a href="/pt-PT/docs/Mozilla/Firefox/Headless_mode">Headless mode</a></li> - <li><a href="/pt-PT/docs/Mozilla/JavaScript_code_modules">JavaScript code modules</a></li> - <li><a href="/pt-PT/docs/Mozilla/js-ctypes">JS-ctypes</a></li> - <li><a href="/pt-PT/docs/Mozilla/MathML_Project">MathML project</a></li> - <li><a href="/pt-PT/docs/Mozilla/MFBT">MFBT</a></li> - <li><a href="/pt-PT/docs/Mozilla/Projects">Mozilla projects</a></li> - <li><a href="/pt-PT/docs/Mozilla/Preferences">Preference system</a></li> - <li><a href="/pt-PT/docs/Mozilla/WebIDL_bindings">WebIDL bindings</a></li> - <li><a href="/pt-PT/docs/Mozilla/Tech/XPCOM">XPCOM</a></li> - <li><a href="/pt-PT/docs/Mozilla/Tech/XUL">XUL</a></li> - </ol> - </details> - </li> - <li class="toggle"> - <details> - <summary>Building and contributing</summary> - <ol> - <li><a href="/pt-PT/docs/Mozilla/Developer_guide/Build_Instructions">Build instructions</a></li> - <li><a href="/pt-PT/docs/Mozilla/Developer_guide/Build_Instructions/Configuring_Build_Options">Configuring build options</a></li> - <li><a href="/pt-PT/docs/Mozilla/Developer_guide/Build_Instructions/How_Mozilla_s_build_system_works">How the build system works</a></li> - <li><a href="/pt-PT/docs/Mozilla/Developer_guide/Source_Code/Mercurial">Mozilla source code</a></li> - <li><a href="/pt-PT/docs/Mozilla/Localization">Localization</a></li> - <li><a href="/pt-PT/docs/Mozilla/Mercurial">Mercurial</a></li> - <li><a href="/pt-PT/docs/Mozilla/QA">Quality assurance</a></li> - <li><a href="/pt-PT/docs/Mozilla/Using_Mozilla_code_in_other_projects">Using Mozilla code in other projects</a></li> - </ol> - </details> - </li> - </ol> -</section></div> - -<div class="blockIndicator draft"> - <p><strong>Esboço</strong><br> - Esta página está incompleta.</p> - -</div> - -<p>O Firefox 4, o qual entrou em beta no mês de junho de 2010, melhora a performance, adiciona maior suporte ao HTML5 e outras tecnologias web envolvidas e, além disso, melhora a segurança. Este artigo proporciona informações iniciais sobre o lançamento que virá e quais funcionalidades estão disponíveis, tanto para desenvolvedores web, quanto para desenvolvedores de complementos e desenvolvedores da plataforma Gecko.</p> - -<p>Muitas destas funcionalidades já podem ser testadas na versão <a class="external" href="http://www.mozilla.com/en-US/firefox/beta/" title="http://www.mozilla.com/en-US/firefox/beta/">Firefox 4 beta</a>, ou, se estiver se sentindo aventureiro, em <a class="external" href="http://nightly.mozilla.org/" title="http://nightly.mozilla.org/">nightly trunk builds</a>.</p> - -<div class="note"><strong>Observação:</strong> Este artigo é um trabalho em progresso, assim como todos os artigos linkados nesta página. Muitos nomes de artigos são espaços reservadis e alguns tópicos provavelmente serão quebrados em múltiplos artigos. Em geral, seja cuidadoso ao vincular páginas a estes artigos, por enquantoIn general, be cautious about linking to these articles for the time beingJavas.</div> - -<h2 id="Funcionalidades_para_desenvolvedores_web">Funcionalidades para desenvolvedores web</h2> - -<p>O Gecko agora usa o analisador <a href="/pt/HTML/HTML5" title="pt/HTML/HTML5">HTML5</a> (parser HTML5), que corrige bugs, melhora a interoperabilidade e melhora a performance. Ele também permite conteúdos de <a href="/en/SVG" title="en/SVG">SVG</a> e <a href="/en/MathML" title="en/MathML">MathML</a> embutidos diretamente na marcação HTML.</p> - -<h3 id="HTML">HTML</h3> - -<dl> - <dt><a href="/pt/HTML/HTML5/Parser_HTML5" title="pt/HTML/HTML5/Parser HTML5">Conheça o parser HTML5</a></dt> - <dd>Uma olhada no que o analisador HTML5 (parser HTML5) significa para você e como incorporar SVG e MathML ao seu conteúdo.</dd> - <dt><a href="/pt/HTML/HTML5/Forms_no_HTML5" title="pt/HTML/HTML5/Forms no HTML5">Forms no HTML5</a></dt> - <dd>Uma olhada às melhorias aos web forms no HTML5. Entre estas mudanças foram adicionados tipos de entrada no elemento <a href="/pt-PT/docs/Web/HTML/Element/input" title="The documentation about this has not yet been written; please consider contributing!"><code><input></code></a> e validação de dados, dentre outros.</dd> - <dt><a href="/pt/Seções_e_perfil_de_um_documento_HTML5" title="pt/Seções e perfil de um documento HTML5">Seções HTML5</a></dt> - <dd>O Gecko agora suporta os novos elementos HTML5 relacionados a seções em um um documento: <a href="/pt-PT/docs/Web/HTML/Element/article" title="The documentation about this has not yet been written; please consider contributing!"><code><article></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/section" title="The documentation about this has not yet been written; please consider contributing!"><code><section></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/nav" title="The documentation about this has not yet been written; please consider contributing!"><code><nav></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/aside" title="The documentation about this has not yet been written; please consider contributing!"><code><aside></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/hgroup" title="The documentation about this has not yet been written; please consider contributing!"><code><hgroup></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/header" title="The documentation about this has not yet been written; please consider contributing!"><code><header></code></a> e <a href="/pt-PT/docs/Web/HTML/Element/footer" title="The documentation about this has not yet been written; please consider contributing!"><code><footer></code></a>.</dd> - <dt>Outros elementos HTML5</dt> - <dd>O Gecko agora suporta os seguintes elementos do HTML5: <a href="/pt-PT/docs/Web/HTML/Element/mark" title="The documentation about this has not yet been written; please consider contributing!"><code><mark></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/figure" title="The documentation about this has not yet been written; please consider contributing!"><code><figure></code></a> e <a href="/pt-PT/docs/Web/HTML/Element/figcaption" title="The documentation about this has not yet been written; please consider contributing!"><code><figcaption></code></a>.</dd> - <dt>WebSockets</dt> - <dd>Um guia para usar a nova API de WebSockets para comunicação em tempo real entre uma aplicação web e um servidor.</dd> -</dl> - -<h4 id="Modificações_HTML_diversas">Modificações HTML diversas</h4> - -<ul> - <li>Os elementos <a href="/pt-PT/docs/Web/HTML/Element/textarea" title="The documentation about this has not yet been written; please consider contributing!"><code><textarea></code></a> são agora redimensionáveis por padrão; você pode usar a propriedade <a href="/pt-PT/docs/Web/CSS/resize" title="The documentation about this has not yet been written; please consider contributing!"><code>resize</code></a> do CSS para desabilitar isto.</li> - <li><code>canvas.getContext</code> e <code>canvas.toDataURL</code> não adicionam mais exceções quando chamados com argumentos não reconhecidos.</li> - <li>O elemento <code><a href="../../../../en/HTML/Element/canvas" rel="custom nofollow"><canvas></a></code> agora suporta o método específico da Mozilla <code>mozGetAsFile()</code>, o qual permite a obtenção de um arquivo baseado na memória contendo uma imagem dos conteúdos do canvas. Veja <code><a href="../../../../en/DOM/HTMLCanvasElement" rel="custom nofollow">HTMLCanvasElement</a></code> para detalhes.</li> - <li><code>canvas2dcontext.globalCompositeOperation</code>, <code>canvas2dcontext.lineCap</code> e <code>canvas2dcontext.lineJoin</code> não adicionam mais exceções quando configurados para valores desconhecidos.</li> - <li><code>canvas2dcontext.globalCompositeOperation</code> não adiciona mais exceções quando configurado para um valor desconhecido e não suporta mais o valor não padrão <code>darker</code>.</li> - <li>Foi removido o suporte para o elemento obsoleto <a href="/pt-PT/docs/Web/HTML/Element/spacer" title="The documentation about this has not yet been written; please consider contributing!"><code><spacer></code></a>, o qual não existe em nenhum outro navegador.</li> - <li>O elemento <a href="/pt-PT/docs/Web/HTML/Element/isindex" title="The documentation about this has not yet been written; please consider contributing!"><code><isindex></code></a>, quandro criado pela chamada de <a href="/pt-PT/docs/Web/API/Document/createElement" title="The documentation about this has not yet been written; please consider contributing!"><code>document.createElement()</code></a>, é agora criado como um elemento simples sem propriedades ou métodos.</li> - <li>O Gecko agora suporte a chamada <code>click()</code> em elementos <code><a href="../../../../en/HTML/Element/input" rel="custom nofollow"><input></a></code> para abrir o seletor de arquivos. Veja o <a href="/en/Using_files_from_web_applications#Hiding_the_file_input_element" title="en/Using files from web applications#Hiding the file input element"><ins>exemplo</ins></a> no artigo <a href="/en/Using_files_from_web_applications" title="en/Using files from web applications"><ins>Using files from web applications</ins></a>.</li> - <li>Os elementos <a href="/pt-PT/docs/Web/HTML/Element/script" title="The documentation about this has not yet been written; please consider contributing!"><code><script></code></a> internos aos elementos <a href="/pt-PT/docs/Web/HTML/Element/iframe" title="The documentation about this has not yet been written; please consider contributing!"><code><iframe></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/noembed" title="The documentation about this has not yet been written; please consider contributing!"><code><noembed></code></a> e <a href="/pt-PT/docs/Web/HTML/Element/noframes" title="The documentation about this has not yet been written; please consider contributing!"><code><noframes></code></a> agora são executados, ao contrário de versões anteriores do Firefox. Isto está de acordo com a especificação e corresponde com o comportamento de outros navegadores.</li> -</ul> - -<h3 id="CSS">CSS</h3> - -<dl> - <dt><a href="/pt/CSS/Transições_CSS" title="pt/CSS/Transições CSS">Transições CSS</a> (CSS transitions)</dt> - <dd>O suporte à novas transições CSS está disponível no Firefox 4.</dd> - <dt>Valores calculados em CSS</dt> - <dd>Foi adicionado o suporte para <code><span style="font-family: verdana,tahoma,sans-serif;"><a href="/pt-PT/docs/Web/CSS/-moz-calc" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-calc</code></a>. Isto permite especificar valores <a href="/pt-PT/docs/Web/CSS/length" title="The documentation about this has not yet been written; please consider contributing!"><code><length></code></a> como expressões matemáticas.</span></code></dd> - <dt>Seletor de agrupamento</dt> - <dd>Suporte a <a href="/pt-PT/docs/Web/CSS/:-moz-any" title="The documentation about this has not yet been written; please consider contributing!"><code>:-moz-any</code></a> para agrupar seletores e fatorizar combinadores.</dd> - <dt>Suporte a sub-retângulo em imagens de fundo</dt> - <dd>A função <a href="/pt-PT/docs/Web/CSS/-moz-image-rect" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-image-rect</code></a> torna possível o uso de subretângulos de imagens como uma <a href="/pt-PT/docs/Web/CSS/background-image" title="A propriedade background-image configura a imagem de fundo para um elemento."><code>background-image</code></a> (imagem de plano de fundo).</dd> - <dt>Propriedades de toque CSS</dt> - <dd>O suporte para propriedades de toque foi adicionado. Detalhes e nomes de artigos reais, virão depois.</dd> - <dt><a href="/en/CSS/-moz-element" title="en/CSS/-moz-element">Using arbitrary elements as CSS backgrounds</a></dt> - <dd>Você pode usar a função <a href="/pt-PT/docs/Web/CSS/-moz-element" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-element</code></a> do CSS e a função <a href="/pt-PT/docs/Web/API/Document/mozSetImageElement" title="The documentation about this has not yet been written; please consider contributing!"><code>document.mozSetImageElement()</code></a> do DOM para usar elementos HTML arbitrários como planos de fundos.</dd> - <dt><a href="/pt/CSSPrivacidade_e_o_seletor_:visited" title="pt/CSSPrivacidade e o seletor :visited">Privacidade e o seletor :visited</a></dt> - <dd>Mudanças foram feitas ao tipo de informação que pode ser obtida sobre o estilo dos links visitados usando seletores CSS. Isto pode afetas algumas aplicações web.</dd> -</dl> - -<h4 id="Novas_propriedades_do_CSS">Novas propriedades do CSS</h4> - -<table class="standard-table"> - <tbody> - <tr> - <td class="header">Propriedade</td> - <td class="header">Descrição</td> - </tr> - <tr> - <td><a href="/pt-PT/docs/Web/CSS/-moz-font-feature-settings" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-font-feature-settings</code></a></td> - <td>Permite características avançadas de customização em fontes OpenType.</td> - </tr> - <tr> - <td><a href="/pt-PT/docs/Web/CSS/-moz-tab-size" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-tab-size</code></a></td> - <td>Especifica a largura em caracteres de espaço, de um caracter tab (U+0009) na renderização de texto.</td> - </tr> - <tr> - <td><a href="/pt-PT/docs/Web/CSS/resize" title="The documentation about this has not yet been written; please consider contributing!"><code>resize</code></a></td> - <td>Permite o controle das dimensões nas quais um elemento pode ser redimensionado.</td> - </tr> - </tbody> -</table> - -<h4 id="Novas_pseudo-classes_do_CSS">Novas pseudo-classes do CSS</h4> - -<table class="standard-table"> - <tbody> - <tr> - <td class="header">Pseudo-classe</td> - <td class="header">Descrição</td> - </tr> - <tr> - <td><a href="/pt-PT/docs/Web/CSS/:-moz-handler-crashed" title="The documentation about this has not yet been written; please consider contributing!"><code>:-moz-handler-crashed</code></a></td> - <td>Usado para estilizar elementos cujos plugins tenham quebrado.</td> - </tr> - <tr> - <td><a href="/pt-PT/docs/Web/CSS/:-moz-placeholder" title="The documentation about this has not yet been written; please consider contributing!"><code>:-moz-placeholder</code></a></td> - <td>Aplicado ao espaço reservado de texto nos campos de formulário.</td> - </tr> - <tr> - <td><a href="/pt-PT/docs/Web/CSS/:-moz-submit-invalid" title="The documentation about this has not yet been written; please consider contributing!"><code>:-moz-submit-invalid</code></a></td> - <td>Aplicado ao botão de submeter em formulários quando um ou mais dos campos do formulário não é validado.</td> - </tr> - <tr> - <td><a href="/pt-PT/docs/Web/CSS/:-moz-window-inactive" title="The documentation about this has not yet been written; please consider contributing!"><code>:-moz-window-inactive</code></a></td> - <td>Aplicado a elementos em janelas inativas.</td> - </tr> - <tr> - <td><a href="/pt-PT/docs/Web/CSS/:invalid" title="The documentation about this has not yet been written; please consider contributing!"><code>:invalid</code></a></td> - <td>Aplicado automaticamente para os campos <a href="/pt-PT/docs/Web/HTML/Element/input" title="The documentation about this has not yet been written; please consider contributing!"><code><input></code></a> quando suas constantes são inválidas.</td> - </tr> - <tr> - <td><a href="/pt-PT/docs/Web/CSS/:optional" title="The documentation about this has not yet been written; please consider contributing!"><code>:optional</code></a></td> - <td>Aplicado automaticamente para os campos <a href="/pt-PT/docs/Web/HTML/Element/input" title="The documentation about this has not yet been written; please consider contributing!"><code><input></code></a> que não especifiquem o atributo <code>required</code>.</td> - </tr> - <tr> - <td><a href="/pt-PT/docs/Web/CSS/:required" title="The documentation about this has not yet been written; please consider contributing!"><code>:required</code></a></td> - <td>Aplicado automaticamente para os campos <a href="/pt-PT/docs/Web/HTML/Element/input" title="The documentation about this has not yet been written; please consider contributing!"><code><input></code></a> que especifiquem o atributo <code>required</code>.</td> - </tr> - <tr> - <td><a href="/pt-PT/docs/Web/CSS/:valid" title="The documentation about this has not yet been written; please consider contributing!"><code>:valid</code></a></td> - <td>Aplicado automaticamente para os campos <a href="/pt-PT/docs/Web/HTML/Element/input" title="The documentation about this has not yet been written; please consider contributing!"><code><input></code></a> quando suas constantes são validadas com sucesso.</td> - </tr> - </tbody> -</table> - -<h4 id="Novos_pseudo-seletores_do_CSS">Novos pseudo-seletores do CSS</h4> - -<table class="standard-table"> - <tbody> - <tr> - <td class="header">Pseudo-seletor</td> - <td class="header">Descrição</td> - </tr> - <tr> - <td><a href="/pt-PT/docs/Web/CSS/:-moz-focusring" title="The documentation about this has not yet been written; please consider contributing!"><code>:-moz-focusring</code></a></td> - <td>Permite especificar a aparência de um elemento quando o Gecko acredita que ele deve ter uma indicação de foco renderizada.</td> - </tr> - </tbody> -</table> - -<h4 id="Novas_funções_do_CSS">Novas funções do CSS</h4> - -<table class="standard-table"> - <tbody> - <tr> - <td class="header">Função</td> - <td class="header">Descrição</td> - </tr> - <tr> - <td><a href="/pt-PT/docs/Web/CSS/:-moz-any" title="The documentation about this has not yet been written; please consider contributing!"><code>:-moz-any</code></a></td> - <td>Permite agrupar seletores e fatorizar combinações.</td> - </tr> - <tr> - <td><a href="/pt-PT/docs/Web/CSS/-moz-calc" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-calc</code></a></td> - <td>Permite a especificação de valores<code><span style="font-family: verdana,tahoma,sans-serif;"> </span></code><a href="/pt-PT/docs/Web/CSS/length" title="The documentation about this has not yet been written; please consider contributing!"><code><length></code></a><code><span style="font-family: verdana,tahoma,sans-serif;"> como expressões matemáticas.</span></code></td> - </tr> - <tr> - <td><a href="/pt-PT/docs/Web/CSS/-moz-element" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-element</code></a></td> - <td>Permite o uso de um elemento arbitrário como imagem de fundo para <a href="/pt-PT/docs/Web/CSS/background-image" title="A propriedade background-image configura a imagem de fundo para um elemento."><code>background-image</code></a> e <a href="/pt-PT/docs/Web/CSS/background" title="A propriedade background é usada para ajustar os valores do fundo em um único lugar na folha de estilos. background pode ser usada com os seguintes valores adicionais: background-attachment, background-color, background-image, background-position, background-repeat."><code>background</code></a>.</td> - </tr> - <tr> - <td><a href="/pt-PT/docs/Web/CSS/-moz-image-rect" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-image-rect</code></a></td> - <td>Permite o uso de um sub-retângulo de uma imagem como um <a href="/pt-PT/docs/Web/CSS/background-image" title="A propriedade background-image configura a imagem de fundo para um elemento."><code>background-image</code></a> ou <a href="/pt-PT/docs/Web/CSS/background" title="A propriedade background é usada para ajustar os valores do fundo em um único lugar na folha de estilos. background pode ser usada com os seguintes valores adicionais: background-attachment, background-color, background-image, background-position, background-repeat."><code>background</code></a>.</td> - </tr> - </tbody> -</table> - -<h4 id="Propriedades_do_CSS_renomeadas">Propriedades do CSS renomeadas</h4> - -<table class="standard-table"> - <thead> - <tr> - <td class="header">Old Name</td> - <td class="header">New Name</td> - <td class="header">Notes</td> - </tr> - </thead> - <tbody> - <tr> - <td><code>-moz-background-size</code></td> - <td><a href="/pt-PT/docs/Web/CSS/background-size" title="The documentation about this has not yet been written; please consider contributing!"><code>background-size</code></a></td> - <td>O nome <code>-moz-background-size</code> não é mais suportado.</td> - </tr> - <tr> - <td><code>-moz-border-radius</code></td> - <td><a href="/pt-PT/docs/Web/CSS/border-radius" title="The documentation about this has not yet been written; please consider contributing!"><code>border-radius</code></a></td> - <td>O antigo nome é suportado por tempo limitado para permitir a atualização de seus sites. Mudanças de renderização também foram feitas para conseguir a compatibilidade com a última versão.</td> - </tr> - <tr> - <td><code>-moz-box-shadow</code></td> - <td><a href="/pt-PT/docs/Web/CSS/box-shadow" title="The documentation about this has not yet been written; please consider contributing!"><code>box-shadow</code></a></td> - <td></td> - </tr> - </tbody> -</table> - -<h4 id="Modificações_CSS_diversas">Modificações CSS diversas</h4> - -<ul> - <li>A propriedade <a href="/pt-PT/docs/Web/CSS/text-shadow" title="The documentation about this has not yet been written; please consider contributing!"><code>text-shadow</code></a> agora permite raio de desfoque de até 300px, por razões de sanidade e performance.</li> - <li>A propriedade <a href="/pt-PT/docs/Web/CSS/overflow" title="The documentation about this has not yet been written; please consider contributing!"><code>overflow</code></a> não se aplica mais para elementos do grupo "table" (<code><thead></code>, <code><tbody></code> e <code><tfoot></code>).</li> - <li>A propriedade <a href="/pt-PT/docs/Web/CSS/-moz-appearance" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-appearance</code></a> agora suporta o valor<code> -moz-win-borderless-glass<span style="font-family: verdana,tahoma,sans-serif;">, que aplica uma aparência Aero Glass a um elemento.</span></code></li> - <li>A funcionalidade de mídia <code><a href="/En/CSS/Media_queries#-moz-device-pixel-ratio" title="En/CSS/Media queries#-moz-device-pixel-ratio">-moz-device-pixel-ratio</a></code> foi adicionada, permitindo o uso de pixels do dispositivo pela taxa de pixels CSS a ser usada em <a href="/Pt/CSS/Consulta_de_mídia" title="Pt/CSS/Consulta de mídia">Consultas de Mídia</a>.</li> - <li>A maneira com que o Gecko lida com o <a href="../../../../en/CSS-2_Quick_Reference/Units" rel="internal">CSS units</a> foi revisada para melhorar a compatibilidade com outros navegadores e para traduzir comprimentos absolutos mais acuradamente na contagem de pixels da tela baseado na DPI do dispositivo.</li> -</ul> - -<h4 id="Modificações_CSS_diversas_2">Modificações CSS diversas</h4> - -<ul> - <li><code>-moz-border-radius </code>foi renomeado para <a href="/pt-PT/docs/Web/CSS/border-radius" title="The documentation about this has not yet been written; please consider contributing!"><code>border-radius</code></a>. - - <ul> - <li><code>-moz-border-radius </code>é suportado como um apelido para um período de transição</li> - <li>A manipulação de valores percentuais foi alterada para ficar compatível com a última especificação</li> - <li>Cantos arredondados agora arredondam também conteúdo e imagens (a menos que seja especificado <a href="/pt-PT/docs/Web/CSS/overflow" title="The documentation about this has not yet been written; please consider contributing!"><code>overflow</code></a><code>:visible</code>)</li> - </ul> - </li> - <li>A propriedade <code>-moz-box-shadow</code> foi renomeada para <a href="/pt-PT/docs/Web/CSS/box-shadow" title="The documentation about this has not yet been written; please consider contributing!"><code>box-shadow</code></a>.</li> - <li>A propriedade <a href="/pt-PT/docs/Web/CSS/text-shadow" title="The documentation about this has not yet been written; please consider contributing!"><code>text-shadow</code></a> agora permite raio de desfoque de até 300px, por razões de sanidade e performance.</li> - <li>A pseudoclasse <a href="/pt-PT/docs/Web/CSS/:-moz-window-inactive" title="The documentation about this has not yet been written; please consider contributing!"><code>:-moz-window-inactive</code></a> foi implementada.</li> - <li>A propriedade <a href="/pt-PT/docs/Web/CSS/-moz-tab-size" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-tab-size</code></a> permite a especificação da largura de um caracter de tab (U+0009) em caracteres de espaço, quando na renderização de texto.</li> - <li>A propriedade <a href="/pt-PT/docs/Web/CSS/resize" title="The documentation about this has not yet been written; please consider contributing!"><code>resize</code></a> do CSS3 foi implementada.</li> - <li>A propriedade <code>-moz-background-size </code>foi renomeada para seu nome final <a href="/pt-PT/docs/Web/CSS/background-size" title="The documentation about this has not yet been written; please consider contributing!"><code>background-size</code></a>; <code>-moz-background-size</code> não é mais suportada.</li> - <li>A propriedade <a href="/pt-PT/docs/Web/CSS/overflow" title="The documentation about this has not yet been written; please consider contributing!"><code>overflow</code></a> não se aplica mais para elementos do grupo "table" (<code><thead></code>, <code><tbody></code> e <code><tfoot></code>).</li> - <li>O pseudoseletor <a href="/pt-PT/docs/Web/CSS/:-moz-focusring" title="The documentation about this has not yet been written; please consider contributing!"><code>:-moz-focusring</code></a> permite a especificação da aparência de um elemento quando o Gecko acredita que o elemento deve ter uma indicação de foco renderizada.</li> - <li>A função <a href="/pt-PT/docs/Web/CSS/-moz-element" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-element</code></a> do CSS permite o uso de um elemento arbitrário como imagem de fundo para <a href="/pt-PT/docs/Web/CSS/background-image" title="A propriedade background-image configura a imagem de fundo para um elemento."><code>background-image</code></a> e <a href="/pt-PT/docs/Web/CSS/background" title="A propriedade background é usada para ajustar os valores do fundo em um único lugar na folha de estilos. background pode ser usada com os seguintes valores adicionais: background-attachment, background-color, background-image, background-position, background-repeat."><code>background</code></a>.</li> - <li>A propriedade <a href="/pt-PT/docs/Web/CSS/-moz-appearance" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-appearance</code></a> agora suporta o valor<code> -moz-win-borderless-glass<span style="font-family: verdana,tahoma,sans-serif;">, que aplica uma aparência Aero Glass a um elemento.</span></code></li> - <li>As pseudoclasses <a href="/pt-PT/docs/Web/CSS/:valid" title="The documentation about this has not yet been written; please consider contributing!"><code>:valid</code></a> e <a href="/pt-PT/docs/Web/CSS/:invalid" title="The documentation about this has not yet been written; please consider contributing!"><code>:invalid</code></a> são agora automaticamente aplicadas para campos de validação <a href="/pt-PT/docs/Web/HTML/Element/input" title="The documentation about this has not yet been written; please consider contributing!"><code><input></code></a>.</li> - <li>A pseudoclasse <a href="/pt-PT/docs/Web/CSS/:-moz-submit-invalid" title="The documentation about this has not yet been written; please consider contributing!"><code>:-moz-submit-invalid</code></a> é aplicada ao botão de submeter em campos de formulários quando um ou mais campos não são validados.</li> - <li>A pseudoclasse <a href="/pt-PT/docs/Web/CSS/:required" title="The documentation about this has not yet been written; please consider contributing!"><code>:required</code></a> é agora automaticamente aplicada aos campos <a href="/pt-PT/docs/Web/HTML/Element/input" title="The documentation about this has not yet been written; please consider contributing!"><code><input></code></a> que especificam o atributo requerido; a pseudoclasse <a href="/pt-PT/docs/Web/CSS/:optional" title="The documentation about this has not yet been written; please consider contributing!"><code>:optional</code></a> é aplicada a todos os outros campos.</li> - <li>A pseudoclasse <a href="/pt-PT/docs/Web/CSS/:-moz-placeholder" title="The documentation about this has not yet been written; please consider contributing!"><code>:-moz-placeholder</code></a> foi adicionada para permitir a estilização de campos de texto em formulários.</li> - <li>A pseudoclasse <a href="/pt-PT/docs/Web/CSS/:-moz-handler-crashed" title="The documentation about this has not yet been written; please consider contributing!"><code>:-moz-handler-crashed</code></a> foi adicionada; ela estiliza elementos cujos plugins tenham quebrado.</li> - <li>A funcionalidade de mídia <code><a href="/En/CSS/Media_queries#-moz-device-pixel-ratio" title="En/CSS/Media queries#-moz-device-pixel-ratio">-moz-device-pixel-ratio</a></code> foi adicionada, permitindo o uso de pixels do dispositivo pela taxa de pixels CSS a ser usada em <a href="/Pt/CSS/Consulta_de_mídia" title="Pt/CSS/Consulta de mídia">Consultas de Mídia</a>.</li> - <li>A nova propriedade <code><a href="../../../../en/CSS/-moz-font-feature-settings" rel="custom nofollow">-moz-font-feature-settings</a></code> permite que você customize características avançadas das fontes, de fontes OpenType.</li> - <li>A maneira com que o Gecko lida com o <a href="../../../../en/CSS-2_Quick_Reference/Units" rel="internal">CSS units</a> foi revisada para melhorar a compatibilidade com outros navegadores e para traduzir comprimentos absolutos mais acuradamente na contagem de pixels da tela baseado na DPI do dispositivo.</li> -</ul> - -<h3 id="Gráficos_e_vídeo">Gráficos e vídeo</h3> - -<dl> - <dt></dt> - <dt><a href="/en/WebGL" title="en/WebGL">WebGL</a></dt> - <dd>O padrão de desenvolvimento WebGL é agora suportado pelo Firefox.</dd> - <dt>Otimização da performance gráfica</dt> - <dd>Dicas e truques para conseguir a melhor performance gráfica e de vídeo no Firefox 4.</dd> - <dt><a href="/pt/Suporte_a_videos_WebM" title="pt/Suporte a videos WebM">Suporte a vídeos WebM</a></dt> - <dd>O novo formato aberto de vídeo <a class="external" href="http://www.webmproject.org/" title="http://www.webmproject.org/">WebM</a> é suportado pelo Gecko 2.0; o suporte está incluído em nightlies desde 9 de junho.</dd> - <dt>Animação SVG com SMIL</dt> - <dd>O suporte a animações SMIL do SVG está agora disponível.</dd> - <dt>Usando SVG como imagens e como fundos de tela CSS</dt> - <dd>Você pode agora usar o SVG com o elemento <a href="/pt-PT/docs/Web/HTML/Element/img" title="The documentation about this has not yet been written; please consider contributing!"><code><img></code></a>, assim como com a propriedade <code><a href="../../../../en/CSS/background-image" rel="custom nofollow">background-image</a></code> do CSS.</dd> - <dt>Suporte ao atributo de mídia <code>buffered</code></dt> - <dd>O atributo <code>buffered</code> nos elementos <a href="/pt-PT/docs/Web/HTML/Element/video" title="The documentation about this has not yet been written; please consider contributing!"><code><video></code></a> e <a href="/pt-PT/docs/Web/HTML/Element/audio" title="The documentation about this has not yet been written; please consider contributing!"><code><audio></code></a> é agora suportado, permitindo a determinação de quais faixas de um arquivo de mídia foram carregadas. A interface <a href="/pt-PT/docs/Web/API/TimeRanges" title="The documentation about this has not yet been written; please consider contributing!"><code>TimeRanges</code></a> do DOM foi implementada para suportar isto.</dd> - <dt>Atributo de mídia <code>preload</code></dt> - <dd>O atributo <code>preload</code> da especificação do HTML5 foi implementado, substituindo o atributo anteriormente implementado (e não mais suportado) <code>autobuffer</code>. Isto afeta os elementos <a href="/pt-PT/docs/Web/HTML/Element/video" title="The documentation about this has not yet been written; please consider contributing!"><code><video></code></a> e <a href="/pt-PT/docs/Web/HTML/Element/audio" title="The documentation about this has not yet been written; please consider contributing!"><code><audio></code></a>, assim como a interface <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMHTMLMediaElement" title="">nsIDOMHTMLMediaElement</a></code>.</dd> - <dt>Melhoramentos no posicionamento de texto SVG</dt> - <dd>Agora é possível especificar listas para os valores das propriedades <code>x</code>, <code>y</code>, <code>dx</code> e <code>dy</code> nos elementos <a href="/pt-PT/docs/Web/SVG/Element/text" title="The documentation about this has not yet been written; please consider contributing!"><code><text></code></a> e <a href="/pt-PT/docs/Web/SVG/Element/tspan" title="The documentation about this has not yet been written; please consider contributing!"><code><tspan></code></a> do SVG. Isto permite controlar o posicionamento de cada caractere individualmente em uma <em>string</em>.</dd> -</dl> - -<h3 id="DOM">DOM</h3> - -<dl> - <dt><a href="/en/JavaScript_typed_arrays" title="en/JavaScript typed arrays">Arrays com tipos JavaScript</a></dt> - <dd>Foi adicionado suporte para os arrays com tipos JavaScript; eles permitem a manipulação de buffers contendo dados em raw usando tipos de dados nativos. Muitas API fazem uso disto, incluindo <a href="/en/DOM/File" title="en/DOM/File">File API</a>, <a href="/en/WebGL" title="en/WebGL">WebGL</a>, e <a href="/en/WebSockets" title="en/WebSockets">WebSockets</a>.</dd> - <dt>Obtenção de limites de retângulos para <em>ranges</em></dt> - <dd>O objeto <a href="/pt-PT/docs/Web/API/Range" title="The documentation about this has not yet been written; please consider contributing!"><code>Range</code></a> agora possui os métodos <a href="/pt-PT/docs/Web/API/Range/getClientRects" title="The documentation about this has not yet been written; please consider contributing!"><code>range.getClientRects()</code></a> e <a href="/pt-PT/docs/Web/API/Range/getBoundingClientRect" title="The documentation about this has not yet been written; please consider contributing!"><code>range.getBoundingClientRect()</code></a>.</dd> - <dt>Captura de eventos de mouse em elementos arbitrários</dt> - <dd>O suporte para as APIs <code>setCapture()</code> e <code>releaseCapture()</code> originadas do Internet Explorer foram adicionadas. Veja <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=503943" title="FIXED: Need a way to grab mouse events on arbitrary elements (implement setCapture/releaseCapture)">bug 503943</a>.</dd> - <dt><a href="/pt/DOM/Manipulação_do_histórico_do_navegador" title="pt/DOM/Manipulação do histórico do navegador">Manipulação do histórico do navegador</a></dt> - <dd>O objeto de histórico de documento existente, disponível através do objeto <a href="/pt-PT/docs/Web/API/Window/history" title="The documentation about this has not yet been written; please consider contributing!"><code>window.history</code></a> agora suporta os novos métodos <code>pushState()</code> e <code>replaceState()</code> do HTML5.</dd> - <dt><a href="/pt/DOM/Animações_usando_o_MozBeforePaint" title="pt/DOM/Animações usando o MozBeforePaint">Animações usando o MozBeforePaint</a></dt> - <dd>Um novo evento foi adicionado, o qual combinado com o método <a href="/pt-PT/docs/Web/API/Window/mozRequestAnimationFrame" title="The documentation about this has not yet been written; please consider contributing!"><code>window.mozRequestAnimationFrame()</code></a> e a propriedade <a href="/pt-PT/docs/Web/API/Window/mozAnimationStartTime" title="The documentation about this has not yet been written; please consider contributing!"><code>window.mozAnimationStartTime</code></a>, proporciona uma maneira de criar animações sincronizadas uma com a outra.</dd> - <dt>Eventos de toque e multi-toque</dt> - <dd>Foi adicionado suporte ao evetos de toque e multi-toque.</dd> - <dt></dt> -</dl> - -<h4 id="A_interface_DOM_dos_elementos_HTML_mudou">A interface DOM dos elementos HTML mudou</h4> - -<p>Muitos elementos do HTML tiveram suas interfaces DOM mudadas para aquelas requisitadas pela especificação do HTML5, como mostrado abaixo.</p> - -<table class="standard-table"> - <thead> - <tr> - <td class="header">Interface no Firefox 3.6</td> - <td class="header">Interface no Firefox 4</td> - <td class="header">Elemento HTML</td> - </tr> - </thead> - <tbody> - <tr> - <td><code><a href="/en/DOM/HTMLSpanElement" title="en/DOM/HTMLSpanElement">HTMLSpanElement</a></code></td> - <td><code><a href="/en/DOM/HTMLElement" title="en/DOM/HTMLElement">HTMLElement</a></code></td> - <td><a href="/pt-PT/docs/Web/HTML/Element/abbr" title="The documentation about this has not yet been written; please consider contributing!"><code><abbr></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/acronym" title="The documentation about this has not yet been written; please consider contributing!"><code><acronym></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/address" title="The documentation about this has not yet been written; please consider contributing!"><code><address></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/b" title="The documentation about this has not yet been written; please consider contributing!"><code><b></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/bdo" title="The documentation about this has not yet been written; please consider contributing!"><code><bdo></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/big" title="The documentation about this has not yet been written; please consider contributing!"><code><big></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/blink" title="The documentation about this has not yet been written; please consider contributing!"><code><blink></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/center" title="The documentation about this has not yet been written; please consider contributing!"><code><center></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/cite" title="The documentation about this has not yet been written; please consider contributing!"><code><cite></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/code" title="The documentation about this has not yet been written; please consider contributing!"><code><code></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/dd" title="The documentation about this has not yet been written; please consider contributing!"><code><dd></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/dfn" title="The documentation about this has not yet been written; please consider contributing!"><code><dfn></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/dt" title="The documentation about this has not yet been written; please consider contributing!"><code><dt></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/em" title="The documentation about this has not yet been written; please consider contributing!"><code><em></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/i" title="The documentation about this has not yet been written; please consider contributing!"><code><i></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/kbd" title="The documentation about this has not yet been written; please consider contributing!"><code><kbd></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/listing" title="The documentation about this has not yet been written; please consider contributing!"><code><listing></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/nobr" title="The documentation about this has not yet been written; please consider contributing!"><code><nobr></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/plaintext" title="The documentation about this has not yet been written; please consider contributing!"><code><plaintext></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/s" title="The documentation about this has not yet been written; please consider contributing!"><code><s></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/samp" title="The documentation about this has not yet been written; please consider contributing!"><code><samp></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/small" title="The documentation about this has not yet been written; please consider contributing!"><code><small></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/strike" title="The documentation about this has not yet been written; please consider contributing!"><code><strike></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/strong" title="The documentation about this has not yet been written; please consider contributing!"><code><strong></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/sub" title="The documentation about this has not yet been written; please consider contributing!"><code><sub></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/sup" title="The documentation about this has not yet been written; please consider contributing!"><code><sup></code></a>, , <a href="/pt-PT/docs/Web/HTML/Element/tt" title="The documentation about this has not yet been written; please consider contributing!"><code><tt></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/u" title="The documentation about this has not yet been written; please consider contributing!"><code><u></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/var" title="The documentation about this has not yet been written; please consider contributing!"><code><var></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/xmp" title="The documentation about this has not yet been written; please consider contributing!"><code><xmp></code></a></td> - </tr> - <tr> - <td><code><a href="/en/DOM/HTMLDivElement" title="en/DOM/HTMLDivElement">HTMLDivElement</a></code></td> - <td><code><a href="/en/DOM/HTMLElement" title="en/DOM/HTMLElement">HTMLElement</a></code></td> - <td><a href="/pt-PT/docs/Web/HTML/Element/noembed" title="The documentation about this has not yet been written; please consider contributing!"><code><noembed></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/noframes" title="The documentation about this has not yet been written; please consider contributing!"><code><noframes></code></a>, <a href="/pt-PT/docs/Web/HTML/Element/noscript" title="The documentation about this has not yet been written; please consider contributing!"><code><noscript></code></a></td> - </tr> - <tr> - <td><code><a href="/en/DOM/HTMLWBRElement" title="en/DOM/HTMLWBRElement">HTMLWBRElement</a></code></td> - <td><code><a href="/en/DOM/HTMLElement" title="en/DOM/HTMLElement">HTMLElement</a></code></td> - <td><a href="/pt-PT/docs/Web/HTML/Element/wbr" title="The documentation about this has not yet been written; please consider contributing!"><code><wbr></code></a></td> - </tr> - </tbody> -</table> - -<h4 id="Modificações_DOM_diversas">Modificações DOM diversas</h4> - -<ul> - <li>O "envoltório" de um elemento <a href="/pt-PT/docs/Web/HTML/Element/textarea" title="The documentation about this has not yet been written; please consider contributing!"><code><textarea></code></a> agora pode ser controlado a partir do DOM, através do atributo <code>wrap</code> do DOM. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=41464" title="FIXED: textarea.wrap not exposed through DOM (IE compatability)">bug 41464</a></li> - <li>Elementos <a href="/pt-PT/docs/Web/HTML/Element/script" title="The documentation about this has not yet been written; please consider contributing!"><code><script></code></a> criados usando <a href="/pt-PT/docs/Web/API/Document/createElement" title="The documentation about this has not yet been written; please consider contributing!"><code>document.createElement</code></a> e inseridos em um documento agora comportam-se de acordo com a especificação do HTML5 por padrão. <em>Scripts</em> com o atributo <code>src</code> são executados assim que possível (sem manter o ordenamento) enquanto <em>scripts</em> sem o atributo <code>src </code>são executados sincronamente. Para fazer com que <em>scripts</em> inseridos com o atributo <code>src</code> sejam executados na ordem de inserção, configure-os com <code>.async=false</code>.</li> - <li>Os objetos <a href="/pt-PT/docs/Web/API/File" title="The documentation about this has not yet been written; please consider contributing!"><code>file</code></a> do DOM agora oferecem a propriedade <code>url</code>.</li> - <li>Suporte para <a href="/En/XMLHttpRequest/Using_XMLHttpRequest#Using_FormData_objects" title="en/XMLHttpRequest/Using XMLHttpRequest#Using FormData objects">FormData</a> para XMLHttpRequest.</li> - <li>A propriedade <a href="/pt-PT/docs/Web/API/Element/isContentEditable" title="The documentation about this has not yet been written; please consider contributing!"><code>element.isContentEditable</code></a> foi implementada.</li> - <li>A propriedade <a href="/pt-PT/docs/Web/API/Document/currentScript" title="The documentation about this has not yet been written; please consider contributing!"><code>document.currentScript</code></a> permite determinar qual elemento <a href="/pt-PT/docs/Web/HTML/Element/script" title="The documentation about this has not yet been written; please consider contributing!"><code><script></code></a> do <em>script</em> está sendo executado no momento. O novos eventos <a href="/pt-PT/docs/Web/API/Document/onbeforescriptexecute" title="The documentation about this has not yet been written; please consider contributing!"><code>document.onbeforescriptexecute</code></a> e <a href="/pt-PT/docs/Web/API/Document/onafterscriptexecute" title="The documentation about this has not yet been written; please consider contributing!"><code>document.onafterscriptexecute</code></a> são lançados antes e depois de um elemento <em>script</em> ser executado.</li> - <li>Adicionada a propriedade <a href="/En/DragDrop/DataTransfer#mozSourceNode" title="En/DragDrop/DataTransfer#mozSourceNode"><code>mozSourceNode</code></a> ao objeto <a href="/En/DragDrop/DataTransfer" title="En/DragDrop/DataTransfer"><code>DragTransfer</code></a>.</li> - <li>Adicionado o método <a href="/en/DOM/Selection/modify" title="en/DOM/selection/modify"><code>selection.modify()</code></a> ao objeto <a href="/pt-PT/docs/Web/API/Selection" title="The documentation about this has not yet been written; please consider contributing!"><code>Selection</code></a>; ele permite a fácil alteração da seleção de texto atual ou da posição do cursor em uma janela do navegador.</li> - <li>O suporte para o objeto <code>window.directories</code> e para a característica <code>directories</code> de <a href="/pt-PT/docs/Web/API/Window/open" title="The Window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name. If the name doesn't exist, then a new window is opened and the specified resource is loaded into its browsing context."><code>window.open</code></a>, qua não são suportadas em nenhum outro navegador, foi removido. Ao invés dela, use <code>personalbar</code>. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=474058" title="FIXED: Drop support for window.directories">bug 474058</a></li> - <li>A propriedade <a href="/pt-PT/docs/Web/API/Event/mozInputSource" title="The documentation about this has not yet been written; please consider contributing!"><code>event.mozInputSource</code></a> foi adicionada aos eventos de interface de usuário do DOM; esta propriedade não-padrão permite a determinação do tipo de dispositivo que gerou um evento.</li> - <li>O evento <a href="/pt-PT/docs/Web/API/Document/onreadystatechange" title="The documentation about this has not yet been written; please consider contributing!"><code>document.onreadystatechange</code></a> foi implementado.</li> - <li>O método <a href="/pt-PT/docs/Web/API/Document/createElement" title="The documentation about this has not yet been written; please consider contributing!"><code>document.createElement</code></a> não aceita mais a tag nome entre <code><</code> e <code>></code> no modo <em>quirk</em>.</li> - <li>Os métodos <a href="/pt-PT/docs/Web/API/Element/setCapture" title="The documentation about this has not yet been written; please consider contributing!"><code>element.setCapture()</code></a> e <a href="/pt-PT/docs/Web/API/Document/releaseCapture" title="The documentation about this has not yet been written; please consider contributing!"><code>document.releaseCapture()</code></a> foram adicionados, permitindo aos elementos continuar a monitorar os eventos do mouse, mesmo quando o mouse está fora da área normal de monitoramento após a ocorrência de um evento <code>mousedown</code>.</li> - <li>A propriedade <a href="/pt-PT/docs/Web/API/Window/mozPaintCount" title="The documentation about this has not yet been written; please consider contributing!"><code>window.mozPaintCount</code></a> foi adicionada; ela permite a determinação de quantas vezes um documento foi pintado. Isto pode ser útil no teste de performance de suas aplicações web.</li> - <li>O <em>token</em> de língua foi removido de <a href="/pt-PT/docs/Web/API/Window/navigator/appVersion" title="The documentation about this has not yet been written; please consider contributing!"><code>window.navigator.appVersion</code></a> e <a href="/pt-PT/docs/Web/API/Window/navigator/userAgent" title="The documentation about this has not yet been written; please consider contributing!"><code>window.navigator.userAgent</code></a>. Ao invés deles, use o <a href="/pt-PT/docs/Web/API/Window/navigator/language" title="The documentation about this has not yet been written; please consider contributing!"><code>window.navigator.language</code></a> ou o <a href="/en/Content_negotiation" title="en/Content negotiation">Accept-Language header</a>. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=572656" title="FIXED: Remove the UI language from the UA string and navigator.appVersion">bug 572656</a></li> - <li>O objeto <a href="/en/XMLHttpRequest" title="en/XMLHttpRequest">XMLHttpRequest</a> agora expõe a resposta como um <em>array</em> digitado em JavaScript, assim como uma <em>string</em>, usando a propriedade <code>mozResponseArrayBuffer</code> específica do Gecko.</li> - <li><a href="/en/DOM/Event/UIEvent/MouseEvent" title="en/DOM/Event/UIEvent/MouseEvent">Eventos de mouse</a> agora incluem uma propriedade <code>mozPressure</code> indicando a quantidade de pressão em dispositivos de entrada sensíveis a pressão, suportados.</li> - <li>Os métodos <a href="/pt-PT/docs/Web/API/Window/URL/createObjectURL" title="The documentation about this has not yet been written; please consider contributing!"><code>window.URL.createObjectURL()</code></a> e <a href="/pt-PT/docs/Web/API/Window/URL/revokeObjectURL" title="The documentation about this has not yet been written; please consider contributing!"><code>window.URL.revokeObjectURL()</code></a> permitem a criação de objetos URL que referenciem arquivos locais.</li> - <li>O método <code><a href="../../../../en/DOM/DOMImplementation.createHTMLDocument" rel="custom nofollow">DOMImplementation.createHTMLDocument()</a></code> permite a criação de novos documentos HTML.</li> - <li><a href="/pt-PT/docs/Web/API/Node/mozMatchesSelector" title="The documentation about this has not yet been written; please consider contributing!"><code>Node.mozMatchesSelector()</code></a> agora lança uma exceção <code>SYNTAX_ERR</code> se o seletor de <em>string</em> selecionado for inválido, ao invés de, incorretamente, retornar <code>false</code>.</li> - <li>Agora é possível selecionar valores de propriedades em um elemento SVG usando a mesma sintaxe econômica do CSS. Por exemplo: <code>element.style.fill = 'lime'</code>. Veja <a href="/pt-PT/docs/Web/API/Element/style" title="The documentation about this has not yet been written; please consider contributing!"><code>element.style</code></a> para detalhes.</li> - <li>A raiz do documento agora possui <a href="/En/Supporting_private_browsing_mode#Detecting_whether_private_browsing_mode_is_permanent" title="En/Supporting private browsing mode#Detecting whether private browsing mode is permanent">um atributo <code>privatebrowsingmode</code></a> que descreve o estado do modo de navegação privada, incluindo uma indicação se a navegação privada é temporária ou permanente para a sessão.</li> - <li>Agora o segundo parâmetro do método <a href="/pt-PT/docs/Web/API/Window/getComputedStyle" title="The documentation about this has not yet been written; please consider contributing!"><code>window.getComputedStyle()</code></a> é opcional, assim como em qualquer outro navegador grande.</li> - <li>Agora o objeto <a href="/en/DOM/event/StorageEvent" title="en/DOM/event/StorageEvent"><code>StorageEvent</code></a> do DOM está de acordo com a última versão da especificação.</li> - <li>O atraso mínimo permitido para o método <a href="/pt-PT/docs/Web/API/Window/setTimeout" title="The documentation about this has not yet been written; please consider contributing!"><code>window.setTimeout()</code></a> é agora uma preferência, <code>dom.min_timeout_value</code>.</li> - <li>O evento <a href="/en/Gecko-Specific_DOM_Events#MozAfterPaint" title="en/Gecko-Specific DOM Events#MozAfterPaint"><code>MozAfterPaint</code></a> não é mais enviado por padrão, devido uma potencial questão de segurança. Ele pode ser reabilitado configurando a preferência.</li> -</ul> - -<h3 id="Segurança">Segurança</h3> - -<dl> -</dl> - -<dl> - <dt><a href="/en/Security/PSC" title="en/Security/PSC">Política de Segurança de Conteúdo (CSP)</a></dt> - <dd>A Política de Segurança de Conteúdo (Content Security Policy - CSP) é uma proposta da Mozilla desenvolvida para ajudar web designers e administradores de servidores a especificar como o conteúdo em seus sites interage. A meta é ajudar a detectar e abrandar ataques, incluindo <em>cross-site scripting</em> e ataques de injeção de dados.</dd> - <dt><a href="/en/Security/HTTP_Strict_Transport_Security" title="en/Security/HTTP Strict Transport Security">Segurança de Transporte do HTTP Estrito (HTTP Strict Transport Security)</a></dt> - <dd>A Segurança de Transporte de HTTP Estrito é uma característica que permite a um website dizer ao navegador que ele deve ser comunicado somente usando HTTPS, ao invés de HTTP.</dd> - <dt><a href="/en/The_X-FRAME-OPTIONS_response_header" title="en/The X-FRAME-OPTIONS response header">O cabeçalho de resposta (The X-FRAME-OPTIONS response header)</a></dt> - <dd>O cabeçalho de resposta HTTP, X-FRAME-OPTIONS, introduzido no Internet Explorer 8 é agora suportado pelo Firefox. Isto permite a sites indicar quando suas páginas devem ou não ser usadas em quadros (frames), e, em caso afirmativo, se deve ou não restringir isto à mesma origem.</dd> - <dt>Mudanças na <a href="/En/User_Agent_Strings_Reference" title="En/User_Agent_Strings_Reference">string de Agente de Usuário (User Agent string)</a> changes</dt> - <dd>Como um meio para reduzir a quantidade de dados e entropia descartada em requisições HTTP (veja <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=572650" title="[meta] Reduce the amount of data and entropy sent out in HTTP requests">bug 572650</a>) a força da criptografia e tokens de linguagem foram removidos pela string do agente de usuário.</dd> -</dl> - -<h3 id="JavaScript">JavaScript</h3> - -<p>Para uma visão geral das mudanças implementadas em JavaScript 1.8.5, veja <a href="/pt/Novidades_no_JavaScript_1.8.5" title="pt/Novidades no JavaScript 1.8.5">Novidades no JavaScript 1.8.5</a>. O JavaScript no Firefox 4 terá aderência adicional ao padrão ECMAScript 5.</p> - -<h3 id="Ferramentas_para_desenvolvedores">Ferramentas para desenvolvedores</h3> - -<dl> - <dt><a href="/pt/Usando_o_Web_Console" title="pt/Usando o Web Console">Usando o Web Console</a></dt> - <dd>A ferramenta Web Console é um depurador útil para ajudar desenvolvedores web, assim como, desenvolvedores de extensões.</dd> -</dl> - -<div class="geckoVersionNote"> -<div class="geckoVersionHeading"> -Gecko 2.0 note -<div style="font-size: 9px; line-height: 1; font-style: italic;">(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)</div> -</div> - -<p>O Console de Erros está inicialmente desabilitado por padrão no Firefox 4. Você pode reabilitá-lo mudando a preferência <code>devtools.errorconsole.enabled</code> para <code>true</code> e reiniciando seu navegador.</p> -</div> - -<h2 id="Mudanças_para_desenvolvedores_Mozilla_e_de_complementos">Mudanças para desenvolvedores Mozilla e de complementos</h2> - -<p>Para dicas úteis sobre a atualização de extensões existentes para o Firefox 4, veja <a href="/pt/Extensões/Atualizando_extensões_para_o_Firefox_4" title="pt/Extensões/Atualizando extensões para o Firefox 4">Atualizando extensões para o Firefox 4</a>. Existem muitas mudanças de chaves que quebram a compatibilidade com complementos existentes, então certifique-se de ler este artigo.</p> - -<p>Se você é um desenvolvedor de temas, você deve ler <a href="/en/Theme_changes_in_Firefox_4" title="en/Theme changes in Firefox 4">Mudanças nos temas do Firefox 4</a> (en) para entender algumas mudanças críticas, às quais é necessário estar ciente.</p> - -<h3 id="Módulos_de_codificação_JavaScript">Módulos de codificação JavaScript</h3> - -<dl> - <dt><a href="/en/JavaScript_code_modules/Services.jsm" title="en/JavaScript code modules/Services.jsm">Services.jsm</a></dt> - <dd>O módulo de código<code> Services.jsm</code> fornece "getters" que tornam mais fácil a obtenção de referências a serviços comumente usados, como o serviço de preferências ou o mediador de janelas, entre outros.</dd> -</dl> - -<dl> - <dt><a href="/en/JavaScript_code_modules/ctypes.jsm" title="en/JavaScript code modules/ctypes.jsm">JS-ctypes API</a></dt> - <dd>A API JS-ctypes torna possível chamar funções de fora da biblioteca compatível com C, sem precisar usar o XPCOM.</dd> - <dt><a href="/pt/Complementos/Gerenciador_de_Complementos" title="pt/Complementos/Gerenciador de Complementos">Gerenciador de Complementos</a></dt> - <dd>O Gerenciador de Complementos fornece informações sobre complementos instalados, suporte à gerência dos mesmos e fornece maneiras para instalar e remover complementos.</dd> - <dt><a href="/en/JavaScript_code_modules/PopupNotifications.jsm" title="en/JavaScript code modules/PopupNotifications.jsm">PopupNotifications.jsm</a></dt> - <dd>O novo módulo de notificações popup torna fácil apresentar notificações atrativas, não modais para o usuário. Você pode ver como usar esta API em <a href="/en/Using_popup_notifications" title="en/Using popup notifications">Usando notificações de popup</a> (en).</dd> - <dt><a href="/en/JavaScript_code_modules/Using#Locating_the_code_module" title="en/JavaScript code modules/Using JavaScript code modules#Locating the code module">Carregando módulos de código a partir de URL chrome:</a> (en)</dt> - <dd>Você pode agora carregar módulos JavaScript usando URL <strong>chrome:</strong>, mesmo dentro de arquivos JAR.</dd> - <dt>DownloadLastDir.jsm</dt> - <dd>O módulo de código <a href="/en/JavaScript_code_modules/DownloadLastDir.jsm" title="en/JavaScript/Code modules/DownloadLastDir.jsm"><code>DownloadLastDir.jsm</code></a> fornece a variável global, a qual contém uma string que pode ser usada para aprender o caminho do diretório no qual ocorreu o último download. Este módulo lida com questões relacionadas a privacidade de navegação do usuário.</dd> - <dt><a href="/en/Performance/Measuring_performance_using_the_PerfMeasurement.jsm_code_module" title="en/Performance/Measuring performance using the PerfMeasurement.jsm code module">Medindo a performance usando o módulo de código PerfMeasurement.jsm</a> (en)</dt> - <dd>O módulo de código <a href="/en/JavaScript_code_modules/PerfMeasurement.jsm" title="en/JavaScript code modules/PerfMeasurement.jsm"><code>PerfMeasurement.jsm</code></a> proporciona uma API para mensurar a performance dos dados a nível de CPU no código JavaScript.</dd> -</dl> - -<h4 id="Mudanças_diversas_aos_módulos_de_código">Mudanças diversas aos módulos de código</h4> - -<ul> - <li>O módulo de código <code>NetUtil.jsm</code> agora oferece o método <a href="/en/JavaScript_code_modules/NetUtil.jsm#readInputStreamToString%28%29" title="en/JavaScript/Code modules/NetUtil.jsm#readInputStreamToString()"><code>readInputStreamToString()</code></a>, o qual permite a leitura de bytes arbitrários de uma "stream" em uma string, mesmo se a "stream" incluir zeros.</li> - <li>Você agora pode <a href="/en/JavaScript_code_modules/Using_workers_in_JavaScript_code_modules" title="en/JavaScript code modules/Using workers in JavaScript code modules">usar workers em módulos de código JavaScript</a> (en).</li> -</ul> - -<h3 id="Mudanças_no_DOM">Mudanças no DOM</h3> - -<dl> -</dl> - -<dl> - <dt><a href="/pt-PT/docs/Web/API/ChromeWorker" title="The documentation about this has not yet been written; please consider contributing!"><code>ChromeWorker</code></a></dt> - <dd>Um novo tipo de <em>worker</em> para código privilegiado; ele permite o uso de coisas como <a href="/en/js-ctypes" title="en/js-ctypes">js-ctypes</a> de <em>workers</em> em extensões e código de aplicações.</dd> - <dt><a href="/pt/DOM/Eventos_de_toque" title="pt/DOM/Eventos de toque">Eventos de toque</a></dt> - <dd>Suporte para eventos de toque (não padrões) foi adicionado; isto permite detectar o movimento de múltiplos dedos movendo-se em uma tela ao mesmo tempo.</dd> -</dl> - -<h3 id="XUL">XUL</h3> - -<h4 id="Mudanças_no_elemento_tabbrowser">Mudanças no elemento tabbrowser</h4> - -<p>Várias mudanças foram feitas ao elemento <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/tabbrowser"><xul:tabbrowser></a></code> que causam impactos nas extensões que interagem com as abas. Adicionalmente para suportar abas aplicativos, estas mudanças também mudam a barra de abas para uma barra de ferramentas padrão, a qual permite que o usário arraste botões da barra de ferramentas para ela.</p> - -<ul> - <li>Os eventos de <code>TabClose</code>, <code>TabSelect</code> e <code>TabOpen</code> (fechar aba, selecionar aba e abrir aba) não levam mais ao elemento <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/tabbrowser"><xul:tabbrowser></a></code> (<code>gBrowser</code>). Eventos <em>listeners </em>(ouvintes) para estes eventos devem ser adicionados ao <code>gBrowser.tabContainer</code> ao invés de diretamente ao <code>gBrowser</code>.</li> - <li>O menu de contexto das abas não mais um filho anônimo do <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/tabbrowser"><xul:tabbrowser></a></code>. Ele pode portanto ser sobreposto diretamente com <a href="/en/XUL_Overlays" title="en/XUL Overlays">XUL overlays</a>. Ele também pode ser acessado mais diretamente com JavaScript via <code>gBrowser.tabContextMenu</code>. Veja <a class="external" href="http://www.gavinsharp.com/blog/2010/03/31/accessingmodifying-the-firefox-tab-context-menu-from-extensions/" title="http://www.gavinsharp.com/blog/2010/03/31/accessingmodifying-the-firefox-tab-context-menu-from-extensions/">esta postagem no blog</a> (en) para mais detalhes.</li> - <li>A nova propriedade <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/visibleTabs">visibleTabs</a></span></code> foi adicionada para permitir pegar um <em>array</em> das abas visíveis correntemente; isto permite determinar quais abas estão visíveis no conjuto de abas atual. Isto é usado pelo Firefox Panorama, por exemplo.</li> - <li>Adicionado o novo método <span id="m-showOnlyTheseTabs"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/showOnlyTheseTabs">showOnlyTheseTabs</a></code></span>; isto é usado pelo Firefox Panorama.</li> - <li>Adicionado o novo método <span id="m-getIcon"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/getIcon">getIcon</a></code></span>, o qual permite pegar o favicon de uma aba sem ter chamar o elemento <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/browser"><xul:browser></a></code>.</li> - <li>Adicionada a nova propriedade <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/tabbrowser.tabs">tabbrowser.tabs</a></span></code>, a qual permite facilmente pegar uma lista das abas em um elemento <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/tabbrowser"><xul:tabbrowser></a></code>.</li> - <li>Os novos métodos <span id="m-pinTab"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/pinTab">pinTab</a></code></span> e <span id="m-unpinTab"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/unpinTab">unpinTab</a></code></span> permitem que você prenda e desprenda abas (isto é, trocá-las entre serem abas de app ou abas normais).</li> -</ul> - -<h4 id="Mudanças_para_popups">Mudanças para popups</h4> - -<ul> - <li>Agora o elemento <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/menupopup"><xul:menupopup></a></code> do XUL possui a propriedade <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/triggerNode">triggerNode</a></span></code>, a qual indica o nó no qual o evento ocorreu, que causou a abertura do popup. Isto também requisitou a adição de um parâmetro de evento de disparo para o método <span id="m-openPopup"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/openPopup">openPopup</a></code></span>. Além disso, foi adicionada a propriedade <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/anchorNode">anchorNode</a></span></code>; ela retorna a âncora especificada quando o popup foi criado.</li> - <li>O elemento <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/panel"><xul:panel></a></code> agora oferece os atributos <code id="a-fade"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/fade">fade</a></code> e <code id="a-flip"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/flip">flip</a></code>, os quais são usados para configurar o comportamento do novo estilo "<em>arrow</em>" de notificação de painéis.</li> -</ul> - -<h4 id="Suporte_remoto_ao_XUL_removido">Suporte remoto ao XUL removido</h4> - -<p>XUL remoto não é mais suportado; isto afeta os documentos XUL servidos através de HTTP; além disso, não é mais possível carregar documentos XUL usando URLs <code>file://</code> a menos que você configure a preferência <code>dom.allowXULXBL_for_file</code> para <code>true</code>. Há, entretanto, um recurso de <em>whitelist</em> que pode ser usado para permitir domínios específicos a carregarem o XUL remotamente. O <a class="link-https" href="https://addons.mozilla.org/en-US/firefox/addon/235281/" rel="external nofollow" title="https://addons.mozilla.org/en-US/firefox/addon/235281/">Remote XUL Manager extension</a> permite o gerenciamento desta <em>whitelist</em>.</p> - -<h4 id="Mudanças_diversas_no_XUL">Mudanças diversas no XUL</h4> - -<ul> - <li>O atributo <code id="a-readonly"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/readonly">readonly</a></code> agora funciona corretamente para campos.</li> - <li>O elemento <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/resizer"><xul:resizer></a></code> agora permite o uso do atributo <code id="a-element"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/element">element</a></code> para especificar um elemento a ser redimencionado, ao invés de redimencionar a janela.</li> - <li>O elemtno <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/resizer"><xul:resizer></a></code> possui agora um atributo <code id="a-resizer.type"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/resizer.type">type</a></code> que permite especificar que o redimencionador é para uma janela ao invés de um elemento, para prevenir o redimencionador da janela de ser dobrado.</li> - <li>O atributo "active" não é mais configurado como ativo em janelas XUL. Ao invés disso, você pode usar a nova pseudoclasse <a href="/pt-PT/docs/Web/CSS/:-moz-window-inactive" title="The documentation about this has not yet been written; please consider contributing!"><code>:-moz-window-inactive</code></a> para definir diferentes estilos para as os fundos das janelas.</li> - <li>O atributo <code id="a-emptytext"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/emptytext">emptytext</a></code> está agora obsoleto; ao invés dele, você deve usar o <code id="a-placeholder"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/placeholder">placeholder</a></code>.</li> - <li>O elemento <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/popup"><xul:popup></a></code> não é mais suportado; ao invés dele, você deve usar o <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/menupopup"><xul:menupopup></a></code>.</li> - <li>O elemento <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/window"><xul:window></a></code> agora oferece um atributo <code id="a-accelerated"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/accelerated">accelerated</a></code>; quando verdadeiro, é permitido ao gerenciador de camadas por hardware, acelerar a janela.</li> - <li>O elemento <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/stack"><xul:stack></a></code> agora suporta os atributosl <code id="a-bottom"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/bottom">bottom</a></code> e <code id="a-right"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/right">right</a></code>.</li> - <li>Os eventos agora são lançados durante a customização da <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/toolbox"><xul:toolbox></a></code>, permitindo a <a href="/en/XUL/Toolbars/Toolbar_customization_events" title="en/XUL/Toolbars/Toolbar customization events">detecção de mudanças nas barras de ferramentas</a> (en).</li> - <li>O atributo <code id="a-alternatingbackground"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/alternatingbackground">alternatingbackground</a></code> para elementos <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/tree"><xul:tree></a></code> não é mais suportado; ao invés dele, você pode usar a pseudoclasse <a href="/pt-PT/docs/Web/CSS/:-moz-tree-row" title="The documentation about this has not yet been written; please consider contributing!"><code>:-moz-tree-row</code></a>.</li> - <li>O botão de exibição da barra de ferramentas dos favoritos com <em>anonid chevronPopup</em> não é mais anônimo; ele possui um ID de "PlacesChevron".</li> - <li>O elemento <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/tabs"><xul:tabs></a></code> agora possui a propriedade <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/tabbox">tabbox</a></span></code>, substituindo a antiga propriedade <code>_tabbox</code>, a qual está obsoleta (e nunca foi documentada).</li> - <li>Elementos XUL <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/window"><xul:window></a></code> agora possuem o atributo <code id="a-drawintitlebar"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/drawintitlebar">drawintitlebar</a></code>; se ele for <code>true</code>, a área de conteúdo da janela inclui a barra de títulos, permitindo desenhar na barra de títulos.</li> - <li>Os novos elementos <code>TabPinned</code> e <code>TabUnpinned</code> estão disponíveis, permitindo que você <a href="/en/Code_snippets/Tabbed_browser#Notification_when_a_tab_is_pinned_or_unpinned" title="https://developer.mozilla.org/en/Code_snippets/Tabbed_browser#Notification_when_a_tab_is_pinned_or_unpinned">detecte quando abas são prendidas e desprendidas</a> (en).</li> - <li>O novo <a href="/en/Code_snippets/Tabbed_browser#Notification_when_a_tab%27s_attributes_change" title="en/Code snippets/Tabbed browser#Notification when a tab's attributes change"> evento </a><a href="/en/Code_snippets/Tabbed_browser#Notification_when_a_tab%27s_attributes_change" title="en/Code snippets/Tabbed browser#Notification when a tab's attributes change"><code>TabAttrModified</code></a> é enviado quando os atributos <code id="a-label"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code>, <code id="a-crop"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/crop">crop</a></code>, <code id="a-busy"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/busy">busy</a></code>, <code id="a-image"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code> ou <code id="a-selected"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/selected">selected</a></code> das abas são modificados.</li> - <li>Os elementos <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/tab"><xul:tab></a></code> agora possuem um atributo <code id="a-pinned"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/pinned">pinned</a></code>, permitindo que você determine quando uma aba está ou não correntemente presa.</li> - <li>A classe <code>setDirectionIndicator</code> em elementos <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/tree"><xul:tree></a></code> não fez nada por algum tempo; agora ela não é mais usada.</li> - <li>O elemento <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/window"><xul:window></a></code> possui agora um atributo <code id="a-chromemargin"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/chromemargin">chromemargin</a></code> que permite configurar margens entre o <em>chrome</em> e o conteúdo de cada lado da janela; isto pode ser usado para desenhar na barra de títulos, por exemplo.</li> - <li>O elemento <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/window"><xul:window></a></code> possui agora um atributo <code id="a-disablechrome"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/disablechrome">disablechrome</a></code>; ele é usado para esconder a maioria do <em>chrome</em> em uma janela quando ela está sendo usada para exibir a IU no navegador, como em <code>about:addons</code>.</li> - <li>O elemento <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/window"><xul:window></a></code> possui agora um atributo <code id="a-disablefastfind"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/disablefastfind">disablefastfind</a></code>, o qual permite desabilitar a barra de busca em uma janela quando o conteúdo não a suporta. Isto é usado, por exemplo, no painel de complementos.</li> - <li>Barras de ferramentas agora podem ser caixas de ferramentas externas, enquanto continuarem sendo consideradas membros da <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/toolbox"><xul:toolbox></a></code>, configurando a propriedade <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/toolboxid">toolboxid</a></span></code> da <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/toolbox"><xul:toolbox></a></code>. Além disso, o elemento <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/toolbox"><xul:toolbox></a></code> agora possui uma propriedade <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/externalToolbars">externalToolbars</a></span></code>, a qual lista todas as barras de ferramentas consideradas membros da caixa de ferramentas.</li> - <li>Foi adicionado suporte a <a href="/en/XUL/Template_Guide/Template_Logging" title="en/XUL/Template Guide/Template Logging">logging XUL templates</a> para propósitos de depuração.</li> -</ul> - -<h3 id="Mudanças_na_IU_que_afetam_os_desenvolvedores">Mudanças na IU que afetam os desenvolvedores</h3> - -<dl> - <dt><a href="/en/The_add-on_bar" title="en/The add-on bar">A barra de complementos</a></dt> - <dd>O estado da barra foi removido em favor de uma nova barra de complementos. Será necessário atualizar sua extensão para usar isto se você já adicionou a IU à barra de estado no passado.</dd> -</dl> - -<h3 id="Armazenamento">Armazenamento</h3> - -<h4 id="Mudanças_diversas_na_API_storage_de_armazenamento">Mudanças diversas na API storage (de armazenamento)</h4> - -<ul> - <li>A interface <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/mozIStorageBindingParamsArray" title="">mozIStorageBindingParamsArray</a></code> possui agora um atributo <em>length</em> (comprimento) que indica o número de objetos <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/mozIStorageBindingParams" title="">mozIStorageBindingParams</a></code> no <em>array</em>.</li> - <li>O <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/mozIStorageStatement#bindParameters()">mozIStorageStatement.bindParameters()</a></code> agora retorna um erro se a <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/mozIStorageBindingParamsArray" title="">mozIStorageBindingParamsArray</a></code> especificada estiver vazia.</li> - <li>Adicionado o método <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/mozIStorageConnection#clone()">mozIStorageConnection.clone()</a></code>, o qual permite a clonagem de uma conexão de um banco de dados existente.</li> - <li>Adicionado o método <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/mozIStorageConnection#asyncClose()">mozIStorageConnection.asyncClose()</a></code>, o qual permite fechar ua conexão assíncronamente; você especifica um <em>callback</em> para ser notificado quando a operação de fechamento estiver completa.</li> - <li>Adicionado o método <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/mozIStorageConnection#setGrowthIncrement()">mozIStorageConnection.setGrowthIncrement()</a></code>, o qual permite a especificação da quantidade a qual o arquivo de banco de dados cresce com o tempo, para ajudar o SQLite a reduzir a fragmentação.</li> - <li>O erro <code>SQLITE_CONSTRAINT</code> é agora reportado como <code>NS_ERROR_STORAGE_CONSTRAINT</code> ao invés de como <code>NS_ERROR_FAILURE</code>.</li> -</ul> - -<h3 id="XPCOM">XPCOM</h3> - -<p>Em adição à mudanças específicas referenciadas abaixo, é importante notar que não existem mais interfaces estáticas. Todas as interfaces são dinâmicas, independente do que a documentação pode dizer. Atualizaremos a documentação com o tempo.</p> - -<dl> - <dt><a href="/pt/XPCOM/Mudancas_no_XPCOM_no_Gecko_2.0" title="pt/XPCOM/Mudancas no XPCOM no Gecko 2.0">Mudanças no XPCOM no Gecko 2.0</a></dt> - <dd>Detalhes sobre as mudanças para o XPCOM que causam algum impacto na compatibilidade do Firefox 4.</dd> - <dt><a href="/en/Components.utils.getGlobalForObject" title="en/Components.utils.getGlobalForObject">Components.utils.getGlobalForObject()</a></dt> - <dd>Este novo método retorna o objeto global com o qual um objeto é associado; ele substitui um caso de uso comum do agora removido <code>__parent__</code>.</dd> -</dl> - -<h3 id="Places">Places</h3> - -<ul> - <li>Os resultados de consultas no Places podem agora ser vistos por múltiplos observadores eas consultas podem ser executadas assíncronamente. Isto significa que há algumas mudanças nas interfaces <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsINavHistoryResult" title="">nsINavHistoryResult</a></code>, <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsINavHistoryQueryOptions" title="">nsINavHistoryQueryOptions</a></code>, e <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsINavHistoryContainerResultNode" title="">nsINavHistoryContainerResultNode</a></code>. Mais significantemente, a interface <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsINavHistoryResultViewer" title="">nsINavHistoryResultViewer</a></code> foi renomeada para <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsINavHistoryResultObserver" title="">nsINavHistoryResultObserver</a></code>.</li> - <li>Algumas <a href="/en/Observer_Notifications#Places" title="en/Observer Notifications#Places">novas notificações</a> foram adicionadas para permitir que o navegador controle os processos de desligamento do serviço Places com mais segurança. Destas, a maioria é somente para uso interno, mas o conhecimento da notificação <code>places-connection-closed</code> está disponível quando o serviço Places completa seu processo de desligamento.</li> - <li>Agora o tamanho de saída do <em>array</em> em vários métodos do Places é opcional.</li> - <li>Foi removido o suporte para <code><menupopup type="places"></code>. Ao invés, é necessário criar e popular um menu com informações do Places manualmente, ao invés de ter isto feito para você. Veja <a href="/en/Displaying_Places_information_using_views#Menu_view" title="en/Displaying Places information using views#Menu view">Displaying Places information using views: Menu view</a> para detalhes.</li> -</ul> - -<h3 id="Mudanças_na_interface">Mudanças na interface</h3> - -<ul> - <li>As interfaces <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDocShell" title="">nsIDocShell</a></code> e <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIWebBrowser" title="">nsIWebBrowser</a></code> agora possuem um novo atributo <code>isActive</code>, o qual é usado para permitir a otimização de caminhos de código para documentos que não estão visíveis correntemente.</li> - <li>O método <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMemory" title="">nsIMemory</a></code> de <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/nsIMemory#isLowMemory()">nsIMemory.isLowMemory()</a></code> <a href="/en/XPCOM_Interface_Reference/nsIMemory/isLowMemory" title="en/XPCOM Interface Reference/nsIMemory/isLowMemory">isLowMemory</a> foi considerado obsoleto. Ao invés disso, você deve usar <a href="/en/XPCOM_Interface_Reference/nsIMemory#Low_memory_notifications" title="en/XPCOM Interface Reference/nsIMemory#Low memory notifications">notificações "memory-pressure"</a> (en) para lidar com situações de pouca memória.</li> - <li>A API para lidar com redirecionamentos em canais HTTP mudou para permitir que sejam processados assincronamente, qualquer código implementado que lide com redirecionamento usando <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/nsIChannelEventSink#onChannelRedirect()">nsIChannelEventSink.onChannelRedirect()</a></code> precisa ser atualizado para, ao invés disso, usar <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/nsIChannelEventSink#asyncOnChannelRedirect()">nsIChannelEventSink.asyncOnChannelRedirect()</a></code>. Isto aceita um manipulador de <em>callbacks</em>, que precisa er chamado quando um redirecionamento é completado com sucesso.</li> - <li>Foi adicionado o método <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/nsINavHistoryResultObserver#batching()">nsINavHistoryResultObserver.batching()</a></code> proporcionando uma maneira para agrupar as operações do Places em lotes, reduzindo o número de notificações de atualização enviadas, o que pode melhorar a performance quando observadores estão realizando tarefas (assim como recarregar visualizações).</li> - <li>A interface <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIPref" title="">nsIPref</a></code>, obsoleta durante algum tempo, finalmente foi removida. Se você já não mudou para <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIPrefService" title="">nsIPrefService</a></code>, agora é o momento.</li> - <li>As interfaces <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISessionStore" title="">nsISessionStore</a></code> e <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISessionStartup" title="">nsISessionStartup</a></code> receberam mudanças para suportar a restauração das sessões, sob demanda. Veja o método <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/nsISessionStore#restoreLastSession()">nsISessionStore.restoreLastSession()</a></code>.</li> - <li>Os métodos <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/nsIPrincipal#subsumes()">nsIPrincipal.subsumes()</a></code> e <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/nsIPrincipal#checkMayLoad()">nsIPrincipal.checkMayLoad()</a></code> do <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIPrincipal" title="">nsIPrincipal</a></code>, assim como seus atributos <code>origin</code>, <code>csp</code>, e <code>URI</code>, estão agora disponíveis através de <em>scripts</em>; anteriormente eles estavam disponíveis apenas através de códigos nativos.</li> -</ul> - -<h3 id="Gerenciamento_de_memória">Gerenciamento de memória</h3> - -<dl> - <dt><a href="/en/Infallible_memory_allocation" title="en/Infallible memory allocation">Alocação de memória infalível</a></dt> - <dd>A Mozilla, agora proporciona alocadores de memória infalíveis que são garantem que não haverá um retorno <em>null</em>. Você deve ler este artigo para aprender como eles trabalham e como solicitar explicitamente a alocação de memória falível versus invalível.</dd> -</dl> - -<h3 id="Outras_mudanças">Outras mudanças</h3> - -<ul> - <li>A maioria dos recursos contidos no Firefox foi combinado em um único arquivo JAR, <code>omni.jar</code>, o qual melhora a performance na inicialização reduzindo I/O. Para detalhes, leia <a href="/en/About_omni.jar" title="en/About omni.jar">Sobre omni.jar</a> (en).</li> - <li>A preferência <code>accessibility.disablecache</code> não é mais suportada; ela está exposta apenas para propósitos de depuração e não é mais usada.</li> - <li>Complementos cujas GUID mudam de uma versão para outra podem agora ser atualizados corretamente.</li> - <li>Como um efeito colateral devido a remoção dos diretórios específicos para plataformas em pacotes de complementos, não é mais possível proporcional diferentes preferências padrão para cada plataforma.</li> -</ul> - -<h2 id="Outras_mudanças_2">Outras mudanças</h2> - -<dl> - <dt>Somente o arquivo chrome.manifest raiz é carregado</dt> - <dd>Agora somente o arquivo <code>chrome.manifest</code> raiz é carregado; se você necessitar de um arquivo de manifesto secundário para ser carregado, você pode usar o comando <a href="/en/Chrome_Registration#manifest" title="en/Chrome Registration#manifest"><code>manifest</code></a> no seu <code>chrome.manifest</code> raiz para carregá-lo.</dd> - <dt>Removido o suporte ao Gopher</dt> - <dd>O protocolo Gopher não é mais suportado nativamente. O suporte continuado está disponível pela extensão <a class="link-https" href="https://addons.mozilla.org/addon/7685/">OverbiteFF</a>.</dd> - <dt><a href="/en/The_message_manager" title="en/Content process event handling">Processamento de eventos de manipulação de conteúdo</a></dt> - <dd>Com o objetivo de suportar <em>plugins</em> fora do processo e outra características de multi processamento, uma nova API foi introduzida para suportar o envio de mensagens através de processos.</dd> -</dl> - -<dl> - <dt><a href="/en/Extensions/Bootstrapped_extensions" title="en/Extensions/Bootstrappable extensions">Extensões Bootstrapped</a> (en)</dt> - <dd>Agora é possível criar extensões que podem ser instaladas, desinstaladas e atualizadas (ou desatualizadas) sem a necessidade de reiniciar o navegador.</dd> -</dl> - -<dl> - <dt>Plugin padrão removido</dt> - <dd>O plugin padrão foi removido. A pasta de aplicações plugin também foi removida por padrão, entretanto o suporte para a instalação de plugins através desta pasta ainda existe. Veja <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=533891">bug 533891</a>.</dd> - <dt>Gerenciador de Extensões substituido pelo Gerenciador de Complementos</dt> - <dd>O <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIExtensionManager" title="">nsIExtensionManager</a></code> foi substituido pelo <a href="/en/Addons/Add-on_Manager/AddonManager" title="en/Addons/Add-on_Manager/AddonManager">Gerenciador de Complementos</a> (en).</dd> - <dt>Os filhos HWND não são mais usados</dt> - <dd>O Firefox não cria mais filhos HWND para seu uso interno no Windows. Se você escreveu uma extensão que usa código nativo para manipular estas HWND, a sua extensão não funcionará no Firefox 4. Você precisará ou parar de usar HWND ou empacotar seu código dependente de HWND em um plugin <a href="/en/NPAPI" title="en/NPAPI">NPAPI</a>. Isto dará um grande trabalho, então se for possível não fazer uso do HWND diretamente, é recomendado evitá-lo.</dd> - <dt>Mudanças nos gestos</dt> - <dd>A rolagem com três dedos para cima ou para baixo em <em>trackpads</em> foi alterada para, por padrão, abrir e fechar a visão do Firefox Panorama (criado como TabCandy). Para voltar aos comando anteriores de rolagem para cima e para baixo, abra about:config e configure <code>browser.gesture.swipe.down</code> para <code>cmd_scrollBottom</code> e <code>browser.gesture.swipe.up</code> para <code>cmd_scrollTop</code>.</dd> -</dl> - -<h2 id="Veja_também">Veja também</h2> - -<ul> - <li><a href="/pt/Firefox_3.6_para_desenvolvedores" title="pt/Firefox 3.6 para desenvolvedores">Firefox 3.6 para desenvolvedores</a></li> - <li><a href="/Pt/Firefox_3.5_para_desenvolvedores" title="pt/Firefox 3.5 para desenvolvedores">Firefox 3.5 para desenvolvedores</a></li> - <li><a href="/pt/Firefox_3_para_desenvolvedores" title="pt/Firefox 3 para desenvolvedores">Firefox 3 para desenvolvedores</a></li> - <li><a href="/pt/Firefox_2_para_desenvolvedores" title="pt/Firefox 2 para desenvolvedores">Firefox 2 para desenvolvedores</a></li> - <li><a href="/pt/Firefox_1.5_para_Desenvolvedores" title="pt/Firefox 1.5 para desenvolvedores">Firefox 1.5 para desenvolvedores</a></li> -</ul> diff --git a/files/pt-pt/mozilla/firefox/releases/5/index.html b/files/pt-pt/mozilla/firefox/releases/5/index.html deleted file mode 100644 index 4565a3131d..0000000000 --- a/files/pt-pt/mozilla/firefox/releases/5/index.html +++ /dev/null @@ -1,114 +0,0 @@ ---- -title: Firefox 5 para desenvolvedores -slug: Mozilla/Firefox/Releases/5 -translation_of: Mozilla/Firefox/Releases/5 -original_slug: Firefox_5_para_desenvolvedores ---- -<div>{{FirefoxSidebar}}</div><p>{{ draft() }}</p> -<p>O Firefox 5, é baseado no Gecko 5.0 e será lançado na metade de 2011. Este artigo proporciona links para informações sobre as mudanças que afetam os desenvolvedores nesta versão. Os <span style="font-style: italic;">n</span><em>ightly builds</em> do futuro Firefox 5 estão <a class="external" href="http://www.mozilla.com/en-US/firefox/channel/">disponíveis atualmente</a> no canal Beta (iesto é, na seção <a href="/En/Developer_Guide/Source_Code/Mercurial#mozilla-beta_(prerelease_development_tree)" title="En/Developer_Guide/Source_Code/Mercurial#mozilla-beta_(prerelease_development_tree)">mozilla-beta</a>).</p> -<div class="note"> - <strong>Nota:</strong> Devido à maneira de funcionamento do processo de desenvolvimento, é possível que características atualmente listadas aqui possam ser transferidas para versões futuras do Firefox, por este motivo, por favor, fique atento a esta página.</div> -<h2 id="Mudanças_para_desenvolvedores">Mudanças para desenvolvedores</h2> -<h3 id="HTML">HTML</h3> -<ul> - <li>Todos os elementos HTML agora possuem o atributo {{ domxref("element.accessKey", "accessKey") }}, assim como os métodos {{ domxref("element.blur()", "blur()") }}, {{ domxref("element.click()", "click()") }} e {{ domxref("element.focus()", "focus()") }}. Os quais estão especificados na interface {{ domxref("HTMLElement") }}.</li> - <li>Com o objetivo de cumprir a especificação do HTML5, foi removido o suporte aos <a href="/en/Character_Sets_Supported_by_Gecko" title="en/Character Sets Supported by Gecko">conjuntos de caracteres</a> UTF-7 e UTF-32.</li> - <li>Peculiarmente, {{ HTMLElement("map") }} vazios não são mais ignorados em favor de não vazios quando houver correspondência. Veja as <a href="/en/HTML/Element/map#Gecko_notes" title="en/HTML/Element/map#Gecko notes">notas do Gecko</a> sobre o elemento {{ HTMLElement("map") }} para detalhes.</li> -</ul> -<h4 id="Melhorias_no_Canvas">Melhorias no Canvas</h4> -<ul> - <li>O contexto de desenhos 2D do {{ HTMLElement("canvas") }} agora suporta a especificação de um objeto <code>ImageData</code> como entrada para o método <code>createImageData()</code>; isto <a href="/En/HTML/Canvas/Pixel_manipulation_with_canvas#Creating_an_ImageData_object" title="En/HTML/Canvas/Pixel manipulation with canvas#Creating an ImageData object">cria um novo objeto <code>ImageData</code></a> inicializado com as mesmas dimensões do objeto especificado, mas ainda assim com pixels pré configurados para preto transparente. Isto já foi documentado, mas ainda não foi implementado.</li> - <li>A especificação de valores não finitos durante a adicão de cores, agora, através do método {{ domxref("CanvasGradient") }} <code>addColorStop()</code> agora lança corretamente <code>INDEX_SIZE_ERR</code> ao invés de <code>SYNTAX_ERR</code>.</li> - <li>O método {{ domxref("HTMLCanvasElement") }} <code>toDataURL()</code> agora deixa as letras do tipo MIME especificado, minúsculas corretamente, antes da comparação.</li> - <li><code>getImageData()</code> agora aceita corretamente retângulos que se estendem além do limite do seu canvas; pixels fora do canvas são retornados como preto transparente.</li> - <li><code>drawImage()</code> e <code>createImageData()</code> agora lidam com argumentos negativos de acordo com a especificação, coloando o retângulo ao redor do eixo apropriado. <strong>É necessário um artigo sobre <strong><a class="external" href="http://dev.w3.org/csswg/css3-images/#default-sizing" title="http://dev.w3.org/csswg/css3-images/#default-sizing">redimencionamento CSS</a></strong> e como ele funciona.</strong></li> - <li>A especificação de valores não finitos na chamada de <code>createImageData()</code> agora lança uma exceção <code>NOT_SUPPORTED_ERR</code> apropriada.</li> - <li><code>createImageData()</code> e <code>getImageData()</code> agora retornam corretamente ao menos um pixels válido dos dados da imagem se um retângulo menor do que um pixels for especificado.</li> - <li>A especificação de um raio negativo na chamada de <code>createRadialGradient()</code> agora corretamente lança <code>INDEX_SIZE_ERR</code>.</li> - <li>A especificação de uma imagem <code>null</code> ou <code>undefined</code> na chamada de <code>createPattern()</code> ou <code>drawImage()</code> agora corretamente lança uma exceção <code>TYPE_MISMATCH_ERR</code>.</li> - <li>A especificação de valores inválidos para <code>globalAlpha</code> não lança mais uma exceção <code>SYNTAX_ERR</code>; estes agora são correta e silenciosamente ignorados.</li> - <li>A especificação de valores inválidos na chamada de <code>translate()</code>, <code>transform()</code>, <code>rect()</code>, <code>clearRect()</code>, <code>fillRect()</code>, <code>strokeRect()</code>, <code>lineTo()</code>, <code>moveTo()</code>, <code>quadraticCurveTo()</code> ou <code>arc()</code> não lançam mais uma exceção; estas chamadas são agora correta e silenciosamente ignoradas.</li> - <li>A configuração do valor de <code>shadowOffsetX</code>, <code>shadowOffsetY</code> ou <code>shadowBlur</code> para valores inválidos é agora silenciosamente ignorada.</li> - <li>A configuração do valor de <code>rotate</code> ou <code>scale</code> para valores inválidos é agora silenciosamente ignorada.</li> -</ul> -<h3 id="CSS">CSS</h3> -<dl> - <dt> - <a href="/en/CSS/CSS_animations" title="en/CSS/CSS animations">CSS animations</a></dt> - <dd> - Foi adicionado o suporte para animações CSS, por enquanto com o uso do prefixo <code>-moz</code>-.</dd> -</dl> -<h3 id="DOM">DOM</h3> -<ul> - <li>O objeto {{ domxref("selection") }} do método <a href="/en/DOM/Selection/modify" title="en/DOM/Selection/modify"><code>modify()</code></a> foi mudado para que a granularidade da seleção da "palavra" não mais inclua espaços a direita; isto torna-o mais consistente em diferentes plataformas e combina com o comportamento da implementação do WebKit.</li> - <li>O método {{ domxref("window.setTimeout()") }} agora limita-se a não enviar mais de um tempo limite por segundo em abas inativas. Adicionalmente, ele agora limita-se aos tempos limite aninhados para o menor valor permitido pela especificação do HTML5: 4ms (ao invés de 10ms, antes fixado).</li> - <li>Similarmente, o método {{ domxref("window.setInterval()") }} agora limita-se a não enviar mais do que um intervalo por segundo em abas inativas.<code> </code></li> - <li><a href="/en/XMLHttpRequest" title="en/XMLHttpRequest"><code>XMLHttpRequest</code></a> agora <a href="/En/XMLHttpRequest/Using_XMLHttpRequest#Detecting_any_load_end_condition" title="en/XMLHttpRequest/Using XMLHttpRequest#Detecting any load end condition">suporta o evento <code>loadend</code></a> para ouvintes de progresso. Isto é enviado após o fim de qualquer transferência (isto é, após os eventos de <code>abort</code>, <code>error</code> ou <code>load</code>). Você pode usar isto para lidar com quaisquer tarefas que necessitem ser realizadas independente do sucesso ou da falha da transferência.</li> - <li>O {{ domxref("Blob") }} e, por extensão, o objeto {{ domxref("File") }} do método <code>slice()</code> foi removido e substituido com uma nova sintaxe que o torna mais consistente com os métodos <a href="/en/JavaScript/Reference/Global_Objects/Array/slice" title="en/JavaScript/Reference/Global Objects/Array/slice"><code>Array.slice()</code></a> e <a href="/en/JavaScript/Reference/Global_Objects/String/slice" title="en/JavaScript/Reference/Global Objects/String/slice"><code>String.slice()</code></a> do JavaScript. Este método foi chamado de <a href="/en/DOM/Blob#mozSlice()" title="en/DOM/Blob#mozSlice()"><code>mozSlice()</code></a> por enquanto.</li> - <li>O valor de {{ domxref("window.navigator.language") }} é agora determinado pela observação do valor de <code>Accept-Language</code> do <a href="/en/HTTP/Headers" title="en/HTTP/Headers">cabeçalho HTTP</a>.</li> -</ul> -<h3 id="JavaScript">JavaScript</h3> -<ul> - <li>Expressões regulare não podem mais ser chamadas como se fossem funções; esta mudança foi feita juntamente com a equipe do WebKit para assegurar a compatibilidade (veja {{ WebkitBug(28285) }}. Esta característica existiu por um longo tempo mas nunca foi documentada (ao menos não no MDC).</li> - <li>O método <a href="/en/JavaScript/Reference/Global_Objects/Function/isGenerator" title="en/JavaScript/Reference/Global Objects/Function/isGenerator"><code>Function.prototype.isGenerator()</code></a> é agora suportado; ele permite determinar se uma função é um <a href="/en/JavaScript/Guide/Iterators_and_Generators#Generators.3a_a_better_way_to_build_Iterators" title="en/Core JavaScript 1.5 Guide/Iterators and Generators#Generators.3a a better way to build Iterators">generator</a>.</li> -</ul> -<h3 id="SVG">SVG</h3> -<ul> - <li>O atributo SVG {{ SVGAttr("class") }} pode agora ser animado.</li> - <li>As seguintes interfaces DOM relacionadas com o SVG, representando listas de objetos são agora indexáveis e podem ser acessadas como uma ordenação; adicionalmente, elas possuem uma propriedade <code>length</code> indicando o número de itens nas listas: {{ domxref("SVGLengthList") }}, {{ domxref("SVGNumberList") }}, {{ domxref("SVGPathSegList") }} e {{ domxref("SVGPointList") }}.</li> -</ul> -<h3 id="HTTP">HTTP</h3> -<ul> - <li>O Firefox não envia mais o cabeçalho HTTP "Keep-Alive"; nós não o estávamos formatando corretamente e ele era redundante, uma vez que também enviávamos o cabeçalho {{ httpheader("Connection") }} ou {{ httpheader("Proxy-Connection") }} com o valor "keep-alive" de qualquer modo.</li> - <li>O modelo de transação HTTP foi atualizado para ser mais inteligente no reuso de conexões na área de conexão permanente; ao invés de tratar isto como uma pilha {{ interwiki("wikipedia", "FIFO") }}, o Necko agora tenta sortear uma área com conexões com as maiores {{ interwiki("wikipedia", "congestion window") }} (CWND) primeiro. Isto pode reduzir o tempo de ida e volta (RTT) de transações HTTP evitando a necessidade de aumentar janelas de conexões em muitos casos.</li> - <li>O Firefox agora lida com o cabeçalho de resposta Content-Disposition HTTP mais efetivamente se ambos os parâmetros <code>filename</code> e <code>filename*</code> são fornecidos; ele procura por todos os nomes fornecidos, usando o parâmetro<code> filename*</code> se houver um disponível, mesmo se um parâmetro <code>filename</code> é incluido primeiro. Anteriormente, o primeiro parâmetro de comparação seria usado, desta forma impedindo o uso de um nome mais apropriado. Veja {{ bug(588781) }}.</li> -</ul> -<h3 id="MathML">MathML</h3> -<ul> - <li>Suporte a <a class="external" href="http://www.w3.org/TR/MathML3/chapter3.html#id.3.2.5.7.3" title="http://www.w3.org/TR/MathML3/chapter3.html#id.3.2.5.7.3">operadores embelezados</a></li> -</ul> -<h3 id="Ferramentas_para_desenvolvedores">Ferramentas para desenvolvedores</h3> -<ul> - <li>O <a href="/en/Using_the_Web_Console#The_console_object" title="en/Using the Web Console#The console object">objeto <code>Console</code> do </a><a href="/en/Using_the_Web_Console#The_console_object" title="en/Using the Web Console#The console object">Console Web</a> agora possui um método <code>debug()</code>, o qual é um pseudônimo para seu método <code>log()</code>; isto melhora a compatibilidade com certos sites existentes.</li> -</ul> -<h2 id="Mudanças_para_desenvolvedores_de_complementos_e_da_Mozilla">Mudanças para desenvolvedores de complementos e da Mozilla</h2> -<div class="note"> - <strong>Nota:</strong> O Firefox 5 requere que componentes bionários sejam recompilados, assim como todas as versões maiores do Firefox. Veja <a href="/En/Developer_Guide/Interface_Compatibility#Binary_Interfaces" title="En/Developer Guide/Interface Compatibility#Binary Interfaces">Interfaces Binárias</a> para detalhes.</div> -<h3 id="Mudanças_nos_módulos_de_código_do_JavaScript">Mudanças nos módulos de código do JavaScript</h3> -<h4 id="Novos_módulos_de_códigos_JavaScript">Novos módulos de códigos JavaScript</h4> -<ul> - <li>O módulo de código <a href="/en/JavaScript_code_modules/Dict.jsm" title="en/JavaScript code modules/Dict.jsm"><code>Dict.jsm</code></a> foi adicionado; ele fornece uma API para dicionários de pares chave/valor.</li> -</ul> -<h4 id="NetUtil.jsm">NetUtil.jsm</h4> -<ul> - <li>O método <a href="/en/JavaScript_code_modules/NetUtil.jsm#asyncFetch()" title="en/JavaScript code modules/NetUtil.jsm#asyncFetch()"><code>asyncFetch()</code></a> agora suporta a especificação da fonte de entrada como um {{ interface("nsIInputStream") }}.</li> -</ul> -<h3 id="Mudanças_na_interface">Mudanças na interface</h3> -<ul> - <li>A interface {{ interface("nsIHttpChannelInternal") }} possui novos atributos provendo acesso à informações sobre os pontos de extremidades dos endereços e portas dos canais. Esta informação é fornecida primariamente para propósitos de depuração.</li> - <li>Os atributos {{ htmlattrxref("width", "canvas") }} e {{ htmlattrxref("height", "canvas") }} do elemento {{ HTMLElement("canvas") }} são agora refletidos em IDL como <em>unsigned integers</em> ao invés de <em>signed</em> (veja <a href="/en/DOM/HTMLCanvasElement" title="en/DOM/HTMLCanvasElement"><code>HTMLCanvasElement</code></a>).</li> -</ul> -<h3 id="Ferramentas_de_depuração">Ferramentas de depuração</h3> -<ul> - <li>O novo ajudante <a href="/En/Namespace/Mozilla/DebugOnly%3CT%3E" title="En/Namespace/Mozilla/DebugOnly<T>"><code>DebugOnly<T></code></a> torna possível declarar variáveis somente para construções <code>DEBUG</code>.</li> -</ul> -<h3 id="API_JavaScript_(SpiderMonkey)">API JavaScript (SpiderMonkey)</h3> -<ul> - <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DoubleToInt32" title="en/SpiderMonkey/JSAPI Reference/JS DoubleToInt32"><code>JS_DoubleToInt32()</code></a> e <a href="/en/SpiderMonkey/JSAPI_Reference/JS_DoubleToInt32" title="en/SpiderMonkey/JSAPI Reference/JS DoubleToInt32"><code>JS_DoubleToUint32()</code></a> foram adicionados, para converter valores <code><a href="/en/SpiderMonkey/JSAPI_Reference/jsdouble" title="en/jsdouble">jsdouble</a></code> em <em>integers</em> C e <em>unsigned integers</em>.</li> -</ul> -<h3 id="Mudanças_no_sistema_de_construção">Mudanças no sistema de construção</h3> -<ul> - <li> - <p>Você pode construir o Firefox sem um arquivo <code>mozconfig</code>; a<a href="/en/Configuring_Build_Options#Choose_an_application" title="en/Configuring Build Options#Choose an application"> configuração</a> <a href="/en/Configuring_Build_Options#Choose_an_application" title="en/Configuring Build Options#Choose an application"><code>--enable-application</code></a> agora tem "browser" por padrão. Após puxar ou baixar o código, você pode simplesmente <code>configure && make</code> (ou <code>make -f client.mk</code>) para construir o Firefox.</p> - </li> -</ul> -<h3 id="Veja_também">Veja também</h3> -<ul> - <li><a href="/pt/Firefox_4_para_desenvolvedores" title="pt/Firefox 4 para desenvolvedores">Firefox 4 para desenvolvedores</a></li> - <li><a href="/pt/Firefox_3.6_para_desenvolvedores" title="pt/Firefox 3.6 para desenvolvedores">Firefox 3.6 para desenvolvedores</a></li> - <li><a class="internal" href="/pt/Firefox_3.5_para_desenvolvedores" title="pt/Firefox 3.5 para desenvolvedores">Firefox 3.5 para desenvolvedores</a></li> - <li><a class="internal" href="/pt/Firefox_3_para_desenvolvedores" title="pt/Firefox 3 para desenvolvedores">Firefox 3 para desenvolvedores</a></li> - <li><a class="internal" href="/pt/Firefox_2_para_desenvolvedores" title="pt/Firefox 2 para desenvolvedores">Firefox 2 para desenvolvedores</a></li> - <li><a class="internal" href="/pt/Firefox_1.5_para_desenvolvedores" title="pt/Firefox 1.5 para desenvolvedores">Firefox 1.5 para desenvolvedores</a></li> -</ul> -<p>{{ languages( { "en": "en/Firefox_5_for developers"} ) }}</p> diff --git a/files/pt-pt/mozilla/firefox/releases/6/index.html b/files/pt-pt/mozilla/firefox/releases/6/index.html deleted file mode 100644 index 7f28326dce..0000000000 --- a/files/pt-pt/mozilla/firefox/releases/6/index.html +++ /dev/null @@ -1,250 +0,0 @@ ---- -title: Firefox 6 para programadores -slug: Mozilla/Firefox/Releases/6 -translation_of: Mozilla/Firefox/Releases/6 -original_slug: Firefox_6_para_desenvolvedores ---- -<div><section class="Quick_links" id="Quick_Links"> - <ol> - <li class="toggle"> - <details> - <summary>Firefox developer release notes</summary> - <ol> - <li><a href="/pt-PT/docs/Mozilla/Firefox/Releases">Firefox developer release notes</a></li> - </ol> - </details> - </li> - <li class="toggle"> - <details> - <summary>Add-ons</summary> - <ol> - <li><a href="/pt-PT/Add-ons/WebExtensions">Browser extensions</a></li> - <li><a href="/pt-PT/Add-ons/Themes">Themes</a></li> - </ol> - </details> - </li> - <li class="toggle"> - <details> - <summary>Firefox internals</summary> - <ol> - <li><a href="/pt-PT/docs/Mozilla/">Mozilla project</a></li> - <li><a href="/pt-PT/docs/Mozilla/Gecko">Gecko</a></li> - <li><a href="/pt-PT/docs/Mozilla/Firefox/Headless_mode">Headless mode</a></li> - <li><a href="/pt-PT/docs/Mozilla/JavaScript_code_modules">JavaScript code modules</a></li> - <li><a href="/pt-PT/docs/Mozilla/js-ctypes">JS-ctypes</a></li> - <li><a href="/pt-PT/docs/Mozilla/MathML_Project">MathML project</a></li> - <li><a href="/pt-PT/docs/Mozilla/MFBT">MFBT</a></li> - <li><a href="/pt-PT/docs/Mozilla/Projects">Mozilla projects</a></li> - <li><a href="/pt-PT/docs/Mozilla/Preferences">Preference system</a></li> - <li><a href="/pt-PT/docs/Mozilla/WebIDL_bindings">WebIDL bindings</a></li> - <li><a href="/pt-PT/docs/Mozilla/Tech/XPCOM">XPCOM</a></li> - <li><a href="/pt-PT/docs/Mozilla/Tech/XUL">XUL</a></li> - </ol> - </details> - </li> - <li class="toggle"> - <details> - <summary>Building and contributing</summary> - <ol> - <li><a href="/pt-PT/docs/Mozilla/Developer_guide/Build_Instructions">Build instructions</a></li> - <li><a href="/pt-PT/docs/Mozilla/Developer_guide/Build_Instructions/Configuring_Build_Options">Configuring build options</a></li> - <li><a href="/pt-PT/docs/Mozilla/Developer_guide/Build_Instructions/How_Mozilla_s_build_system_works">How the build system works</a></li> - <li><a href="/pt-PT/docs/Mozilla/Developer_guide/Source_Code/Mercurial">Mozilla source code</a></li> - <li><a href="/pt-PT/docs/Mozilla/Localization">Localization</a></li> - <li><a href="/pt-PT/docs/Mozilla/Mercurial">Mercurial</a></li> - <li><a href="/pt-PT/docs/Mozilla/QA">Quality assurance</a></li> - <li><a href="/pt-PT/docs/Mozilla/Using_Mozilla_code_in_other_projects">Using Mozilla code in other projects</a></li> - </ol> - </details> - </li> - </ol> -</section></div> - -<p>O Firefox 6, baseado no Gecko 6.0, será lançado no dia 16 de agosto de 2011. Este artigo fornece hiperligações para a informação acerca das alterações que afetam os programadores neste lançamento.</p> - -<h2 id="Alterações_para_os_programadores_da_Web">Alterações para os programadores da Web</h2> - -<h3 id="HTML">HTML</h3> - -<dl> -</dl> - -<ul> - <li>O elemento <a href="/pt-PT/docs/Web/HTML/Element/progress" title="The documentation about this has not yet been written; please consider contributing!"><code><progress></code></a> do HTML5, o qual permite a criação de barras de progresso, agora é suportado.</li> - <li>A análise do elemento <a href="/pt-PT/docs/Web/HTML/Element/track" title="The documentation about this has not yet been written; please consider contributing!"><code><track></code></a> do HTML5, o qual especifica faixas de texto para elementos de mídia, é agora suportado. Este elemento deve aparecer no DOM agora, apesar disso, seu comportamento ainda não foi implementado.</li> - <li>O elemento <a href="/pt-PT/docs/Web/HTML/Element/iframe" title="The documentation about this has not yet been written; please consider contributing!"><code><iframe></code></a> agora está corretamente associado ao seu receptáculo quando as bordas do receptáculo foram arredondadas utilizando-se a propriedade <a href="/pt-PT/docs/Web/CSS/border-radius" title="The documentation about this has not yet been written; please consider contributing!"><code>border-radius</code></a>.</li> - <li>Campos de texto <a href="/pt-PT/docs/Web/HTML/Element/input" title="The documentation about this has not yet been written; please consider contributing!"><code><input></code></a> do elemento <a href="/pt-PT/docs/Web/HTML/Element/form" title="The documentation about this has not yet been written; please consider contributing!"><code><form></code></a> não são mais suportam a propriedade <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/maxwidth">maxwidth</a></span></code> do XUL; isto nunca foi intencional, e está em desacordo com a especificação do HTML. Você deve ao invés, usar o atributo <code><a href="/pt-PT/docs/Web/HTML/Element/input#attr-size">size</a></code> para configurar a largura máxima dos campos de entrada.</li> - <li>As propriedades <code>fillStyle</code> e <code>strokeStyle</code> do <a href="/pt-PT/docs/Web/HTML/Element/canvas" title="The documentation about this has not yet been written; please consider contributing!"><code><canvas></code></a> <a href="/pt-PT/docs/Web/API/CanvasRenderingContext2d" title="The documentation about this has not yet been written; please consider contributing!"><code>CanvasRenderingContext2d</code></a> costumavam ignorar lixo incluído após a definição correta de cor; agora isto é corretamente tratado, como um erro. Por exemplo, "red blue" como uma cor, costumava ser tratado como "red", quando deveria ser ignorado.</li> - <li>A largura e altura dos elementos do <a href="/pt-PT/docs/Web/HTML/Element/canvas" title="The documentation about this has not yet been written; please consider contributing!"><code><canvas></code></a> podem agora serem corretamente configuradas para 0px; anteriormente, elas estavam recebendo uma configuração arbirária de 300px quando essa configuração era testada</li> - <li>Foi adicionado suporte para <a href="/en/HTML/Global_attributes#attr-data-*" title="https://developer.mozilla.org/en/HTML/Global_attributes#attr-data-*">custom data attributes</a> (data-*). A propriedade <a href="/pt-PT/docs/Web/API/Element/dataset" title="The documentation about this has not yet been written; please consider contributing!"><code>element.dataset</code></a> do DOM permite acessá-los.</li> - <li>Quando um elemento <a href="/pt-PT/docs/Web/HTML/Element/textarea" title="The documentation about this has not yet been written; please consider contributing!"><code><textarea></code></a> recebe foco, o ponto de inserção de texto é agora indicado, por padrão, no início do texto, ao invés de no fim. Isto torna o comportamento do Firefox consistente com outros navegadores.</li> -</ul> - -<h3 id="CSS">CSS</h3> - -<dl> - <dt><a href="/pt-PT/docs/Web/CSS/text-decoration-color" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-text-decoration-color</code></a></dt> - <dd>Esta nova propriedade permite configurar a cor usada em decorações de texto, tais como sublinhados, sobrelinhados e rasurados.</dd> - <dt><a href="/pt-PT/docs/Web/CSS/text-decoration-line" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-text-decoration-line</code></a></dt> - <dd>Esta nova propriedade permite configurar o tipo de decoração de texto adicionado a um elemento.</dd> - <dt><a href="/pt-PT/docs/Web/CSS/text-decoration-style" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-text-decoration-style</code></a></dt> - <dd>Esta nova propriedade permite configurar o estilo das decorações de texto, tais como sublinhado, sobrelinhado e rasurado. Os estilos incluem simples tracejado, tracejado duplo, linha ondulada, linha pontilhada e assim por diante.</dd> - <dt><a href="/pt-PT/docs/Web/CSS/hyphens" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-hyphens</code></a></dt> - <dd>Esta nova propriedade permite controlar como é tratada a hifenização das palavras quando ocorre uma quebra de linha.</dd> - <dt><a href="/pt-PT/docs/Web/CSS/orient" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-orient</code></a></dt> - <dd>Uma nova propriedade (atualmente específica da Mozilla) a qual permite controlar a orientação: vertical ou horizontal, de certos elementos (particularmente <a href="/pt-PT/docs/Web/HTML/Element/progress" title="The documentation about this has not yet been written; please consider contributing!"><code><progress></code></a>).</dd> - <dt><a href="/pt-PT/docs/Web/CSS/::-moz-progress-bar" title="The documentation about this has not yet been written; please consider contributing!"><code>::-moz-progress-bar</code></a></dt> - <dd>A Mozilla-specific pseudo-element that lets you style the area of an <a href="/pt-PT/docs/Web/HTML/Element/progress" title="The documentation about this has not yet been written; please consider contributing!"><code><progress></code></a> element representing the completed portion of a task.</dd> -</dl> - -<h4 id="Outras_alterações">Outras alterações</h4> - -<ul> - <li>A propriedade <a href="/pt-PT/docs/Web/CSS/@-moz-document" title="The documentation about this has not yet been written; please consider contributing!"><code>@-moz-document</code></a> possui uma nova função <code>regexp()</code>, a qual permite comparar uma URL de documento com uma <a href="/en/JavaScript/Guide/Regular_Expressions" title="en/Core JavaScript 1.5 Guide/Regular Expressions">expressão regular</a> (en).</li> - <li>A propriedade <a href="/pt-PT/docs/Web/CSS/azimuth" title="Em combinação com elevation, azimuth habilita diferentes fontes de áudio para serem posicionadas espacialmente para apresentações aurais. Isto é importante porque proporciona uma maneira natural de contar várias vozes a parte, como cada uma pode ser posicionada para originar em uma localização diferente no estágio de som. Saída estéreo produz um estágio de som lateral, enquanto instalações de fones de ouvido e microfones permitem um estágio tridimencional completo."><code>azimuth</code></a> do CSS não é mais suportada, haja vista a remoção do pequeno código do grupo de mídia <code>aural</code> que tínhamos. A mesma nunca foi significantemente implementada, portanto fazia mais sentido remover uma implementação intrincada pelo tempo ao invés de tentar corrigí-la.</li> - <li>No passado, a pseudoclasse <a href="/pt-PT/docs/Web/CSS/:hover" title="The documentation about this has not yet been written; please consider contributing!"><code>:hover</code></a> não se aplicava a seletores de classe quando no modo <strong>quirks</strong>; por exemplo, <code>.someclass:hover</code> não funcionava Este <strong>quirk</strong> foi removido.</li> - <li>A pseudoclasse <a href="/pt-PT/docs/Web/CSS/:indeterminate" title="The documentation about this has not yet been written; please consider contributing!"><code>:indeterminate</code></a> pode ser aplicada a elementos <a href="/pt-PT/docs/Web/HTML/Element/progress" title="The documentation about this has not yet been written; please consider contributing!"><code><progress></code></a>. Isto não é um padrão, mas esperamos que seja adotado por outros navegadores, pois é útil.</li> -</ul> - -<h3 id="DOM">DOM</h3> - -<dl> - <dt><a href="/en/CSS/Using_media_queries_from_code" title="en/CSS/Using media queries from code">Utilizar pedidos de multimédia do código</a> (en)</dt> - <dd>Agora é possível testar o resultado de uma sequência de consulta de mídia programaticamente usando o método <a href="/pt-PT/docs/Web/API/Window/matchMedia" title="The documentation about this has not yet been written; please consider contributing!"><code>window.matchMedia()</code></a> e a interface <a href="/pt-PT/docs/Web/API/MediaQueryList" title="The documentation about this has not yet been written; please consider contributing!"><code>MediaQueryList</code></a>.</dd> -</dl> - -<ul> - <li><code>navigator.securityPolicy</code>, o qual retornou uma string vazia por muito tempo, foi totalmente removido.</li> - <li><a href="/pt-PT/docs/Web/API/Document/height" title="The documentation about this has not yet been written; please consider contributing!"><code>document.height</code></a> e <a href="/pt-PT/docs/Web/API/Document/width" title="The documentation about this has not yet been written; please consider contributing!"><code>document.width</code></a> foram removidos. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=585877" title="FIXED: remove document.height / document.width">bug 585877</a></li> - <li>As propriedades <code>entities</code> e <code>notations</code> do objeto <a href="/pt-PT/docs/Web/API/DocumentType" title="The documentation about this has not yet been written; please consider contributing!"><code>DocumentType</code></a>, as quais nunca foram implementadas e sempre retornaram <code>null</code>, foram removidas, uma vez que também foram removidas da especificação.</li> - <li>A interface <code>DOMConfiguration</code> e a propriedade <code>document.domConfig</code> que a utilizava foram ambas removidas; elas nunca foram suportadas e já foram removidas da especificação do DOM.</li> - <li>O evento <code>hashchange</code> agora inclui corretamente <a href="/en/DOM/window.onhashchange#The_hashchange_event" title="en/DOM/window.onhashchange#The hashchange event">os campos <code>newURL</code> e <code>oldURL</code></a> (en).</li> - <li>O método <code>abort()</code> da interface <a href="/pt-PT/docs/Web/API/FileReader" title="The FileReader object lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using File or Blob objects to specify the file or data to read."><code>FileReader</code></a> agora lança uma exceção quando usado, se nenhuma leitura de arquivo estiver em progresso.</li> - <li>Agora é possível <a href="/en/Printing#Detecting_print_requests" title="https://developer.mozilla.org/en/Printing#Detecting_print_requests">detectar quando uma impressão foi iniciada e completada</a> (en) observando os novos eventos <code>beforeprint</code> e <code>afterprint</code>.</li> - <li>A propriedade <code>document.strictErrorChecking</code> foi removida, uma vez que nunca foi implementada e que foi removida da especificação do DOM.</li> - <li>A propriedade padrão <a href="/pt-PT/docs/Web/API/Event/defaultPrevented" title="The documentation about this has not yet been written; please consider contributing!"><code>event.defaultPrevented</code></a> é agora suportada; deve-se usá-la ao invés do método não padrão <code>getPreventdefault()</code> para detectar se <a href="/pt-PT/docs/Web/API/Event/preventDefault" title="The documentation about this has not yet been written; please consider contributing!"><code>event.preventDefault()</code></a> foi ou não chamado no evento.</li> - <li>A propriedade <a href="/pt-PT/docs/Web/API/Window/top" title="The documentation about this has not yet been written; please consider contributing!"><code>window.top</code></a> é agora, corretamente, somente letura.</li> - <li>A visualização do DOM, a qual nunca foi documentada, foi removida. Isto era um pequeno detalhe de implementação que estava complicando as coisas desnecessariamente, então nos livramos disto. Se esta mudança for percebida, provavelmente se está fazendo alguma coisa errada.</li> - <li>O parâmetro EventTarget da função useCapture do addEventListener() é agora opcional, assim como no WebKit. Embora não seja um comportamento padrão, isto melhora a compatibilidade.</li> - <li>A propriedade <code>mozResponseArrayBuffer</code> do objeto <a href="/en/XMLHttpRequest" title="en/XMLHttpRequest"><code>XMLHttpRequest</code></a> foi substituida pelas propriedades <code>responseType</code> e <code>response</code>.</li> - <li>A propriedade <a href="/pt-PT/docs/Web/API/Element/dataset" title="The documentation about this has not yet been written; please consider contributing!"><code>element.dataset</code></a> foi adicionada à interface <a href="/en/DOM/HTMLElement" title="en/DOM/HTMLElement"><code>HTMLElement</code></a> permitindo acesso aos <a href="/en/HTML/Global_attributes#attr-data-*" title="https://developer.mozilla.org/en/HTML/Global_attributes#attr-data-*">atributos globais</a> (en) <a href="/en/HTML/Global_attributes#attr-data-*" title="https://developer.mozilla.org/en/HTML/Global_attributes#attr-data-*"><code>data-*</code></a> de um elemento.<a href="/en/HTML/Global_attributes#attr-data-*" title="https://developer.mozilla.org/en/HTML/Global_attributes#attr-data-*">Global attributes#attr-data-*</a></li> -</ul> - -<h3 id="JavaScript">JavaScript</h3> - -<ul> - <li>No passado, era possível usar o operador <code>new</code> em várias funções embutidas (eval, parseInt, Date.parse...) que não deveriam permitir isto, de acordo com a especificação. Este comportamento não é mais suportado. O uso do operador <code>new</code> desta maneira nunca foi oficialmente suportado e não foi muito utilizado, desta forma é pouco provável que esta mudança o afete.</li> - <li>O ECMAScript Harmony <a href="/en/JavaScript/Reference/Global_Objects/WeakMap" title="en/JavaScript/Reference/Global_Objects/WeakMap">WeakMaps</a> foi adicionado como uma implementação em protótipos.</li> -</ul> - -<h3 id="SVG">SVG</h3> - -<ul> - <li>O atributo <code><a href="/pt-PT/docs/Web/SVG/Attribute/pathLength">pathLength</a></code> é agora suportado.</li> - <li>Os padrões, gradientes e filtros do SVG agora trabalham corretamente quando carregados de <a href="/en/data_URIs" title="https://developer.mozilla.org/en/data_URIs"><code>data:</code> URLs</a> (en).</li> -</ul> - -<h3 id="HTTP">HTTP</h3> - -<ul> - <li>A análise do "Content-Disposition" do cabeçalho foi corrigida para interpretar corretamente escapes de contrabarras e caracteres ASCII assim como o próprio caractere. Anteriormente o caractere estava sendo substituido incorretamente por um sublinhado ("_").</li> - <li>O cabecalho "Accept-Charset" não é mais enviado; sua utilidade é mínima agora que o suporte ao UTF-8 é quase universal e pode ser usado para obter informações (mínimas) sobre os usuários.</li> -</ul> - -<h3 id="Cookies">Cookies</h3> - -<ul> - <li>O valor do campo de caminho nos cabeçalhos <code>Set-Cookie</code> é agora interpretado corretamente quando são usadas aspas duplas; anteriormente elas estavam sendo tratadas como parte da string de caminhos ao invés de delimitadores. <strong>Esta mudança pode afetar a compatibilidade com alguns sites</strong>, os autores devem, desta forma, checar seu código.</li> -</ul> - -<h3 id="Outras_alterações_2">Outras alterações</h3> - -<ul> - <li>O suporte à microresumos foi removido; estes nunca foram amplamente utilizados, não sendo muito detectáveis. Continuar o suporte a isto estava dificultando a melhoria da arquitetura do Places (favoritos e histórico)</li> - <li>O WebGL agora suporta a extensão <a class="external" href="http://www.khronos.org/registry/gles/extensions/OES/OES_texture_float.txt" title="http://www.khronos.org/registry/gles/extensions/OES/OES_texture_float.txt"><code>OES_texture_float</code></a>.</li> -</ul> - -<h2 id="Alterações_para_os_programadores_de_extras_e_da_Mozilla">Alterações para os programadores de extras e da Mozilla</h2> - -<div class="note"><strong>Nota:</strong> o Firefox 6 necessita que os componentes binários sejam recompilados, assim como todos os lançamentos maiores do Firefox. Veja <a href="/En/Developer_Guide/Interface_Compatibility#Binary_Interfaces" title="En/Developer Guide/Interface Compatibility#Binary Interfaces">Interfaces Binárias</a> (en) para detalhes.</div> - -<h3 id="Módulos_de_código_JavaScript">Módulos de código JavaScript</h3> - -<h4 id="FileUtils.jsm">FileUtils.jsm</h4> - -<ul> - <li>O método <code>openSafeFileOutputStream()</code> agora abre arquivos com a<a href="/en/XPCOM_Interface_Reference/nsIFileOutputStream#Behavior_flag_constants" title="en/XPCOM Interface Reference/nsIFileOutputStream#Behavior flag constants"> <em>flag</em> de comportamento</a> (en) <code>DEFER_OPEN</code> ao invés de tentar abri-los imediatamente.</li> -</ul> - -<h4 id="XPCOMUtils.jsm">XPCOMUtils.jsm</h4> - -<ul> - <li>O novo método <a href="/en/JavaScript_code_modules/XPCOMUtils.jsm#importRelative()" title="en/JavaScript code modules/XPCOMUtils.jsm#importRelative()"><code>importRelative()</code></a> permite carregar um módulo de código JavaScript de um caminho relativo de outro módulo JavaScript. Isto facilita a construção de módulos que dependam um do outro.</li> -</ul> - -<h3 id="XPCOM">XPCOM</h3> - -<ul> - <li><a href="/en/XPCOM_array_guide#nsCOMArray.3cT.3e" title="en/XPCOM array guide#nsCOMArray.3cT.3e"><code>nsCOMArray<T></code></a> agora possui o método <a href="/en/XPCOM_array_guide#Deleting_objects" title="en/XPCOM array guide#Deleting objects"><code>RemoveObjectsAt()</code></a> para remoção de múltiplos objetos de uma só vez de uma ordenação.</li> -</ul> - -<h3 id="Usando_o_DOM_do_chrome">Usando o DOM do chrome</h3> - -<dl> - <dt><a href="/en/Extensions/Using_the_DOM_File_API_in_chrome_code" title="en/Extensions/Using the DOM File API in chrome code">Using the DOM File API in chrome code</a></dt> - <dd>Embora sempre tenha sido possível utilizar a API File do DOM do código chrome, o construtor <a href="/pt-PT/docs/Web/API/File" title="The documentation about this has not yet been written; please consider contributing!"><code>File</code></a> agora suporta a especificação de uma string de nome de caminho local quando usada através do chrome. Adicionalmente, você também pode especificar o arquivo para acessar usando a API File do DOM usando um objeto <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFile" title="">nsIFile</a></code>.</dd> -</dl> - -<h3 id="Alterações_da_interface">Alterações da interface</h3> - -<ul> - <li><code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsINavHistoryQueryOptions" title="">nsINavHistoryQueryOptions</a></code> agora suporta classificação por ordem de frequência, usando as novas constantes <code>SORT_BY_FRECENCY_ASCENDING</code> e <code>SORT_BY_FRECENCY_DESCENDING</code>.</li> - <li><code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFilePicker" title="">nsIFilePicker</a></code> possui um novo atributo <code><a href="https://developer.mozilla.org/pt-PT/docs/XPCOM_Interface_Reference/nsIFilePicker#addToRecentDocs">nsIFilePicker.addToRecentDocs</a></code>, o qual permite indicar que o arquivo selecionado deve ser adicionado à lista de "documentos recentes" do usuário, se houver alguma. Este atributo não tem efeito no modo de navegação privativa.</li> -</ul> - -<h4 id="Novas_interfaces">Novas interfaces</h4> - -<ul> - <li>Adicionada <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/mozIAsyncFavicons" title="">mozIAsyncFavicons</a></code>.</li> - <li>Adicionada <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIEventSource" title="">nsIEventSource</a></code>.</li> - <li>Adicionada <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIGSettingsCollection" title="">nsIGSettingsCollection</a></code>.</li> - <li>Adicionada <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIGSettingsService" title="">nsIGSettingsService</a></code>.</li> - <li>Adicionada <code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIHttpUpgradeListener" title="">nsIHttpUpgradeListener</a></code>.</li> -</ul> - -<h4 id="Interfaces_removidas">Interfaces removidas</h4> - -<ul> - <li>A interface <code>nsIDOMDocumentTraversal</code> foi removida. Foi um detalhe de implementação que expirou sua utilidade.</li> - <li>A interface <code>nsIDOMDocumentRange</code> foi removida. Foi um detalhe de implementação que expirou sua utilidade.</li> - <li>A interface <code>IWeaveCrypto</code> foi removida. Foi um detalhe de implementação que expirou sua utilidade.</li> - <li>A interface <code>nsIDOM3DocumentEvent</code> foi removida. Foi um detalhe de implementação que expirou sua utilidade.</li> - <li>A interface <code>nsIDOMAbstractView</code> foi removida. Foi um detalhe de implementação que expirou sua utilidade.</li> - <li>A interface <code>nsILiveTitleNotificationSubject</code> foi removida. Foi um detalhe de implementação que expirou sua utilidade.</li> -</ul> - -<h3 id="Veja_também">Veja também</h3> - -<ul> - <li><a href="/pt/Firefox_5_para_desenvolvedores" title="pt/Firefox 5 para desenvolvedores">Firefox 5 para desenvolvedores</a></li> - <li><a href="/pt/Firefox_4_para_desenvolvedores" title="pt/Firefox 4 para desenvolvedores">Firefox 4 para desenvolvedores</a></li> - <li><a href="/pt/Firefox_3.6_para_desenvolvedores" title="pt/Firefox 3.6 para desenvolvedores">Firefox 3.6 para desenvolvedores</a></li> - <li><a class="internal" href="/Pt/Firefox_3.5_para_desenvolvedores" title="pt/Firefox 3.5 para desenvolvedores">Firefox 3.5 para desenvolvedores</a></li> - <li><a class="internal" href="/pt/Firefox_3_para_desenvolvedores" title="pt/Firefox 3 para desenvolvedores">Firefox 3 para desenvolvedores</a></li> - <li><a class="internal" href="/pt/Firefox_2_para_desenvolvedores" title="pt/Firefox 2 para desenvolvedores">Firefox 2 para desenvolvedores</a></li> - <li><a class="internal" href="/pt/Firefox_1.5_para_Desenvolvedores" title="pt/Firefox 1.5 para desenvolvedores">Firefox 1.5 para desenvolvedores</a></li> -</ul> - -<h3 id="Outras_alterações_3">Outras alterações</h3> - -<dl> - <dt><a href="/en/Mozilla/Preferences/Using_preferences_from_application_code" title="en/Preferences/Using preferences from application code">Using preferences from application code</a></dt> - <dd>A new static API is available for easily accessing preferences; this is only available to application code and can't be used by add-ons.</dd> -</dl> - -<h2 id="Consultar_também">Consultar também</h2> - -<div><div class="multiColumnList"> -<ul> -<li><a href="/pt-PT/docs/Mozilla/Firefox/Releases/5">Firefox 5 for developers</a></li><li><a href="/pt-PT/docs/Mozilla/Firefox/Releases/4">Firefox 4 for developers</a></li><li><a href="/pt-PT/docs/Mozilla/Firefox/Releases/3.6">Firefox 3.6 for developers</a></li><li><a href="/pt-PT/docs/Mozilla/Firefox/Releases/3.5">Firefox 3.5 for developers</a></li><li><a href="/pt-PT/docs/Mozilla/Firefox/Releases/3">Firefox 3 for developers</a></li><li><a href="/pt-PT/docs/Mozilla/Firefox/Releases/2">Firefox 2 for developers</a></li><li><a href="/pt-PT/docs/Mozilla/Firefox/Releases/1.5">Firefox 1.5 for developers</a></li></ul> -</div></div> diff --git a/files/pt-pt/mozilla/firefox/releases/70/index.html b/files/pt-pt/mozilla/firefox/releases/70/index.html deleted file mode 100644 index 7b67fba949..0000000000 --- a/files/pt-pt/mozilla/firefox/releases/70/index.html +++ /dev/null @@ -1,140 +0,0 @@ ---- -title: Firefox 70 para programadores -slug: Mozilla/Firefox/Releases/70 -tags: - - '70' - - Firefox - - Lançamento - - Mozilla -translation_of: Mozilla/Firefox/Releases/70 ---- -<p>{{FirefoxSidebar}}{{Draft}}</p> - -<p class="summary">Este artigo fornece informaçaõ acerca das alterações no Firefox 70 que irão afetar od programadores. O Firefox 70 é a <a href="https://www.mozilla.org/en-US/firefox/channel/desktop/#beta">versão Beta atual do Firefox</a>, e irá ser distribuida no dia <a href="https://wiki.mozilla.org/RapidRelease/Calendar#Future_branch_dates" rel="noopener">22 de outubro de 2019</a>.</p> - -<h2 id="Alterações_para_os_programadores_da_Web">Alterações para os programadores da Web</h2> - -<h3 id="Ferramentas_do_programador">Ferramentas do programador</h3> - -<ul> - <li>An icon will be displayed next to invalid or unsupported <a href="/en-US/docs/Tools/Page_Inspector/How_to/Examine_and_edit_CSS#Examine_CSS_rules">CSS rules</a> in the Rules pane of the Page Inspector ({{bug(1306054)}}).</li> -</ul> - -<h4 id="Removals">Removals</h4> - -<h3 id="HTML">HTML</h3> - -<p><em>No changes.</em></p> - -<h4 id="Removals_2"> Removals</h4> - -<h3 id="CSS">CSS</h3> - -<ul> - <li>Opacity values like for {{cssxref("opacity")}} or {{SVGAttr("stop-opacity")}} can now be percentages ({{Bug(1562086)}}).</li> - <li>{{cssxref("grid-auto-columns")}} and {{cssxref("grid-auto-rows")}} now accept multiple track-size values ({{Bug(1339672)}}).</li> - <li>A number of text-related CSS properties have been enabled by default ({{bug(1573631)}}): - <ul> - <li>{{cssxref("text-decoration-thickness")}}.</li> - <li>{{cssxref("text-underline-offset")}}.</li> - <li>{{cssxref("text-decoration-skip-ink")}}. The default value is <code>auto</code>, which means that by default underlines and overlines are now interrupted where they would otherwise cross over a {{Glossary("glyph")}}.</li> - </ul> - </li> - <li>The {{cssxref("display")}} property now accepts two keywords for the inner and the outer display type ({{Bug(1038294)}}, {{Bug(1105868)}} and {{Bug(1557825)}}).</li> - <li>The {{cssxref("font-size")}} property now accepts the new keyword <code>xxx-large</code>. ({{Bug(1553545)}}).</li> - <li>The {{cssxref(":visited")}} pseudo-class no longer matches {{htmlelement("link")}} elements, for logic and performance reasons ({{bug(1572246)}}; see <span class="F0XO1GC-mb-Z" id="t-t"><a href="https://groups.google.com/forum/#!msg/mozilla.dev.platform/1NP6oJzK6zg/ftAz_TajAAAJ">Intent to ship: Make <link> elements always unvisited</a> and </span><a href="https://github.com/w3c/csswg-drafts/issues/3817">[selectors] :link and <link></a> for more reasoning as to why).</li> - <li>We now support an <code>auto</code> value for the {{cssxref("quotes")}} property ({{bug(1421938)}}).</li> - <li>Stylesheets contained in {{htmlelement("style")}} elements are now cached for reuse, to improve performance ({{bug(1480146)}}). Note that this currently doesn't include stylesheets that contain <code>@import</code> rules.</li> - <li>The <code><ratio></code> type now accepts <code><number></code> / <code><number></code> or a single <code><number></code> as a value. ({{bug(1565562)}}).</li> -</ul> - -<h4 id="Removals_3">Removals</h4> - -<ul> - <li>Retiring support for 3-valued <position> (excluding background)({{Bug(1559276)}}). <a href="https://www.fxsitecompat.dev/en-CA/docs/2019/3-valued-css-position-is-no-longer-supported-except-for-background-position/">See site compat note</a>.</li> - <li><code>none</code> is now invalid in {{cssxref("counter")}} / {{cssxref("counters")}} — a change which makes the Level 3 spec match CSS 2.1 {{Bug(1576821)}}).</li> -</ul> - -<h3 id="SVG">SVG</h3> - -<p><em>No changes.</em></p> - -<h4 id="Removals_4">Removals</h4> - -<h3 id="JavaScript">JavaScript</h3> - -<ul> - <li>Add support for numeric separators. {{Bug(1435818)}}.</li> -</ul> - -<h4 id="Removals_5">Removals</h4> - -<h3 id="APIs">APIs</h3> - -<ul> - <li>The {{domxref("History.back","back()")}}, {{domxref("History.forward","forward()")}}, and {{domxref("History.go","go()")}} methods are now asynchronous. Add a listener to the <code>{{domxref("Document/defaultView/popstate_event", "popstate")}}</code> event to get notification that navigation has completed {{Bug(1563587)}}.</li> -</ul> - -<h4 id="Novas_APIs">Novas APIs</h4> - -<h4 id="DOM">DOM</h4> - -<ul> - <li>Add {{DOMxRef("DOMMatrix")}}, {{DOMxRef("DOMPoint")}}, etc. support in web workers ({{bug(1420580)}}).</li> -</ul> - -<h4 id="Eventos_DOM">Eventos DOM</h4> - -<h4 id="Service_workers">Service workers</h4> - -<h4 id="Media_Web_Audio_and_WebRTC">Media, Web Audio, and WebRTC</h4> - -<h4 id="Canvas_and_WebGL">Canvas and WebGL</h4> - -<ul> - <li>We now support {{domxref("CanvasRenderingContext2D.getTransform()")}}, and the newer variant of {{domxref("CanvasRenderingContext2D.setTransform()")}} that accepts a matrix object as a parameter rather than multiple parameters representing the individual components of the matrix ({{bug(928150)}}).</li> -</ul> - -<h4 id="Removals_6">Removals</h4> - -<h3 id="Segurança">Segurança</h3> - -<p><em>No changes.</em></p> - -<h4 id="Removals_7">Removals</h4> - -<h3 id="Plug-ins">Plug-ins</h3> - -<p><em>No changes.</em></p> - -<h4 id="Removals_8">Removals</h4> - -<h3 id="Outros">Outros</h3> - -<p><em>No changes.</em></p> - -<h4 id="Removals_9">Removals</h4> - -<h2 id="Alterações_para_os_programadores_de_extras_add-on">Alterações para os programadores de extras (add-on)</h2> - -<h3 id="Alterações_de_API">Alterações de API</h3> - -<p><em>Sem alterações.</em></p> - -<h4 id="Removals_10">Removals</h4> - -<h3 id="Alfetarções_de_Manifest">Alfetarções de Manifest</h3> - -<p><em>Sem alterações.</em></p> - -<h4 id="Removals_11">Removals</h4> - -<h2 id="Consultar_também">Consultar também:</h2> - -<ul> - <li><a href="https://www.fxsitecompat.com/en-CA/versions/70/">SCompatibilidade de Site para o Firefox 70</a></li> -</ul> - -<h2 id="Versões_antigas">Versões antigas</h2> - -<p>{{Firefox_for_developers(69)}}</p> diff --git a/files/pt-pt/mozilla/firefox/releases/index.html b/files/pt-pt/mozilla/firefox/releases/index.html deleted file mode 100644 index 68bc5d41e9..0000000000 --- a/files/pt-pt/mozilla/firefox/releases/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: Firefox - Notas de lançamento do programador -slug: Mozilla/Firefox/Releases -tags: - - Firefox - - Landing - - Lançamento - - Mozilla -translation_of: Mozilla/Firefox/Releases ---- -<div>{{FirefoxSidebar}}</div> - -<p>Esta página fornece hiperligações para os artigos de "Firefox X para programadores" para cada lançamento do Firefox. Estas notas deixam-no ver quais as funcionalidades que foram adicionadas e os erros eliminados em cada versão do Firefox. Tudo escrito para dar aos programadores como você a informação de que eles mais precisam. Seja bem-vindo.</p> - -<div class="multiColumnList">{{ListSubpages("",1,1,1)}}</div> - -<div class="multiColumnList"> </div> - -<p>Ufa! Isso é muito de Firefoxen!</p> - -<h2 id="Consultar_também">Consultar também</h2> - -<ul> - <li><a href="/pt-PT/docs/Mozilla/Thunderbird/Lancamentos">Thunderbird - Notas de lançamento do programador</a></li> -</ul> diff --git a/files/pt-pt/mozilla/index.html b/files/pt-pt/mozilla/index.html deleted file mode 100644 index 347e26f48e..0000000000 --- a/files/pt-pt/mozilla/index.html +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: Mozilla -slug: Mozilla -tags: - - Aplicações - - Apps - - Avançado - - Extras - - Mozilla -translation_of: Mozilla ---- -<div class="boxed translate-rendered"> -<p>Os artigos abaixo, incluem conteúdo sobre transferência e criação de código da Mozilla. Além disso, irá encontrar artigos úteis sobre como o código funciona, como criar extras para as aplicações da Mozilla, etc.</p> - -<p>{{LandingPageListSubpages}}</p> -</div> |