Habilita extensões a limpar os dados que estão acumulados enquando o usuário navega.

Na API browsingData, os dados de navegação são divididos em tipos:

  • cache do browser
  • cookies
  • downloads
  • histórico
  • armazenamento local
  • dados de plugin
  • dados de formulários salvos
  • senhas salvas

Você pode usar a função browsingData.remove() para remover qualquer combinação desses tipos. Há também funções específicas para remover cada tipo de data em particular, como por exemplo removePasswords(), removeHistory() e assim por diante.

Todas funções browsingData.remove[X]() pegam o objeto browsingData.RemovalOptions que você usa para controlar outros dois aspectos da remoção de dados:

  • quão antigos são os dados para a remoção
  • se é para remover dados de páginas normais, ou também para hospedar aplicativos web ou add-ons. Observe que esta opção ainda não é suportada no Firefox.

Finalmente, a API browsingData.settings() fornece uma função que retorna o atual valor das configurações da funcionalidade "Limpar Histórico".

Para usar esta API você deve ter a permissão de API "browsingData".

Tipos

browsingData.DataTypeSet
Objeto usado para especificar o tipo de dado para remoção: por exemplo, histórico, downloads, senhas e assim por diante.
browsingData.RemovalOptions
Objeto usado para especificar o quanto tempo para remoção de dados, e se remover dados adicionados em uma navegação web normal, por aplicativos hospedados ou por add-ons.

Methods

browsingData.remove()
Remove os dados de navegação especificado pelo seu tipo.
browsingData.removeCache()
Limpa o cache do navegador.
browsingData.removeCookies()
Remove os cookies.
browsingData.removeDownloads()
Remove a lista de arquivos baixados.
browsingData.removeFormData()
Limpa os dados de um formulário salvo.
browsingData.removeHistory()
Limpa o histórico do navegador.
browsingData.removeLocalStorage()
Limpa qualquer local storage criado por websites.
browsingData.removePasswords()
Limpa passwords salvos.
browsingData.removePluginData()
Limpa os dados associados com plugins.
browsingData.settings()
Obtém o valor atual de configuração da funcionalidade "Limpar Histórico" do navegador.

Compatibilidade de browser

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxOperaFirefox for Android
DataTypeSet.cacheChrome Full support YesEdge No support NoFirefox Full support 53Opera Full support YesFirefox Android Full support 56
DataTypeSet.cookiesChrome Full support YesEdge No support NoFirefox Full support 53Opera Full support YesFirefox Android Full support 56
DataTypeSet.downloadsChrome Full support YesEdge No support NoFirefox Full support 53Opera Full support YesFirefox Android Full support 56
DataTypeSet.fileSystemsChrome Full support YesEdge No support NoFirefox No support NoOpera Full support YesFirefox Android No support No
DataTypeSet.formDataChrome Full support YesEdge No support NoFirefox Full support 53Opera Full support YesFirefox Android Full support 56
DataTypeSet.historyChrome Full support YesEdge No support NoFirefox Full support 53Opera Full support YesFirefox Android Full support 56
DataTypeSet.indexedDBChrome Full support YesEdge No support NoFirefox Full support 57Opera Full support YesFirefox Android No support No
DataTypeSet.localStorageChrome Full support YesEdge No support NoFirefox Full support 57Opera Full support YesFirefox Android No support No
DataTypeSet.passwordsChrome Full support YesEdge No support NoFirefox Full support 53Opera Full support YesFirefox Android No support No
DataTypeSet.pluginDataChrome Full support YesEdge No support NoFirefox Full support 53Opera Full support YesFirefox Android No support No
DataTypeSet.serverBoundCertificatesChrome Full support YesEdge No support NoFirefox No support NoOpera Full support YesFirefox Android No support No
DataTypeSet.serviceWorkersChrome Full support YesEdge No support NoFirefox Full support 53Opera Full support YesFirefox Android No support No
RemovalOptions.hostnamesChrome No support NoEdge No support NoFirefox Full support 56Opera No support NoFirefox Android No support No
RemovalOptions.originTypesChrome Full support YesEdge No support NoFirefox No support NoOpera Full support YesFirefox Android No support No
RemovalOptions.sinceChrome Full support YesEdge No support NoFirefox Full support 53
Notes
Full support 53
Notes
Notes since is not supported with the following data types: cache, indexedDB, localStorage, and serviceWorkers.
Opera Full support YesFirefox Android Full support 56
Notes
Full support 56
Notes
Notes since is not supported with the following data types: cache, indexedDB, localStorage, and serviceWorkers.
removeChrome Full support YesEdge No support NoFirefox Full support 53
Notes
Full support 53
Notes
Notes Specifying dataTypes.history will also remove download history and service workers.
Opera Full support YesFirefox Android Full support 57
Notes
Full support 57
Notes
Notes Specifying dataTypes.history will also remove download history and service workers.
removeCacheChrome Full support YesEdge No support NoFirefox Full support 53
Notes
Full support 53
Notes
Notes removalOptions.since is not supported.
Opera Full support YesFirefox Android Full support 57
Notes
Full support 57
Notes
Notes removalOptions.since is not supported.
removeCookiesChrome Full support YesEdge No support NoFirefox Full support 53Opera Full support YesFirefox Android Full support 56
removeDownloadsChrome Full support YesEdge No support NoFirefox Full support 53Opera Full support YesFirefox Android Full support 57
removeFormDataChrome Full support YesEdge No support NoFirefox Full support 53Opera Full support YesFirefox Android Full support 57
removeHistoryChrome Full support YesEdge No support NoFirefox Full support 53
Notes
Full support 53
Notes
Notes This function also removes download history and service workers.
Opera Full support YesFirefox Android No support No
Notes
No support No
Notes
Notes See bug 1363010. browser.history.remove(options, {history:true}) can be used instead.
removeLocalStorageChrome Full support YesEdge No support NoFirefox Full support 57
Notes
Full support 57
Notes
Notes removalOptions.since is not supported.
Opera Full support YesFirefox Android No support No
Notes
No support No
Notes
Notes The method is defined but returns a rejected promise.
removePasswordsChrome Full support YesEdge No support NoFirefox Full support 53Opera Full support YesFirefox Android No support No
Notes
No support No
Notes
Notes See bug 1363012.
removePluginDataChrome Full support YesEdge No support NoFirefox Full support 53Opera Full support YesFirefox Android No support No
settingsChrome Full support YesEdge No support NoFirefox Full support 53Opera Full support YesFirefox Android Full support 56

Legend

Full support  
Full support
No support  
No support
See implementation notes.
See implementation notes.

Example extensions

Agradecimentos

Esta API é baseada na API chrome.browsingData do Chromium.

Os dados de compatibilidade do Microsoft Edge compatibility são fornecidos pela Microsoft Corporation e aqui estão inclusos sob a Creative Commons Attribution 3.0 United States License.

Etiquetas do documento e colaboradores

Colaboradores desta página: thiagopelizoni
Última atualização por: thiagopelizoni,