diff --git a/.version b/.version new file mode 100644 index 0000000..1fe6958 --- /dev/null +++ b/.version @@ -0,0 +1 @@ +0.0.28 diff --git a/README.md b/README.md index a069f31..b71a53d 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,9 @@ Uma extensão experimental para identificar, analisar e bloquear a execução de - [Entendendo a interface do usuário](#entendendo-a-interface-do-usu%C3%A1rio) - [Como instalar](#como-instalar) - [Experimente!](#experimente) +- [Capturas de tela](#capturas-de-tela) - [Se aprofunde no tema](#se-aprofunde-no-tema) +- [Guias](#guias) - [Como colaborar](#como-colaborar) - [Problemas conhecidos](#problemas-conhecidos) - [Entendendo o código](#entendendo-o-c%C3%B3digo) @@ -38,19 +40,18 @@ Tais ferramentas são vitais, mas inevitavelmente precisamos fazer concessões p - Chromium e Google Chorme: [Chrome Web Store](https://chrome.google.com/webstore/detail/luminous-javascript-event/baacpbikplogpeecclpnajnlghmcldkb) - Mozilla Firefox: [Fifrefox Add-ons](https://addons.mozilla.org/pt-BR/firefox/addon/luminous/) -- Opera: *aguardando revisão (Opera add-ons)* +- Opera: [Complementos do Opera](https://addons.opera.com/pt-br/extensions/details/luminous-javascript-events-blocker/) ## Experimente! -[Instale](#como-instalar) a extensão e acesse a nossa [página de demonstração](https://gbaptista.github.io/luminous/html/demo-page.html) para experimentar e entender melhor o seu funcionamento: +[Instale](#como-instalar) a extensão e acesse a nossa [página de demonstração](https://gbaptista.github.io/luminous/html/demos/detections/index.html) para experimentar e entender melhor o seu funcionamento: ![Demo Page](images/doc/pt-BR/demo-page.png) -## Se aprofunde no tema +## Capturas de tela -Este experimento faz parte de um livro que está sendo escrito de *WebExtensions API* sob a ótica de temas como liberdade e privacidade nos meios digitais. Se deseja saber novidades sobre a publicação do mesmo, deixe aqui o seu email: [https://gbaptistas.typeform.com/to/jCzkkm]( -https://gbaptistas.typeform.com/to/jCzkkm) +Veja algumas capturas de tela [aqui](./doc/pt-BR/guides/screenshots.md). -Enquanto o livro não é publicado, sugiro as seguintes referências para expandir a sua visão sobre o tema: +## Se aprofunde no tema - Documentário: [*Do Not Track*](https://donottrack-doc.com) - Livro: [*1984*](https://www.amazon.com.br/1984-George-Orwell-ebook/dp/B009XE662U) @@ -60,9 +61,14 @@ Enquanto o livro não é publicado, sugiro as seguintes referências para expand - Página na web: [*Saúde da Internet*](https://www.mozilla.org/pt-BR/internet-health/) - Página na web: [*Sobre o Lightbeam*](https://www.mozilla.org/pt-BR/lightbeam/about) +## Guias + +Guias são documentos sobre assuntos muitos específicos onde podemos ir fundo nos detalhes e encontrar facilmente as informações que estamos procurando. Veja [aqui](./doc/pt-BR/guides/) todos os guias. + ## Como colaborar - [Espalhe a ideia](#espalhe-a-ideia) + - [Escreva algum guia](#escreva-algum-guia) - [Compartilhe](#compartilhe) - [Escreva e fale sobre](#escreva-e-fale-sobre) - [Ajude na tradução para outros idiomas](#ajude-na-tradu%C3%A7%C3%A3o-para-outros-idiomas) @@ -77,6 +83,10 @@ Enquanto o livro não é publicado, sugiro as seguintes referências para expand ### Espalhe a ideia +#### Escreva algum guia + +Colabore escrevendo algum [guia](#guias) sobre assuntos relacionados ao projeto. + #### Compartilhe Conte aos seus amigos, familiares e colegas de trabalho sobre como a extensão foi utilizada para melhorar a sua experiência na web e os ensine a utilizá-la também! @@ -109,7 +119,7 @@ Não temos a interface mais bonita e amigável possível. [Discussões](https:// **Exemplo 1**: Quanto mais cedo conseguirmos injetar o código nos websites e quanto menos recursos utilizarmos para processar as informações, mais execuções seremos capazes de identificar e melhor será a nossa experiência ao ter uma extensão que não deixe a navegação lenta. -Olhe por exemplo para a nossa página de demonstração (*`html/demo-page.html`*): +Olhe por exemplo para a nossa página de demonstração (*`html/demos/detections/index.html`*): ```javascript (function() { setTimeout(function() { @@ -186,6 +196,7 @@ No *Mozilla Firefox* e derivados, alguns sites que utlizam [*Service Workers*](h - [Background](#background) - [Content](#content) - [Pop-up](#pop-up) +- [Configurações](#configurações) - [Utilidades](#utilidades) - [Bibliotecas de terceiros](#bibliotecas-de-terceiros) @@ -227,6 +238,14 @@ Responsáveis por renderizar e cuidar das interações feitas no pop-up que é a - `js/popup/popup.js` - `css/popup/popup.css` +### Configurações + +Responsáveis por renderizar e cuidar das interações feitas nas páginas de configurações: + +- `html/settings/*.html` +- `js/settings/*.js` +- `css/settings/*.css` + ### Utilidades - `js/utils/colors.js`: Função utilizada para determinar a cor exibida com base no valor do contador. @@ -234,9 +253,11 @@ Responsáveis por renderizar e cuidar das interações feitas no pop-up que é a ### Bibliotecas de terceiros -- `js/vendor/jquery`: [*jQuery JavaScript Library*](https://github.com/jquery/jquery) -- `js/vendor/mustachejs`: [*Minimal templating with {{mustaches}} in JavaScript*](https://github.com/janl/mustache.js) -- `js/vendor/tippyjs`: [*A lightweight, vanilla JS tooltip library*](https://github.com/atomiks/tippyjs) +- `vendor/bootstrap`: [*Bootstrap: biblioteca de componentes front-end +*](https://github.com/twbs/bootstrap) +- `vendor/jquery`: [*jQuery JavaScript Library*](https://github.com/jquery/jquery) +- `vendor/mustachejs`: [*Minimal templating with {{mustaches}} in JavaScript*](https://github.com/janl/mustache.js) +- `vendor/tippyjs`: [*A lightweight, vanilla JS tooltip library*](https://github.com/atomiks/tippyjs) ## Licença @@ -244,7 +265,7 @@ Este projeto está licenciado sob a [*GPLv3*](LICENSE). ## Doações -Não há nenhum tipo de organização para o recebimento de doações no momento. Veja nosso guia sobre *"[como colaborar](#como-colaborar)"* para outras maneiras de contribuição e também sobre o livro que está sendo escrito em *"[se aprofunde no tema](#se-aprofunde-no-tema)"*. Se deseja realmente realizar uma doação, eis algumas fundações incríveis que vão de encontro com os temas abordados neste projeto que você pode ajudar: +Não há nenhum tipo de organização para o recebimento de doações no momento. Veja nosso guia sobre *"[como colaborar](#como-colaborar)"* para outras maneiras de contribuição. Se deseja realmente realizar uma doação, eis algumas fundações incríveis que vão de encontro com os temas abordados neste projeto que você pode ajudar: - [*Electronic Frontier Foundation*](https://supporters.eff.org/donate) - [*Free Software Foundation*](https://www.fsf.org/about/ways-to-donate) diff --git a/_locales/en_US/messages.json b/_locales/en_US/messages.json index 7e4b1e3..19dac72 100644 --- a/_locales/en_US/messages.json +++ b/_locales/en_US/messages.json @@ -3,15 +3,112 @@ "manifestDescription": { "message": "An experimental extension to identify, analyze and block code execution and event collection through JavaScript in your browser." }, "linkHelpText": { "message": "help" }, + "linkSettingsText": { "message": "settings" }, "linkHelpHref": { "message": "https://gbaptista.github.io/luminous/doc/en-US" }, "checkboxInjectionEnabledGeneral": { "message": "all websites" }, - "checkboxShowListenerFunctions": { "message": "show intercepted code details" }, + "checkboxShowCodeDetails": { "message": "code details" }, "titleHandleEvent": { "message": "triggered events (handleEvent)" }, "titleAddEventListener": { "message": "attached events (addEventListener)" }, "titleWebAPIs": { "message": "Web APIs" }, "messageNothingDetected": { "message": "nothing detected so far" }, - "messageLoading": { "message": "loading..." } + "messageLoading": { "message": "loading..." }, + + "settingsCodeInjectionTitle": { "message": "code injection" }, + "settingsPopupTitle": { "message": "popup" }, + "settingsBadgeCounterTitle": { "message": "badge counter" }, + "settingsAdvancedTitle": { "message": "advanced" }, + "settingsStoredDataLocalTitle": { "message": "locally stored data" }, + "settingsStoredDataSyncTitle": { "message": "synced stored data" }, + "settingsReadMoreText": { "message": "read more about" }, + "settingsStorageSyncMdnHref": { "message": "https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/storage/sync" }, + "settingsStorageLocalMdnHref": { "message": "https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/storage/local" }, + "settingsClearAllButtonText": { "message": "clear all" }, + "settingsConfirmWindowText": { "message": "are you sure?" }, + "settingsStorageEmptyText": { "message": "nothing stored" }, + "settingsTabText": { "message": "tab" }, + "settingsTabClosedText": { "message": "closed" }, + "settingsResetToDefaultText": { "message": "reset to default" }, + "settingsInjectionWarningText": { "message": "any domain will have the code injected by default unless it is disabled in the list below:" }, + "settingsAddDomainButtonText": { "message": "add domain" }, + "settingsNewDomainPlaceHolderText": { "message": "new domain" }, + "settingsRemoveButtonText": { "message": "remove" }, + "settingsPopupTooltipTitle": { "message": "tooltip displayed when hovering over the intercepted code" }, + "settingsBadgeCounterSumByTitle": { "message": "how should we sum the intercepted codes?" }, + "settingsBadgeCounterSumByExecutionsLabel": { "message": "by total of interceptions" }, + "settingsBadgeCounterSumByKindLabel": { "message": "by kind of code intercepted" }, + "settingsBadgeCounterExectutionsTitle": { "message": "what code executions should be included in the sum?" }, + "settingsBadgeCounterKindsTitle": { "message": "what kind of code executions should be included in the sum?" }, + "settingsBlockPerDomainTitle": { "message": "website rules" }, + + "allowedText": { "message": "allowed" }, + "blockedText": { "message": "blocked" }, + + "settingsInvalidDomainMessage": { "message": "invalid domain" }, + "settingsInvalidKindMessage": { "message": "invalid kind (should be handleEvent, addEventListener or WebAPIs)" }, + "settingsInvalidCodeMessage": { "message": "invalid code" }, + "settingsAddRuleButtonText": { "message": "add rule" }, + "settingsSearchByDomainPlaceHolderText": { "message": "search by domain" }, + "settingsNothingFoundText": { "message": "nothing found" }, + "settingsFilterWebsitesText": { "message": "filter websites:" }, + "settingsBlockDefaultTitle": { "message": "default rules" }, + "settingsBlockDefaultRuleText": { "message": "default rule" }, + + "settingsFilterRulesText": { "message": "filter rules:" }, + "settingsSearchByCodePlaceHolderText": { "message": "search by event name" }, + + "settingsJavaScriptEventsText": { "message": "JavaScript events" }, + "settingsJavaScriptEventsHref": { "message": "https://developer.mozilla.org/en-US/docs/Web/Events" }, + + "settingsNoRulesFoundText": { "message": "no rules found" }, + "settingsRemoveDomainButtonText": { "message": "remove domain" }, + "settingsAutomaticSettingsOptionsTitle": { "message": "automatic settings" }, + + "settingsDomainDetectedTitle": { "message": "when a new website is accessed:" }, + "settingsAddDomainToCodeInjectionLabel": { "message": "add to [code injection]" }, + "settingsAddDomainToWebsiteRulesLabel": { "message": "add to [website rules]" }, + "settingsEventDetectedTitle": { "message": "when a new JavaScript event is detected:" }, + "settingsAddEventToDefaultTitle": { "message": "add to [default rules]" }, + "settingsAddEventNoneLabel": { "message": "none" }, + "settingsAddEventCommonLabel": { "message": "common" }, + "settingsAddEventAllLabel": { "message": "all" }, + "settingsAddEventAlmostAllLabel": { "message": "almost all" }, + "settingsAddEventToWebsiteTitle": { "message": "add to [website rules]" }, + + "settingsNotRecommendedText": { "message": "not recommended" }, + "settingsDefinitelyNotRecommendedText": { "message": "definitely not recommended" }, + + "settingsFilterResponseDataTitle": { "message": "use filterResponseData API (if supported)" }, + "settingsInjectionTitle": { "message": "injection" }, + "settingsReportsTitle": { "message": "reports" }, + "settingsIndexedDbMdnHref": { "message": "https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API" }, + "settingsRecordsText": { "message": "records" }, + "settingsEnableReportsGenerationText": { "message": "reports generation" }, + "settingsMostExecutedJavaScriptCodesText": { "message": "most executed JavaScript codes:" }, + "settingsDomainsMostJavaScriptCodesText": { "message": "domains that most runs JavaScript codes:" }, + "settingsFilterButtonText": { "message": "filter" }, + "settingsFilterByDomainPlaceHolderText": { "message": "filter by domain" }, + "settingsNoRecordsText": { "message": "no records found" }, + "settingsReportClearAllButtonText": { "message": "clear all records" }, + "checkboxZoomIn": { "message": "zoom in" }, + "checkboxApplyToDefault": { "message": "apply actions to default rules" }, + + "checkboxShowPerformanceMetrics": { "message": "performance metrics" }, + "sortByText": { "message": "sort by" }, + "sortByCallsText": { "message": "executions" }, + "sortByTimeText": { "message": "time spent" }, + + "settingsBackgroundPerformanceTitle": { "message": "performance" }, + + "disableText": { "message": "disable" }, + + "logsFilterInPlaceholder": { "message": "include (regular expression works!)" }, + "logsFilterOutPlaceholder": { "message": "exclude (regular expression works!)" }, + "logsFilterAllText": { "message": "all tabs" }, + "logsFilterAutoDetectText": { "message": "detect" }, + "logsStartButtonText": { "message": "start" }, + "logsStopButtonText": { "message": "stop" }, + "logsClearButtonText": { "message": "clear" } } diff --git a/_locales/es/messages.json b/_locales/es/messages.json index 1f653fa..b61d3ac 100644 --- a/_locales/es/messages.json +++ b/_locales/es/messages.json @@ -3,15 +3,112 @@ "manifestDescription": { "message": "Extensión experimental para identificar, analizar y bloquear código y eventos JavaScript en tu navegador." }, "linkHelpText": { "message": "ayuda" }, + "linkSettingsText": { "message": "ajustes" }, "linkHelpHref": { "message": "https://gbaptista.github.io/luminous/doc/es" }, "checkboxInjectionEnabledGeneral": { "message": "todas las webs" }, - "checkboxShowListenerFunctions": { "message": "mostrar detalles de código interceptado" }, + "checkboxShowCodeDetails": { "message": "detalles de código" }, "titleHandleEvent": { "message": "eventos activados (handleEvent)" }, "titleAddEventListener": { "message": "eventos ligados (addEventListener)" }, "titleWebAPIs": { "message": "Web APIs" }, "messageNothingDetected": { "message": "nada detectado de momento" }, - "messageLoading": { "message": "cargando..." } + "messageLoading": { "message": "cargando..." }, + + "settingsCodeInjectionTitle": { "message": "inyecciones de código" }, + "settingsPopupTitle": { "message": "ventana emergente" }, + "settingsBadgeCounterTitle": { "message": "contador del icono" }, + "settingsAdvancedTitle": { "message": "avanzado" }, + "settingsStoredDataLocalTitle": { "message": "datos locales" }, + "settingsStoredDataSyncTitle": { "message": "datos sincronizados" }, + "settingsReadMoreText": { "message": "lea más sobre" }, + "settingsStorageSyncMdnHref": { "message": "https://developer.mozilla.org/es/Add-ons/WebExtensions/API/storage/sync" }, + "settingsStorageLocalMdnHref": { "message": "https://developer.mozilla.org/es/Add-ons/WebExtensions/API/storage/local" }, + "settingsClearAllButtonText": { "message": "quitar todo" }, + "settingsConfirmWindowText": { "message": "estás seguro?" }, + "settingsStorageEmptyText": { "message": "nada almacenado" }, + "settingsTabText": { "message": "lengüeta" }, + "settingsTabClosedText": { "message": "cerrada" }, + "settingsResetToDefaultText": { "message": "restaurar valores predeterminados" }, + "settingsInjectionWarningText": { "message": "cualquier dominio tendrá el código inyectado a menos que esté deshabilitado en la lista siguiente:" }, + "settingsAddDomainButtonText": { "message": "agregar dominio" }, + "settingsNewDomainPlaceHolderText": { "message": "nuevo dominio" }, + "settingsRemoveButtonText": { "message": "eliminar" }, + "settingsPopupTooltipTitle": { "message": "tooltip mostrado al pasar el ratón en el código interceptado" }, + "settingsBadgeCounterSumByTitle": { "message": "¿cómo debemos sumar los códigos interceptados?" }, + "settingsBadgeCounterSumByExecutionsLabel": { "message": "por el total de ejecuciones" }, + "settingsBadgeCounterSumByKindLabel": { "message": "por el tipo de código interceptado" }, + "settingsBadgeCounterExectutionsTitle": { "message": "¿qué tipos de ejecuciones deben incluirse en la suma?" }, + "settingsBadgeCounterKindsTitle": { "message": "¿qué tipo de código interceptado se debe incluir en la suma?" }, + "settingsBlockPerDomainTitle": { "message": "reglas por sitio web" }, + + "allowedText": { "message": "permitido" }, + "blockedText": { "message": "bloqueado" }, + + "settingsInvalidDomainMessage": { "message": "dominio no válido" }, + "settingsInvalidKindMessage": { "message": "tipo no válido (debe ser handleEvent, addEventListener o WebAPIs)" }, + "settingsInvalidCodeMessage": { "message": "código no válido" }, + "settingsAddRuleButtonText": { "message": "agregar regla" }, + "settingsSearchByDomainPlaceHolderText": { "message": "buscar por dominio" }, + "settingsNothingFoundText": { "message": "nada encontrado" }, + "settingsFilterWebsitesText": { "message": "filtrar sitios web:" }, + "settingsBlockDefaultTitle": { "message": "reglas estándar" }, + "settingsBlockDefaultRuleText": { "message": "regla estándar" }, + + "settingsFilterRulesText": { "message": "filtrar reglas:" }, + "settingsSearchByCodePlaceHolderText": { "message": "buscar el nombre del evento" }, + + "settingsJavaScriptEventsText": { "message": "eventos JavaScript" }, + "settingsJavaScriptEventsHref": { "message": "https://developer.mozilla.org/es/docs/Web/Events" }, + + "settingsNoRulesFoundText": { "message": "ninguna regla encontrada" }, + "settingsRemoveDomainButtonText": { "message": "eliminar dominio" }, + "settingsAutomaticSettingsOptionsTitle": { "message": "configuraciones automáticas" }, + + "settingsDomainDetectedTitle": { "message": "cuando se accede a un nuevo sitio:" }, + "settingsAddDomainToCodeInjectionLabel": { "message": "añadir en [inyecciones de código]" }, + "settingsAddDomainToWebsiteRulesLabel": { "message": "añadir en [reglas por sitio web]" }, + "settingsEventDetectedTitle": { "message": "cuando se detecta un nuevo evento JavaScript:" }, + "settingsAddEventToDefaultTitle": { "message": "añadir en [reglas estándar]" }, + "settingsAddEventNoneLabel": { "message": "ningúno" }, + "settingsAddEventCommonLabel": { "message": "comunes" }, + "settingsAddEventAllLabel": { "message": "todos" }, + "settingsAddEventAlmostAllLabel": { "message": "casi todos" }, + "settingsAddEventToWebsiteTitle": { "message": "añadir en [reglas por sitio web]" }, + + "settingsNotRecommendedText": { "message": "no recomendado" }, + "settingsDefinitelyNotRecommendedText": { "message": "definitivamente no recomendado" }, + + "settingsFilterResponseDataTitle": { "message": "use la API filterResponseData (si es compatible)" }, + "settingsInjectionTitle": { "message": "inyección" }, + "settingsReportsTitle": { "message": "informes" }, + "settingsIndexedDbMdnHref": { "message": "https://developer.mozilla.org/es/docs/Web/API/IndexedDB_API" }, + "settingsRecordsText": { "message": "registros" }, + "settingsEnableReportsGenerationText": { "message": "generación de informes" }, + "settingsMostExecutedJavaScriptCodesText": { "message": "códigos JavaScript más ejecutados:" }, + "settingsDomainsMostJavaScriptCodesText": { "message": "los dominios que más ejecutan los códigos JavaScript:" }, + "settingsFilterButtonText": { "message": "filtrar" }, + "settingsFilterByDomainPlaceHolderText": { "message": "filtrar por dominio" }, + "settingsNoRecordsText": { "message": "ningún registro encontrado" }, + "settingsReportClearAllButtonText": { "message": "limpiar todos los registros" }, + "checkboxZoomIn": { "message": "acercarse" }, + "checkboxApplyToDefault": { "message": "aplicar a las reglas estándar" }, + + "checkboxShowPerformanceMetrics": { "message": "métricas de rendimiento" }, + "sortByText": { "message": "ordenar por" }, + "sortByCallsText": { "message": "ejecuciones" }, + "sortByTimeText": { "message": "tiempo" }, + + "settingsBackgroundPerformanceTitle": { "message": "desempeño" }, + + "disableText": { "message": "desactivar" }, + + "logsFilterInPlaceholder": { "message": "incluir (¡expresión regular funciona!)" }, + "logsFilterOutPlaceholder": { "message": "borrar (¡expresión regular funciona!)" }, + "logsFilterAllText": { "message": "todas las lengüetas" }, + "logsFilterAutoDetectText": { "message": "detectar" }, + "logsStartButtonText": { "message": "comenzar" }, + "logsStopButtonText": { "message": "detener" }, + "logsClearButtonText": { "message": "limpiar" } } diff --git a/_locales/pt_BR/messages.json b/_locales/pt_BR/messages.json index d79a0f5..2b398fd 100644 --- a/_locales/pt_BR/messages.json +++ b/_locales/pt_BR/messages.json @@ -3,15 +3,112 @@ "manifestDescription": { "message": "Uma extensão experimental para identificar, analisar e bloquear a execução de códigos e a coleta de eventos via JavaScript em seu navegador." }, "linkHelpText": { "message": "ajuda" }, + "linkSettingsText": { "message": "configurações" }, "linkHelpHref": { "message": "https://gbaptista.github.io/luminous" }, "checkboxInjectionEnabledGeneral": { "message": "todos os sites" }, - "checkboxShowListenerFunctions": { "message": "mostrar detalhes do código interceptado" }, + "checkboxShowCodeDetails": { "message": "detalhes do código" }, "titleHandleEvent": { "message": "eventos disparados (handleEvent)" }, "titleAddEventListener": { "message": "eventos adicionados (addEventListener)" }, "titleWebAPIs": { "message": "APIs Web" }, "messageNothingDetected": { "message": "nada foi detectado até o momento" }, - "messageLoading": { "message": "carregando..." } + "messageLoading": { "message": "carregando..." }, + + "settingsCodeInjectionTitle": { "message": "injeção de códigos" }, + "settingsPopupTitle": { "message": "popup" }, + "settingsBadgeCounterTitle": { "message": "contador do ícone" }, + "settingsAdvancedTitle": { "message": "avançado" }, + "settingsStoredDataLocalTitle": { "message": "dados locais" }, + "settingsStoredDataSyncTitle": { "message": "dados sincronizados" }, + "settingsReadMoreText": { "message": "leia mais sobre" }, + "settingsStorageSyncMdnHref": { "message": "https://developer.mozilla.org/pt-BR/Add-ons/WebExtensions/API/storage/sync" }, + "settingsStorageLocalMdnHref": { "message": "https://developer.mozilla.org/pt-BR/Add-ons/WebExtensions/API/storage/local" }, + "settingsClearAllButtonText": { "message": "remover tudo" }, + "settingsConfirmWindowText": { "message": "você tem certeza?" }, + "settingsStorageEmptyText": { "message": "nada armazenado" }, + "settingsTabText": { "message": "aba" }, + "settingsTabClosedText": { "message": "fechada" }, + "settingsResetToDefaultText": { "message": "restaurar configurações padrões" }, + "settingsInjectionWarningText": { "message": "qualquer domínio terá o código injetado a não ser que esteja desabilitado na lista abaixo:" }, + "settingsAddDomainButtonText": { "message": "adicionar domínio" }, + "settingsNewDomainPlaceHolderText": { "message": "novo domínio" }, + "settingsRemoveButtonText": { "message": "remover" }, + "settingsPopupTooltipTitle": { "message": "tooltip mostrada ao passar o mouse no código interceptado" }, + "settingsBadgeCounterSumByTitle": { "message": "como devemos somar os códigos interceptados?" }, + "settingsBadgeCounterSumByExecutionsLabel": { "message": "pelo total de execuções" }, + "settingsBadgeCounterSumByKindLabel": { "message": "pelo tipo de código interceptado" }, + "settingsBadgeCounterExectutionsTitle": { "message": "quais tipos de execuções devem ser incluídas na soma?" }, + "settingsBadgeCounterKindsTitle": { "message": "qual tipo de código interceptado deve ser incluído na soma?" }, + "settingsBlockPerDomainTitle": { "message": "regras por site" }, + + "allowedText": { "message": "permitido" }, + "blockedText": { "message": "bloqueado" }, + + "settingsInvalidDomainMessage": { "message": "domínio inválido" }, + "settingsInvalidKindMessage": { "message": "tipo inválido (precisa ser handleEvent, addEventListener ou WebAPIs)" }, + "settingsInvalidCodeMessage": { "message": "código inválido" }, + "settingsAddRuleButtonText": { "message": "adicionar regra" }, + "settingsSearchByDomainPlaceHolderText": { "message": "buscar por domínio" }, + "settingsNothingFoundText": { "message": "nada encontrado" }, + "settingsFilterWebsitesText": { "message": "filtrar websites:" }, + "settingsBlockDefaultTitle": { "message": "regras padrões" }, + "settingsBlockDefaultRuleText": { "message": "regra padrão" }, + + "settingsFilterRulesText": { "message": "filtrar regras:" }, + "settingsSearchByCodePlaceHolderText": { "message": "busque pelo nome do evento" }, + + "settingsJavaScriptEventsText": { "message": "eventos JavaScript" }, + "settingsJavaScriptEventsHref": { "message": "https://developer.mozilla.org/pt-BR/docs/Web/Events" }, + + "settingsNoRulesFoundText": { "message": "nenhuma regra encontrada" }, + "settingsRemoveDomainButtonText": { "message": "remover domínio" }, + "settingsAutomaticSettingsOptionsTitle": { "message": "configurações automáticas" }, + + "settingsDomainDetectedTitle": { "message": "quando um novo site for acessado:" }, + "settingsAddDomainToCodeInjectionLabel": { "message": "adicionar em [injeção de códigos]" }, + "settingsAddDomainToWebsiteRulesLabel": { "message": "adicionar em [regras por site]" }, + "settingsEventDetectedTitle": { "message": "quando um novo evento JavaScript for detectado:" }, + "settingsAddEventToDefaultTitle": { "message": "adicionar em [regras padrões]" }, + "settingsAddEventNoneLabel": { "message": "nenhum" }, + "settingsAddEventCommonLabel": { "message": "comuns" }, + "settingsAddEventAllLabel": { "message": "todos" }, + "settingsAddEventAlmostAllLabel": { "message": "quase todos" }, + "settingsAddEventToWebsiteTitle": { "message": "adicionar em [regras por site]" }, + + "settingsNotRecommendedText": { "message": "não recomendado" }, + "settingsDefinitelyNotRecommendedText": { "message": "definitivamente não recomendado" }, + + "settingsFilterResponseDataTitle": { "message": "utilizar a API filterResponseData (se suportada)" }, + "settingsInjectionTitle": { "message": "injeção" }, + "settingsReportsTitle": { "message": "relatórios" }, + "settingsIndexedDbMdnHref": { "message": "https://developer.mozilla.org/pt-BR/docs/Web/API/IndexedDB_API" }, + "settingsRecordsText": { "message": "registros" }, + "settingsEnableReportsGenerationText": { "message": "geração de relatórios" }, + "settingsMostExecutedJavaScriptCodesText": { "message": "códigos JavaScript mais executados:" }, + "settingsDomainsMostJavaScriptCodesText": { "message": "domínios que mais executam códigos JavaScript:" }, + "settingsFilterButtonText": { "message": "filtrar" }, + "settingsFilterByDomainPlaceHolderText": { "message": "filtrar por domínio" }, + "settingsNoRecordsText": { "message": "nenhum registro encontrado" }, + "settingsReportClearAllButtonText": { "message": "limpar todos os registros" }, + "checkboxZoomIn": { "message": "aumentar zoom" }, + "checkboxApplyToDefault": { "message": "aplicar ações às regras padrões" }, + + "checkboxShowPerformanceMetrics": { "message": "métricas de desempenho" }, + "sortByText": { "message": "ordenar por" }, + "sortByCallsText": { "message": "execuções" }, + "sortByTimeText": { "message": "tempo gasto" }, + + "settingsBackgroundPerformanceTitle": { "message": "desempenho" }, + + "disableText": { "message": "desabilitar" }, + + "logsFilterInPlaceholder": { "message": "incluir (expressão regular funciona!)" }, + "logsFilterOutPlaceholder": { "message": "excluir (expressão regular funciona!)" }, + "logsFilterAllText": { "message": "todas as abas" }, + "logsFilterAutoDetectText": { "message": "detectar" }, + "logsStartButtonText": { "message": "iniciar" }, + "logsStopButtonText": { "message": "parar" }, + "logsClearButtonText": { "message": "limpar" } } diff --git a/builds/README.md b/builds/README.md index be057ad..a422312 100644 --- a/builds/README.md +++ b/builds/README.md @@ -2,75 +2,74 @@ ## Build Instructions -Update the version on `manifest.json`: -```json -"version": "0.0.4" -``` +### Requirements + +Basic *Unix* tools: -Copy all folders and files to the `builds/current/` directory. +- `bash` +- `grep` `sed` `xargs` +- `cp` `mkdir` `mv` `rm` +- `cat` `find` `ls` +- `echo` `printf` +- `zip` -Remove those files and directories: +[*yarn*](https://yarnpkg.com): ``` -├ builds/current/ -│ ├ builds/ -│ ├ _config.yml -│ ├ .git/ -│ ├ images/inkscape-files/ -│ ├ images/krita-files/ -│ └ images/stores/ +sudo apt-get install yarn ``` -Install [*UglifyJS*](https://github.com/mishoo/UglifyJS): -```shell -npm install uglify-js -g +``` +sudo pacman -S yarn zip ``` -Compress the `builds/current/js/content/interceptor.js` code: +[*UglifyJS*](https://github.com/mishoo/UglifyJS): ```shell -uglifyjs -c -m -- builds/current/js/content/interceptor.js +yarn global add uglify-js ``` -Change the `builds/current/js/content/injections/interceptor.js` content from: +Add ti your `~/.bash_profile`: +``` +export PATH="$PATH:$(yarn global bin)" +``` -```javascript -injections_controller(function() { +### Generating a new build - var load_interceptor = function(callback_function) { - var request = new XMLHttpRequest(); +Generate current build: +```bash +bash builds/generate.sh +``` - request.onreadystatechange = function() { - if (request.readyState == XMLHttpRequest.DONE && request.status == 200) { - callback_function(request.responseText); - } - } - request.open('GET', chrome.extension.getURL('js/content/interceptor.js'), true); - request.send(null); - } +Generate current build with a new version: +```bash +bash builds/generate.sh 0.0.2 +``` - load_interceptor(function(content) { - var javascript_injection = document.createElement('script'); - javascript_injection.type = 'text/javascript'; - javascript_injection.setAttribute('nonce', '3b34aae43a'); - javascript_injection.innerHTML = content; - document.documentElement.insertBefore(javascript_injection, document.documentElement.firstChild); - }); +Generate current build with a new version from some specific version: +```bash +bash builds/generate.sh 0.0.2 0.0.1 +``` -}); +Expected output: ``` +------------------------------------------- -To: -```javascript -injections_controller(function() { + Bulding Luminous 0.0.2 (from 0.0.1): - var content = 'UGLIFYJS_RESULT'; + - Removing old build folder... 🗸 + - Creating an new empty build folder... 🗸 + - Copying all files... 🗸 + - Updating version... 🗸 + - Generating js/content/interceptor.js... 🗸 + - Minifying js/content/interceptor.js with uglifyjs... 🗸 + - Generating content variable with minified JavaScript... 🗸 + - Rearranging js/utils/injections/interceptor.js file... 🗸 + - Removing unused files... 🗸 + - Removing web_accessible_resources from manifest.json... 🗸 + - Creating 0-0-2.zip... 🗸 - var javascript_injection = document.createElement('script'); - javascript_injection.type = 'text/javascript'; - javascript_injection.setAttribute('nonce', '3b34aae43a'); - javascript_injection.innerHTML = content; - document.documentElement.insertBefore(javascript_injection, document.documentElement.firstChild); + Finished! -}); +------------------------------------------- ``` Test the current build at least in these 4 browsers: @@ -80,4 +79,25 @@ Test the current build at least in these 4 browsers: - *Mozilla Firefox* - *Opera* -Compress the `builds/current/` content to a *.zip* file with the version: `0-0-4.zip` and contact the repository owner to publish in all stores. +Run the cleanup tool: + +```shell +bash builds/cleanup.sh +``` + +Expected output: + +``` +------------------------------------------- + +Note for reviewers: + +The non-minified version for the code in "js/utils/injections/interceptor.js" is available at: + + - https://github.com/gbaptista/luminous/blob/0.0.2/js/content/interceptor.js + - https://github.com/gbaptista/luminous/blob/0.0.2/js/content/interceptors/ + +------------------------------------------- +``` + +Contact some repository owner to publish in all stores. diff --git a/builds/cleanup.sh b/builds/cleanup.sh new file mode 100644 index 0000000..9270fc9 --- /dev/null +++ b/builds/cleanup.sh @@ -0,0 +1,14 @@ +ls builds/current | grep -v .zip | xargs -I PATH rm -rf "builds/current/PATH" + +BUILD_VERSION=$(cat .version) + +printf "\n-------------------------------------------\n\n" + +printf 'Note for reviewers:\n\n' +printf 'The non-minified version for the code in ' +printf '"js/utils/injections/interceptor.js"' +printf ' is available at: \n\n' +printf " - https://github.com/gbaptista/luminous/blob/$BUILD_VERSION/js/content/interceptor.js\n" +printf " - https://github.com/gbaptista/luminous/blob/$BUILD_VERSION/js/content/interceptors/" + +printf "\n\n-------------------------------------------\n\n" diff --git a/builds/current/0-0-28.zip b/builds/current/0-0-28.zip new file mode 100644 index 0000000..b0daada Binary files /dev/null and b/builds/current/0-0-28.zip differ diff --git a/builds/current/0-0-4.zip b/builds/current/0-0-4.zip deleted file mode 100644 index 8869797..0000000 Binary files a/builds/current/0-0-4.zip and /dev/null differ diff --git a/builds/generate.sh b/builds/generate.sh new file mode 100644 index 0000000..3384399 --- /dev/null +++ b/builds/generate.sh @@ -0,0 +1,151 @@ +TO=$1 +FROM=$2 + +if [[ -z "$TO" ]]; then + TO=$(cat .version) +fi + +if [[ -z "$FROM" ]]; then + FROM=$(cat .version) +fi + +printf "\n-------------------------------------------\n\n" + +if [ $FROM != $TO ]; then + printf " Bulding Luminous $TO (from $FROM):\n\n" +else + printf " Bulding Luminous $TO:\n\n" +fi + +FROM_T="${FROM/./-}" +FROM_T="${FROM_T/./-}" + +TO_T="${TO/./-}" +TO_T="${TO_T/./-}" + + +printf " - Removing old build folder..." + +rm -rf builds/current + +printf " 🗸\n" + +printf " - Creating an new empty build folder..." + +mkdir builds/current + +printf " 🗸\n" + +printf " - Copying all files..." + +ls | grep -v build | xargs -I % cp -r % builds/current + +printf " 🗸\n" + +printf " - Updating version..." + +find . -type f \ + | grep -v vendor \ + | grep '.js\|.css\|.md\|.html\|.version' \ + | xargs sed -i "s/$FROM/$TO/g" + +find . -type f \ + | grep -v vendor \ + | grep '.js\|.css\|.md\|.html\|.version' \ + | xargs sed -i "s/$FROM_T/$TO_T/g" + +printf " 🗸\n" + +printf " - Generating js/content/interceptor.js..." + +find builds/current/js/content/interceptors -type f \ + | while read PATH + do { + SHORT_PATH="// ${PATH/builds\/current\/js\/content\//}" + SHORT_PATH="${SHORT_PATH//\//\\\\\/}" + + echo "/$SHORT_PATH/{r $PATH" + } + done \ + | xargs -I SED_COMMAND \ + sed -i -e SED_COMMAND -e 'd}' \ + builds/current/js/content/interceptor.js + +printf " 🗸\n" + +printf " - Minifying js/content/interceptor.js with uglifyjs..." + +uglifyjs -c -m \ + -o builds/current/js/content/minified_interceptor.js \ + -- builds/current/js/content/interceptor.js + +printf " 🗸\n" + +printf " - Generating content variable with minified JavaScript..." + +printf " var content = '" > builds/current/js/content/minified_variable.js +cat builds/current/js/content/minified_interceptor.js >> builds/current/js/content/minified_variable.js +printf "';" >> builds/current/js/content/minified_variable.js +echo "" >> builds/current/js/content/minified_variable.js + +sed -i \ + -e '/UGLIFYJS_RESULT/{r builds/current/js/content/minified_variable.js' \ + -e 'd}' \ + builds/current/js/utils/injections/interceptor_build.js + +printf " 🗸\n" + +printf " - Rearranging js/utils/injections/interceptor.js file..." + +rm builds/current/js/utils/injections/interceptor.js + +mv builds/current/js/utils/injections/interceptor_build.js \ + builds/current/js/utils/injections/interceptor.js + +printf " 🗸\n" + +printf " - Removing unused files..." + +rm builds/current/js/content/minified_variable.js +rm builds/current/js/content/minified_interceptor.js + +rm -rf builds/current/doc + +rm -rf builds/current/html/demos + +rm -rf builds/current/images/doc +rm -rf builds/current/images/inkscape-files +rm -rf builds/current/images/krita-files +rm -rf builds/current/images/stores + +rm -rf builds/current/js/content/interceptors +rm builds/current/js/content/interceptor.js + +rm builds/current/_config.yml +rm builds/current/README.md + +printf " 🗸\n" + +printf " - Removing web_accessible_resources from manifest.json..." + +cp builds/current/manifest.json \ + builds/current/manifest.json.tmp + +cat builds/current/manifest.json.tmp \ + | tr "\n" "~" \ + | sed -e 's/,~ "web_accessible_resources.*\]//' \ + | tr "~" "\n" > builds/current/manifest.json + +rm builds/current/manifest.json.tmp + +printf " 🗸\n" + +printf " - Creating $TO_T.zip..." + +cd builds/current/ && zip -r "$TO_T.zip" * > /dev/null + +printf " 🗸\n" + +printf "\n Finished!\n" + +printf "\n-------------------------------------------\n\n" diff --git a/builds/test/local_web_server.sh b/builds/test/local_web_server.sh new file mode 100644 index 0000000..4ff9ee0 --- /dev/null +++ b/builds/test/local_web_server.sh @@ -0,0 +1 @@ +ruby -rwebrick -e'WEBrick::HTTPServer.new(:Port => 3000, :DocumentRoot => Dir.pwd).start' diff --git a/builds/test/performance_monitor.rb b/builds/test/performance_monitor.rb new file mode 100644 index 0000000..75b5adf --- /dev/null +++ b/builds/test/performance_monitor.rb @@ -0,0 +1,59 @@ +def memory_and_cpu_for(grep) + [ + 'ps aux', + 'grep -v grep', + "grep '#{grep}'", + "awk '{print $2}'", + 'xargs -I % pstree -p %', + "grep -o '([0-9]\\+)'", + "grep -o '[0-9]\\+'", + 'xargs ps -o %mem,%cpu,cmd -p', + "awk '{memory+=$1;cpu+=$2} END {print memory,cpu}'" + ].join(' | ') +end + +def installed_mb_memory + `free -m | grep Mem | awk '{print $2}'`.to_i +end +@app_A = 'lum-prev' +@app_B = 'lum-next' +@memory = installed_mb_memory +@monitor_A = memory_and_cpu_for(@app_A) +@monitor_B = memory_and_cpu_for(@app_B) + +def print_current_stats(app, monitor) + mem_pct, cpu_pct = `#{monitor}`.split(' ').map(&:to_f) + mem_mb = '%4.5s' % ((mem_pct/100) * @memory).to_i.to_s + + mem_pct_str = '%5.4s' % mem_pct + cpu_pct_str = '%5.4s' % cpu_pct + + bar_size = 15 + + mem_pct_bar = ('█' * ((mem_pct/100) * bar_size).ceil) + mem_spaces = (bar_size - mem_pct_bar.size) + if mem_spaces < 0 + mem_spaces = 0 + end + mem_pct_bar = mem_pct_bar + (' ' * mem_spaces) + + cpu_pct_bar = ('█' * ((cpu_pct/100) * bar_size).ceil) + cpu_spaces = (bar_size - cpu_pct_bar.size) + if cpu_spaces < 0 + cpu_spaces = 0 + end + cpu_pct_bar = cpu_pct_bar + (' ' * cpu_spaces) + + "#{app} | RAM: #{mem_mb} MB #{mem_pct_bar} | CPU: #{cpu_pct_str}% #{cpu_pct_bar}" +end + +def print_compare + '| ' + print_current_stats(@app_A, @monitor_A) + ' | ' + print_current_stats(@app_B, @monitor_B) + ' |' +end + +while true do + begin + puts print_compare + rescue => _ + end +end diff --git a/builds/test/start.sh b/builds/test/start.sh new file mode 100644 index 0000000..c674761 --- /dev/null +++ b/builds/test/start.sh @@ -0,0 +1,4 @@ +ps aux | grep 'firefox' | awk '{print $2}' | xargs -I % kill -9 % + +firefox-trunk -P lum-prev & +firefox-trunk -P lum-next & diff --git a/css/devtools/logs.css b/css/devtools/logs.css new file mode 100644 index 0000000..8c76515 --- /dev/null +++ b/css/devtools/logs.css @@ -0,0 +1,87 @@ +html, body { + font-family: 'Open Sans', arial, sans-serif; + text-rendering: optimizeLegibility; +} + +* { + font-size: 11px; +} + +button, select { + margin: 6px 0 0 1%; +} + +select { + width: 98%; + margin:6px 1% 0 1%; + padding:0 1%; +} + +td.count { + width: 1px; + text-align: right; +} +td.time { + width: 1px; + white-space: nowrap; + text-align: right; +} + +.filters { display: inline-block; } + +#filter_in, #filter_out { + width: 98%; + margin:6px 1% 0 1%; + padding:0 1%; +} + +#filter_in { + border-left:4px solid #20b203; +} + +#filter_out { + border-left:4px solid #ea1004; +} + +#form { + height: 91px; +} + +#table-area { + padding-top: 91px; +} + +#form.multitab { + height: 119px; +} + +#table-area.multitab { + padding-top: 119px; +} + +#form { + position: fixed; + z-index: 2; + top: 0; + width: 100%; + border-bottom: 6px solid #CCC; +} + +#table-area { + position: fixed; + bottom:0; + height: 100%; + width: 100%; + margin-top: -5px; + z-index: 1; +} + +.table-container { + height: 100%; + width: 100%; + overflow: auto; +} + +table.table { + margin-bottom: 0; +} diff --git a/css/popup/popup.css b/css/popup/popup.css index 1556eeb..b95fb25 100644 --- a/css/popup/popup.css +++ b/css/popup/popup.css @@ -4,10 +4,7 @@ html, body { margin: 0; padding: 0; overflow-x: hidden; -} - -h2 { - font-size: 11px; + background-color: #FFF; } #loading { @@ -17,7 +14,6 @@ h2 { width: 100%; height: 100%; background-color:#FFF; - vertical-align: center; padding-top: 76px; display:none; color: #CCC; @@ -27,19 +23,19 @@ h2 { font-style: italic; } -#help-link { +.top-link { display: inline-block; float: right; - padding: 10px; + padding: 5px 10px; + margin: 5px 0; + border-right: 1px solid #DDD; } #version { float: right; display: inline-block; - padding: 5px 10px; - margin: 5px; + padding: 10px; color: #CCC; - border-left: 1px solid #DDD; } .interceptions { @@ -48,11 +44,8 @@ h2 { } .interceptions .calls { - font-size: 9px; position: relative; margin: 0 2px 12px; - width: 120px; - padding: 6px 4px 14px 4px; background-color:#e0e0e0; color: #333; display: inline-block; @@ -90,6 +83,24 @@ h2 { color: #FFF; } +.interceptions .calls .execution_time { + position: absolute; + bottom:-5px; + left: 50%; + margin-left: -20px; + width: 40px; + padding: 2px 0; + text-align: center; + background-color: #8D8E87; + color: #FFF; + font-style: italic; +} + +.zoom-in .interceptions .calls .execution_time { + margin-left: -29px; + width: 58px; +} + .interceptions .calls .allowed { border-left:4px solid #20b203; left: 10px; @@ -114,7 +125,6 @@ h2 { background-color: #FFF; color:#666; border: 1px solid #CCC; - font-size: 11px; text-align: left; } @@ -129,6 +139,99 @@ h2 { } .tippy-tooltip.js-sample-theme pre code { - font-size: 10px; white-space: normal; } + +.options-form { + padding:4px 4px 0 8px; +} + +.options-form label { + padding-bottom: 2px; +} + +.col-1 { + float: left; +} + +.col-2 { + text-align: right; + float: right; + width: 256px; +} + +.col-2-header { + width: 300px; +} + +.col-1 label, .col-1 label input { + float: left; +} + +.col-2 label, .col-2 label input { + float: right; +} +.col-2 label { + margin-right: 7px; +} + +label.invalid-domain { + color: #CCC; +} + +label.valid-domain { + max-width: 270px; + overflow: hidden; + white-space: nowrap; +} + +.general-injection-label { + margin-top: 12px; + margin-bottom: 2px; +} + +.zoom-in .general-injection-label { + margin-bottom: 3px; +} + +.clear-floats { + clear: both; +} + +h2 { + font-size: 11px; + border-bottom: 1px solid #CCC; + padding-bottom: 2px; +} + +.interceptions .calls { + font-size: 9px; + width: 120px; + padding: 6px 4px 14px 4px; +} + +.tippy-tooltip.js-sample-theme { font-size: 11px; } + +.tippy-tooltip.js-sample-theme pre code { font-size: 10px; } + +body { font-size: 16px; min-width: 540px; } + +body.zoom-in { font-size: 17px; } + +.zoom-in h2 { + font-size: 14px; + border-bottom: 2px solid #CCC; + padding-bottom: 3px; +} + +.zoom-in .tippy-tooltip.js-sample-theme { + font-size: 14px; +} + +.zoom-in .tippy-tooltip.js-sample-theme pre code { font-size: 13px; } + +.zoom-in .interceptions .calls { + font-size: 12px; + width: 164px; + padding: 8px 4px 16px 4px; +} diff --git a/css/settings/settings.css b/css/settings/settings.css new file mode 100644 index 0000000..a8f3b52 --- /dev/null +++ b/css/settings/settings.css @@ -0,0 +1,133 @@ +html, body { + font-family: 'Open Sans', arial, sans-serif; + text-rendering: optimizeLegibility; +} + +.clear { + clear: both; +} + +body { + padding-top: 20px; +} + +.bold { + font-weight: bold; +} + +.alert { + font-style: italic; +} + +.executions-card-body { + padding-bottom: 0; +} + +.form-data-collection { + display: inline-block; +} + +.rules-info { + margin-bottom: 22px; +} + +.remove-domain-rules { + margin-left: 10px; +} + +.add-rule-button { + border-top-right-radius: .25rem!important; + border-bottom-right-radius: .25rem!important; +} + +.nothing-found-injection { + margin-bottom: 24px; +} + +.no-records { + padding: 10px; + text-align: center; + color: #CCC; +} + +.nothing-found { + padding-top: 30px; + display: none; + text-align: center; + color: #CCC; +} + +.storage-empty { + text-align: center; + color: #CCC; + padding: 30px; +} + +.no-rules-search { + display: none; +} + +.no-rules { + text-align: center; + color:#CCC; + padding: 10px; +} + +.domain-card { + margin-bottom: 22px; +} + +.general-injection { + padding-top: 0.5em; +} + +.remove-code { + padding: 0 4px; + font-size: 11px +} + +.remove-code, .toggle-code { + margin-left: 10px; +} + +.remove-domain { + margin-right: 20px; + margin-bottom: 5px; + padding: 0 4px; + font-size: 11px; +} + +.settings-content { + padding-top: 30px; +} +.tabs pre { + max-height: 300px; +} +pre, code { + margin-bottom: 0; +} +pre { + padding: 10px; + overflow: auto; + color: #586e75; + background: #eee8d5; +} + +pre code { + white-space:pre-wrap; +} + +#loading { + position: fixed; + padding-top: 100px; + top:0; + left:0; + width: 100%; + height: 100%; + background-color:#FFF; + color: #CCC; + text-align: center; + z-index: 999; + opacity: 0.95; + font-style: italic; +} diff --git a/doc/en-US/README.md b/doc/en-US/README.md index f25ca1b..b29a9c7 100644 --- a/doc/en-US/README.md +++ b/doc/en-US/README.md @@ -10,7 +10,9 @@ An experimental extension to identify, analyze and block code execution and even - [Understanding the UI](#understanding-the-ui) - [How to install](#how-to-install) - [Try it!](#try-it) +- [Screenshots](#screenshots) - [Going deeper](#going-deeper) +- [Guides](#guides) - [How to contribute](#how-to-contribute) - [Known issues](#known-issues) - [Understanding the code](#understanding-the-code) @@ -19,7 +21,7 @@ An experimental extension to identify, analyze and block code execution and even ## Why? -We have amazing projects like [*Lightbeam*](https://www.mozilla.org/en-US/lightbeam/), [*NoScript*](https://noscript.net/), [*ScriptSafe*](https://github.com/andryou/scriptsafe), [*uBlock Origin*](https://github.com/gorhill/uBlock), [*HTTPS Everywhere*](https://github.com/EFForg/https-everywhere) and many others. All have the proposal to identify and/ or prevent the execution of questionable codes and requests. +We have amazing projects like [*Lightbeam*](https://www.mozilla.org/lightbeam/), [*NoScript*](https://noscript.net/), [*ScriptSafe*](https://github.com/andryou/scriptsafe), [*uBlock Origin*](https://github.com/gorhill/uBlock), [*HTTPS Everywhere*](https://github.com/EFForg/https-everywhere) and many others. All have the proposal to identify and/ or prevent the execution of questionable codes and requests. These tools are vital, but we inevitably need to make concessions to access many websites as we have a massive use of *JavaScript* on the web. When you access for example the [*Google Translate*](https://translate.google.com) website, with a combo of 3 extensions (*HTTPS Everywhere*, *uBlock Origin* and *ScriptSafe*) and *Luminous*, we have the following result after a few moments: @@ -39,33 +41,38 @@ It's about this number (**7,6 thousand**) that we are lost and with hands tied, ## How to install -- Chromium e Google Chorme: [Chrome Web Store](https://chrome.google.com/webstore/detail/luminous-javascript-event/baacpbikplogpeecclpnajnlghmcldkb) -- Mozilla Firefox: [Fifrefox Add-ons](https://addons.mozilla.org/en-US/firefox/addon/luminous/) -- Opera: *pending review (Opera add-ons)* +- Chromium and Google Chrome: [Chrome Web Store](https://chrome.google.com/webstore/detail/luminous-javascript-event/baacpbikplogpeecclpnajnlghmcldkb) +- Mozilla Firefox: [Firefox Add-ons](https://addons.mozilla.org/addon/luminous/) +- Opera: [Opera add-ons](https://addons.opera.com/extensions/details/luminous-javascript-events-blocker/) ## Try it! -[Install](#how-to-install) the extension and go to our [demo page](https://gbaptista.github.io/luminous/html/demo-page.html) to experience and better understand how it works: +[Install](#how-to-install) the extension and go to our [demo page](https://gbaptista.github.io/luminous/html/demos/detections/index.html) to experience and better understand how it works: ![Demo Page](../../images/doc/en-US/demo-page.png) -## Going deeper +## Screenshots -This experiment is part of a book being written about *WebExtensions API* from the perspective of themes like freedom and privacy in the digital world. If you want to receive news about the publication, please leave your email: [https://gbaptistas.typeform.com/to/VRklaw](https://gbaptistas.typeform.com/to/VRklaw) +See some screenshots [here](./guides/screenshots.md). -While the book is not published, I suggest the following references to expand your view on the topic: +## Going deeper - Documentary: [*Do Not Track*](https://donottrack-doc.com) - Book: [*1984*](https://www.amazon.com/1984-George-Orwell-ebook/dp/B003JTHWKU) - Book: [*Cypherpunks: Freedom and the Future of the Internet*](https://www.amazon.com/Cypherpunks-Freedom-Internet-Julian-Assange-ebook/dp/B00AZBI4IO) - Book: [*The Filter Bubble: How the New Personalized Web Is Changing What We Read and How We Think*](https://www.amazon.com/Filter-Bubble-Personalized-Changing-Think-ebook/dp/B004IYJE6A) - Web page: [*The JavaScript Trap*](https://www.gnu.org/philosophy/javascript-trap.en.html) -- Web page: [*Internet Health*](https://www.mozilla.org/en-US/internet-health/) -- Web page: [*About Lightbeam*](https://www.mozilla.org/en-US/lightbeam/about) +- Web page: [*Internet Health*](https://www.mozilla.org/internet-health/) +- Web page: [*About Lightbeam*](https://www.mozilla.org/lightbeam/) + +## Guides + +Guides are documents on many specific subjects where we can go deep into the details and easily find the information we are looking for. See [all guides](./guides/). ## How to contribute - [Spread the word](#spread-the-word) + - [Write some guide](#write-some-guide) - [Share](#share) - [Write and talk about it](#write-and-talk-about-it) - [Help with translations](#help-with-translations) @@ -80,6 +87,10 @@ While the book is not published, I suggest the following references to expand yo ### Spread the word +#### Write some guide + +Collaborate by writing some [guide](#guides) on subjects related to the project. + #### Share Tell your friends, family, and co-workers about how the extension was used to improve your web experience and teach them how to use it too! @@ -112,7 +123,7 @@ We don't have the most beautiful and friendly interface in the world. [Discussio **Example 1**: The sooner we can inject code into websites and the less resources we use to process information, the more executions we'll be able to identify and the better our experience will be by having an extension that does not slow navigation. -Look for example to our demo page (*`html/demo-page.html`*): +Look for example to our demo page (*`html/demos/detections/index.html`*): ```javascript (function() { setTimeout(function() { @@ -177,7 +188,7 @@ This is an experimental project that grew in an uncontrolled way, we do not have #### Mozilla Firefox Service Workers -In *Mozilla Firefox* and derivatives, some websites that use [*Service Workers*](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) (like [*WhatsApp Web*](https://web.whatsapp.com/)) can block the code interception because of a bug in the interception of headers with the [*Content-Security-Policy*](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) guidelines. The current workaround is to reload the *Service Worker*: +In *Mozilla Firefox* and derivatives, some websites that use [*Service Workers*](https://developer.mozilla.org/docs/Web/API/Service_Worker_API) (like [*WhatsApp Web*](https://web.whatsapp.com/)) can block the code interception because of a bug in the interception of headers with the [*Content-Security-Policy*](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy) guidelines. The current workaround is to reload the *Service Worker*: - Access the *Service Workers* screen at: `about:debugging#workers` - Click on *unregister* in the *Service Worker* of the desired website: @@ -189,6 +200,7 @@ In *Mozilla Firefox* and derivatives, some websites that use [*Service Workers*] - [Background](#background) - [Content](#content) - [Pop-up](#pop-up) +- [Settings](#settings) - [Utils](#utils) - [Third party libraries](#third-party-libraries) @@ -223,7 +235,7 @@ In *Mozilla Firefox* and derivatives, some websites that use [*Service Workers*] ### Pop-up -Responsible for rendering and taking care of the interactions made in the pop-up that is opened by clicking the extension icon: +Responsible for rendering and handle interactions on the pop-up that is opened by clicking the extension icon: - `html/popup/popup.html` - `html/popup/templates/counters.html` @@ -231,6 +243,14 @@ Responsible for rendering and taking care of the interactions made in the pop-up - `js/popup/popup.js` - `css/popup/popup.css` +### Settings + +Responsible for rendering and handle interactions on the settings pages: + +- `html/settings/*.html` +- `js/settings/*.js` +- `css/settings/*.css` + ### Utils - `js/utils/colors.js`: Function used to determine the color displayed based on the value of the counter. @@ -238,9 +258,10 @@ Responsible for rendering and taking care of the interactions made in the pop-up ### Third party libraries -- `js/vendor/jquery`: [*jQuery JavaScript Library*](https://github.com/jquery/jquery) -- `js/vendor/mustachejs`: [*Minimal templating with {{mustaches}} in JavaScript*](https://github.com/janl/mustache.js) -- `js/vendor/tippyjs`: [*A lightweight, vanilla JS tooltip library*](https://github.com/atomiks/tippyjs) +- `vendor/bootstrap`: [*Bootstrap front-end component library*](https://github.com/twbs/bootstrap) +- `vendor/jquery`: [*jQuery JavaScript Library*](https://github.com/jquery/jquery) +- `vendor/mustachejs`: [*Minimal templating with {{mustaches}} in JavaScript*](https://github.com/janl/mustache.js) +- `vendor/tippyjs`: [*A lightweight, vanilla JS tooltip library*](https://github.com/atomiks/tippyjs) ## License @@ -248,7 +269,7 @@ This project is licensed under the [*GPLv3*](LICENSE) license. ## Donations -There is no kind of organization for receiving donations at the moment. See our guide on "[how to contribute](#how-to-contribute)" to other ways of contributing and also see about the book being written in "[going deeper](#going-deeper)". If you really want to make a donation, here are some incredible foundations that's share some ideals of this project that you can help: +There is no kind of organization for receiving donations at the moment. See our guide on "[how to contribute](#how-to-contribute)" to other ways of contributing. If you really want to make a donation, here are some incredible foundations that's share some ideals of this project that you can help: - [*Electronic Frontier Foundation*](https://supporters.eff.org/donate) - [*Free Software Foundation*](https://www.fsf.org/about/ways-to-donate) diff --git a/doc/en-US/guides/README.md b/doc/en-US/guides/README.md new file mode 100644 index 0000000..5413123 --- /dev/null +++ b/doc/en-US/guides/README.md @@ -0,0 +1,34 @@ +> *If you find some missing information or errors in any of the translations, help us by opening a [pull request](https://github.com/gbaptista/luminous/pulls) with the necessary modifications in the texts.* + +# Guides +> en-US | [es](../../es/guides) | [pt-BR](../../pt-BR/guides) + +* [back to home](../) + +Guides are documents on many specific subjects where we can go deep into the details and easily find the information we are looking for. + +- [How it works?](#how-it-works) +- [Web APIs and JavaScript events](#web-apis-and-javascript-events) +- [Site analysis](#site-analysis) +- [Context, History and Discussions](#context-history-and-discussions) +- [Screenshots](./screenshots.md) + +## How it works? + +- [Reports](./how-it-works/reports.md) +- [What is detected?](./how-it-works/what-is-detected.md) +- [Interception](./how-it-works/interception.md) + +## Web APIs and JavaScript events + +- *addEventListener* - *handleEvent* + - [mousemove](./javascript/mousemove.md) + - [scroll](./javascript/scroll.md) + +## Site analysis + +- [Google](./sites/google.md) + +## Context, History and Discussions + +- [Interesting discussions](./context/interesting-discussions.md) diff --git a/doc/en-US/guides/context/interesting-discussions.md b/doc/en-US/guides/context/interesting-discussions.md new file mode 100644 index 0000000..6902058 --- /dev/null +++ b/doc/en-US/guides/context/interesting-discussions.md @@ -0,0 +1,10 @@ +> *If you find some missing information or errors in any of the translations, help us by opening a [pull request](https://github.com/gbaptista/luminous/pulls) with the necessary modifications in the texts.* + +## Guides +> [back to index](../) + +### Interesting discussions +> en-US | [es](../../../es/guides/context/interesting-discussions.md) | [pt-BR](../../../pt-BR/guides/context/interesting-discussions.md) + +- [*heads up: Luminous: JavaScript events blocker*](https://github.com/ghacksuserjs/ghacks-user.js/issues/348) +- [*is this meant to be a blocker?*](https://github.com/gbaptista/luminous/issues/18) diff --git a/doc/en-US/guides/how-it-works/interception.md b/doc/en-US/guides/how-it-works/interception.md new file mode 100644 index 0000000..491f332 --- /dev/null +++ b/doc/en-US/guides/how-it-works/interception.md @@ -0,0 +1,338 @@ +> *If you find some missing information or errors in any of the translations, help us by opening a [pull request](https://github.com/gbaptista/luminous/pulls) with the necessary modifications in the texts.* + +# Guides +> [back to index](../) + +## Interception +> en-US | [es](../../../es/guides/how-it-works/interception.md) | [pt-BR](../../../pt-BR/guides/how-it-works/interception.md) + +- [The problem](#the-problem) +- [Solution](#solution) +- [Results](#results) + +### The problem +We were able to ensure that a script was loaded before anything else on the page: + +```json +{ + "content_scripts": [ + { + "matches": [""], + "js": ["interceptor.js"], + "run_at" : "document_start" + } + ] +} +``` + +With that we can prevent something from happening: +```javascript +// interceptor.js +EventTarget.prototype.addEventListener = function(_type, _listener, _options) { + /* do nothing */ +}; + +// document page +document.getElementById('some-button').addEventListener('click', function(_e) { + // will never be fired + alert('clicked'); +}); +``` + +However, if the interception code needs to perform some asynchronous operation, such as verifying if the user has disabled or not the interception, our code will no longer work: + +```javascript +// interceptor.js +browser.storage.sync.get('options', function(options) { + if(options.enabled) { + EventTarget.prototype.addEventListener = function(_type, _listener, _options) { + /* do nothing */ + }; + } +}); + +// document page +document.getElementById('some-button').addEventListener('click', function(_e) { + // will be fired + alert('clicked'); +}); +``` + +This has nothing to do with how long the operation takes, it's just how JavaScript works. This code for example will present the same problem, it will not be able to make the interception: + +```javascript +// interceptor.js +setTimeout(function() { + EventTarget.prototype.addEventListener = function(_type, _listener, _options) { + /* do nothing */ + }; +}, 0); + +// document page +document.getElementById('some-button').addEventListener('click', function(_e) { + // will be fired + alert('clicked'); +}); +``` + +To better understand how all this works, I strongly recommend this talk by *Philip Roberts*: [*What the heck is the event loop anyway?*](https://www.youtube.com/watch?v=8aGhZQkoFbQ) + +### Solution + +I believe that there is no definitive solution at the moment. At Luminous we use 4 strategies to try to inject the options as fast as we can. These strategies were built thanks to several people from other projects who worked on the issue and shared their knowledge (see *"Not being able to guarantee interception [#55](https://github.com/gbaptista/luminous/issues/55)"*). + +> *Discalimer: This is not the actual Luminous code, it's just a simplified version to demonstrate how it works.* + +The `manifest.js`: +```json +{ + "background": { + "scripts": ["background.js"] + }, + "content_scripts": [ + { + "run_at": "document_start", + "js": ["content.js"] + } + ] +} +``` + +The [test page](https://gbaptista.github.io/luminous/html/demo-page-interceptor.html): +```html + + +demo page +``` + +The strategies: + +- [Cookies](#cookies) +- [onCommitted](#oncommitted) +- [sendMessage](#sendMessage) +- [storage.get](#storageget) + +#### Cookies + +Using [*js-cookie*](https://github.com/js-cookie/js-cookie): + +```javascript +// background.js +var options = undefined; + +browser.storage.sync.get('options', function(stored_options) { + options = stored_options; +} + +var set_cookies = function(request_details) { + request_details.responseHeaders.push({ + name: 'Set-Cookie', + value: 'enabled=' + options.enabled + '; Path=/; Max-Age=1' + }); + + return { responseHeaders: request_details.responseHeaders }; +} + +browser.webRequest.onHeadersReceived.addListener( + set_cookies, { 'urls': [''] }, ['responseHeaders', 'blocking'] +); + +// content.js +if(Cookies.get('enabled')) { + var script = document.createElement('script'); + script.type = 'text/javascript'; + script.innerHTML = 'EventTarget.prototype.addEventListener = function(_, _, _) { /* do nothing */ };'; + document.documentElement.insertBefore(script, document.documentElement.firstChild); +} + +Cookies.remove('enabled', { path: '/' }); +``` + +**Warning 1:** + +From [MDN](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/webRequest/onHeadersReceived): + +> *Note that it is possible for extensions to conflict here. If two extensions listen to `onHeadersReceived` for the same request, then the second listener will see modifications made by the first listener, and will be able to undo any changes made by the first listener. For example, if the first listener adds a `Set-Cookie` header, and the second listener strips all `Set-Cookie` headers, then the first listener's modifications will be lost.* + +**Warning 2:** + +Make sure you do not let the cookies leak. We use `Max-Age=1` (1 second) and `Cookies.remove` immediately after reading it. + +**Warning 3:** + +Cookies have [limits](http://browsercookielimits.squawky.net/). + +At Luminous we use the strategy of compressing the settings and then decompressing them. Example: + +Original settings: +```json +{ + "WebAPIs": { + "requestAnimationFrame": true, + "XMLHttpRequest.open": true, + "XMLHttpRequest.send": true, + "geo.getCurrentPosition": true, + "geo.watchPosition": true, + "setInterval": true, + "setInterval.call": true, + "setTimeout": true, + "setTimeout.call": true + }, + "addEventListener": { + "blur": true, + "click": true, + "focus": true, + "focusout": true, + "input": true, + "keydown": true, + "keypress": true, + "keyup": true, + "mousemove": true, + "mouseout": true, + "mouseover": true, + "scroll": true + }, + "handleEvent": { + "mousemove": true, + "mouseout": true, + "mouseover": true + } +} +``` + +Compressed settings (cookie value): +``` +6:7:8:9:2:3:4:5:18:74:16:a-focusout:130:56:58:60:66:84:64:48:67:85:65 +``` + +**Warning 4:** + +Maybe the visited site uses a cookie with the same name as yours, this can cause problems, check if there are no cookies with the name you want in the headers before defining them. + +#### onCommitted +```javascript +// background.js +var options = undefined; + +browser.storage.sync.get('options', function(stored_options) { + options = stored_options; +} + +browser.webNavigation.onCommitted.addListener(function(details) { + browser.tabs.sendMessage( + details.tabId, { + action: 'options_from_on_committed', + enabled: options.enabled + } + ); +}); + +// content.js +browser.runtime.onMessage.addListener(function(message, _sender, _sendResponse) { + if(message.action == 'options_from_on_committed') { + if(message.enabled) { + var script = document.createElement('script'); + script.type = 'text/javascript'; + script.innerHTML = 'EventTarget.prototype.addEventListener = function(_, _, _) { /* do nothing */ };'; + document.documentElement.insertBefore(script, document.documentElement.firstChild); + } + } +}); +``` + +**Warning:** +Async solution, it is necessary to wait for the empty stack to inject the code. + +#### sendMessage +```javascript +// background.js +var options = undefined; + +browser.storage.sync.get('options', function(stored_options) { + options = stored_options; +} + +browser.runtime.onMessage.addListener(function(message, _sender, sendResponse) { + if(message.action == 'request_enabled_option') { + sendResponse({ enabled: options.enabled }); + } +}); + +// content.js +browser.runtime.sendMessage({ action: 'request_enabled_option' }, function(response) { + if(response.enabled) { + var script = document.createElement('script'); + script.type = 'text/javascript'; + script.innerHTML = 'EventTarget.prototype.addEventListener = function(_, _, _) { /* do nothing */ };'; + document.documentElement.insertBefore(script, document.documentElement.firstChild); + } +}); +``` + +**Warning:** +Async solution, it is necessary to wait for the empty stack to inject the code. + +#### storage.get +```javascript +// background.js +// > empty file + +// content.js +browser.storage.sync.get('options', function(stored_options) { + if(stored_options.enabled) { + var script = document.createElement('script'); + script.type = 'text/javascript'; + script.innerHTML = 'EventTarget.prototype.addEventListener = function(_, _, _) { /* do nothing */ };'; + document.documentElement.insertBefore(script, document.documentElement.firstChild); + } +}); +``` + +**Warning:** +Async solution, it is necessary to wait for the empty stack to inject the code. + +### Results + +Using a cookie is the only synchronous solution with guarantees that no code execution will be lost. That said, let's see which of the other solutions can be faster: + +#### Chromium-based browsers +``` + cookies: 5 milliseconds + onCommitted: 37 milliseconds +storage.sync.get: 49 milliseconds + sendMessage: 84 milliseconds +``` + +#### Gecko-based browsers: +``` + cookies: 3 milliseconds + onCommitted: 169 milliseconds +storage.sync.get: 177 milliseconds + sendMessage: 210 milliseconds +``` + +#### Opera: +``` + cookies: 7 milliseconds + onCommitted: 31 milliseconds +storage.sync.get: 41 milliseconds + sendMessage: 59 milliseconds +``` + +Do you know another solution? Have you tried any of these? Join the discussion! > [https://github.com/gbaptista/luminous/issues/55](https://github.com/gbaptista/luminous/issues/55) diff --git a/doc/en-US/guides/how-it-works/reports.md b/doc/en-US/guides/how-it-works/reports.md new file mode 100644 index 0000000..a29b456 --- /dev/null +++ b/doc/en-US/guides/how-it-works/reports.md @@ -0,0 +1,49 @@ +> *If you find some missing information or errors in any of the translations, help us by opening a [pull request](https://github.com/gbaptista/luminous/pulls) with the necessary modifications in the texts.* + +# Guides +> [back to index](../) + +## Reports +> en-US | [es](../../../es/guides/how-it-works/reports.md) | [pt-BR](../../../pt-BR/guides/how-it-works/reports.md) + +Reports provide insights into all JavaScript executions detected in your browser. + +### How is the data collected and stored? + +The [`js/background/reports.js`](https://github.com/gbaptista/luminous/blob/master/js/background/reports.js) file looks for information about the open tabs in [*storage.local*](https://developer.mozilla.org/pt-BR/Add-ons/WebExtensions/API/storage/local) and the with the [*Dexie.js*](http://dexie.org/) library generates the data that is stored in [*IndexedDB*](https://developer.mozilla.org/pt-BR/docs/Web/API/IndexedDB_API). + +The data structure used: + +```json +{ + "id": "www.google.com^handleEvent^mouseover", + "domain": "www.google.com", + "kind": "handleEvent", + "code": "mouseover", + "allowed": 6, + "blocked": 3, + "calls": 9 +} +``` + +You can see the data stored in your browser: + +> ![IndexedDB](../../../../images/doc/global/guides/how-it-works/IndexedDB-1.jpg) + +> ![IndexedDB](../../../../images/doc/global/guides/how-it-works/IndexedDB-2.jpg) + +> ![IndexedDB](../../../../images/doc/global/guides/how-it-works/IndexedDB-3.jpg) + +### Available views + +#### Domains that most runs JavaScript codes: + +![Report View](../../../../images/doc/global/guides/how-it-works/report-view-1.jpg) + +#### Most executed JavaScript codes: + +![Report View](../../../../images/doc/global/guides/how-it-works/report-view-2.jpg) + +#### Filter by domain + +![Report View](../../../../images/doc/global/guides/how-it-works/report-view-3.jpg) diff --git a/doc/en-US/guides/how-it-works/what-is-detected.md b/doc/en-US/guides/how-it-works/what-is-detected.md new file mode 100644 index 0000000..249d315 --- /dev/null +++ b/doc/en-US/guides/how-it-works/what-is-detected.md @@ -0,0 +1,171 @@ +> *If you find some missing information or errors in any of the translations, help us by opening a [pull request](https://github.com/gbaptista/luminous/pulls) with the necessary modifications in the texts.* + +# Guides +> [back to index](../) + +## What is detected? +> en-US | [es](../../../es/guides/how-it-works/what-is-detected.md) | [pt-BR](../../../pt-BR/guides/how-it-works/what-is-detected.md) + +- [How is it organized?](#how-is-it-organized) +- [Automatic settings](#automatic-settings) + +| WebAPI | method | intercepted? | reported? | can be blocked? | +| -------------- | --------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| EventTarget | removeEventListener | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![x](../../../../images/doc/global/guides/x.png) | ![x](../../../../images/doc/global/guides/x.png) | +| EventTarget | addEventListener | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | +| Battery Status | getBattery | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | +| Fetch API | fetch | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | +| Gamepad API | getGamepads | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | +| Geolocation | getCurrentPosition | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | +| Geolocation | watchPosition | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | +| HTTP headers | User-Agent | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | +| NavigatorID | userAgent | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | +| Window | setInterval | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | +| Window | setTimeout | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | +| Window | requestAnimationFrame | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | +| WebSocket | send | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | +| XMLHttpRequest | open | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | +| XMLHttpRequest | send | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | ![white_check_mark](../../../../images/doc/global/guides/white_check_mark.png) | + +`EventTarget.removeEventListener` is not reported because it is only an interception to not break websites because of `EventTarget.addEventListener` interception. + +## How is it organized? + +All codes intercepted are divided into 3 groups: +- [Web APIs](#web-apis) +- [*EventTarget.addEventListener*](#eventtargetaddeventlistener) + - [handleEvent](#handleevent) + - [addEventListener](#addeventlistener) + +### Web APIs + +Some JavaScripts are reported with a different nomenclature to get closer to the actual written code or to facilitate understanding: + +| JavaScript | reported as | example code | +| ------------------------------ | ---------------------- | ---------------------------------------------------- | +| (Battery Status).getBattery | getBattery | `navigator.getBattery().then(fn)` | +| (Fetch API).fetch | fetch | `fetch('f.txt').then(fn)` | +| (Gamepad API).getGamepads | getGamepads | `navigator.getGamepads()` | +| Geolocation.getCurrentPosition | geo.getCurrentPosition | `navigator.geolocation.getCurrentPosition(fn)` | +| Geolocation.watchPosition | geo.watchPosition | `navigator.geolocation.watchPosition(fn)` | +| (HTTP headers).User-Agent | headers.User-Agent | *`accessed by code on server side`* | +| NavigatorID.userAgent | NavigatorID.userAgent | `window.navigator.userAgent` | +| Window.setInterval | setInterval | `setInterval(function() { }, 1000)` | +| Window.setInterval (execution) | setInterval.call | `setInterval(function() { /*call*/ }, 1000)` | +| Window.setTimeout | setTimeout | `setTimeout(function() { }, 1000)` | +| Window.setTimeout (execution) | setTimeout.call | `setTimeout(function() { /*call*/ }, 1000)` | +| Window.requestAnimationFrame | requestAnimationFrame | `requestAnimationFrame(function() { /*call*/ })` | +| WebSocket.send | WebSocket.send | `(new WebSocket('ws://host:80')).send('hello')` | +| XMLHttpRequest.open | XMLHttpRequest.open | `(new XMLHttpRequest()).open('GET', 'f.txt')` | +| XMLHttpRequest.send | XMLHttpRequest.send | `(new XMLHttpRequest()).open('GET', 'f.txt').send()` | + +> *`fn` = some callback function, example: `var fn = function(response) { console.log(response); }`* + +`EventTarget.addEventListener` is not reported in this group because we give a different attention to this `EventTarget` method. + +### EventTarget.addEventListener + +`addEventListener` is used to report to the website when an event occurs. An event can be literally anything, so we've created a special session to look at the events that each site is trying to look at. Example: +```javascript +document.getElementById('some-form-textarea-element').addEventListener( + 'keypress', function(event) { console.log('key pressed: ' + event.key); } +); +``` + +Some common examples of events: + +| event name | fired when | +| ------------ | --------------------------------- | +| beforeunload | you close some tab of the browser | +| copy | you copy some text with `ctrl+c` | +| keypress | you type some text | +| mousemove | you move your mouse pointer | +| wheel | you try to scroll the page | + +What about the `handleEvent` group? Consider this code: + +```javascript +some_image.addEventListener('mousemove', function(_event) { + send_report('the user is moving the mouse over the image'); +}); +``` + +`addEventListener` will be reported once, but every time the mouse is moved over the image, `send_report` will be called, that's what we call `handleEvent`. + +If you block an event in `addEventListener`, you will never see it in `handleEvent` because it will never be called, however, to unblock the event you will need to reload the page. + +If the event is allowed in `addEventListener` you will see it every time it is triggered in `handleEvent` and you can block/unblock it inside `handleEvent` without needing to reload the page. + +#### handleEvent + +All triggered events that have been added with the `EventTarget.addEventListener` method. + +#### addEventListener + +All events that have been added to be reported with `handleEvent`. + +### Automatic settings + +Luminous has some categories at *automatic settings* about the `EventTarget.addEventListener` events names: + +- [none](#none) +- [common](#common) +- [almost all](#almost-all) +- [all](#all) + +### none + +No events. + +### common + +A predefined list of common events: +```javascript +[ + // Resource Events + 'abort', 'beforeunload', 'unload', + // Focus Events + 'focus', 'blur', + // Websocket Events + 'open', 'message', 'close', + // Session History Events + 'pagehide', 'pageshow', 'popstate', + // Form Events + 'reset', 'submit', + // Text Composition Events + 'compositionstart', 'compositionupdate', 'compositionend', + // View Events + 'fullscreenchange', 'fullscreenerror', 'resize', 'scroll', + // Clipboard Events + 'cut', 'copy', 'paste', + // Keyboard Events + 'keydown', 'keypress', 'keyup', + // Mouse Events + 'mouseenter', 'mouseover', 'mousemove', 'mousedown', 'mouseup', 'auxclick', + 'click', 'dblclick', 'contextmenu', 'wheel', 'mouseleave', 'mouseout', + 'select', 'pointerlockchange', 'pointerlockerror', + // Drag & Drop Events + 'dragstart', 'drag', 'dragend', 'dragenter', 'dragover', 'dragleave', 'drop', + // Media Events + 'canplay', 'canplaythrough', 'ended', 'play', 'playing', 'pause', 'volumechange', + // Storage events + 'storage', 'change', + // Value change events + 'broadcast', 'CheckboxStateChange', 'hashchange', 'input', + 'RadioStateChange', 'readystatechange', 'ValueChange', + // Gamepad API events + 'gamepadconnected', 'gamepaddisconnected', + // Uncategorized events + 'localized', 'message', 'open', 'show' +] +``` + +### almost all +Some events from the list of *common events* or an event that follows a rule of not having special characters, example: + +- Valid *almost all* events: `someEvent` `anotherevent` `SomeEventB` +- Invalid *almost all* events: `yt-something` `image:uploaded` `my_event` + +### all + +Any event. diff --git a/doc/en-US/guides/javascript/mousemove.md b/doc/en-US/guides/javascript/mousemove.md new file mode 100644 index 0000000..71be963 --- /dev/null +++ b/doc/en-US/guides/javascript/mousemove.md @@ -0,0 +1,42 @@ +> *If you find some missing information or errors in any of the translations, help us by opening a [pull request](https://github.com/gbaptista/luminous/pulls) with the necessary modifications in the texts.* + +# Guides +> [back to index](../) + +## mousemove +> en-US | [es](../../../es/guides/javascript/mousemove.md) | [pt-BR](../../../pt-BR/guides/javascript/mousemove.md) + +The [`mousemove`](https://developer.mozilla.org/en-US/docs/Web/Events/mousemove) event is fired each time your mouse pointer moves over something. + +The mouse is interpreted as your eyes from the websites point of view. It can be used to identify what you are reading. With [*jQuery*](https://jquery.com/) and a few lines of *JavaScript* the following code could be created: + +```javascript +$(document).ready(function() { + var last_text = undefined; + + $('*').on('mousemove', function(event) { + var current_text = $(event.target).text().replace(/(\r\n|\n|\r)/gm, '').slice(0, 100); + + if(current_text && current_text != last_text) { + last_text = current_text; + + console.log(last_text); + } + }); +}); +``` + +With it what you are reading can be seen through the movement of your mouse: + +![Google Heatmap](../../../../images/doc/global/guides/javascript/mouse-move-demo.jpg) + +See the full example [here](https://gist.github.com/gbaptista/b5af05e273db9d16b2fb2636e2e0d39f). + +Another use is to know "where are you looking" with the creation of heat maps: + +![Google Heatmap](../../../../images/doc/global/guides/javascript/google-heatmap.jpg) + +It should also be noted that mousemove is only one of many similar JavaScript events that detect mouse movement. Other similar events include but are not limited to `DOMMouseMove`, `pointermove`, and `touchmove` as well as the camelcase versions (synonyms, if you will) of these terms, such as `mouseMove`, `pointerMove` and `touchMove`. + +See also: [the `scroll` JavaScript event](./scroll.md). + diff --git a/doc/en-US/guides/javascript/scroll.md b/doc/en-US/guides/javascript/scroll.md new file mode 100644 index 0000000..f184219 --- /dev/null +++ b/doc/en-US/guides/javascript/scroll.md @@ -0,0 +1,18 @@ +> *If you find some missing information or errors in any of the translations, help us by opening a [pull request](https://github.com/gbaptista/luminous/pulls) with the necessary modifications in the texts.* + +# Guides +> [back to index](../) + +## scroll +> en-US | [es](../../../es/guides/javascript/scroll.md) | [pt-BR](../../../pt-BR/guides/javascript/scroll.md) + +The [`scroll`](https://developer.mozilla.org/en-US/docs/Web/Events/scroll) event is fired each time you scroll the webpage, whether vertical or horizontally. + +See also: [The `mousemove` JavaScript event](./mousemove.md). It may be helpful to read about `mousemove` first as this page builds on information presented in it. + +`scroll` is used by some websites to determine when you have reached the bottom of the page +in order to load more content (this is called "lazy loading"), but similar to `mousemove`, +it is also used to determine how far you've scrolled in the page for analytics purposes. + +Just as with mousemove, there are a number of similar events, such as `wheel`, `mousewheel` (and its synonym, `mouseWheel`), and less commonly, +`MozMousePixelScroll` for Mozilla's browsers (namely Firefox). diff --git a/doc/en-US/guides/screenshots.md b/doc/en-US/guides/screenshots.md new file mode 100644 index 0000000..31e677a --- /dev/null +++ b/doc/en-US/guides/screenshots.md @@ -0,0 +1,25 @@ +> *If you find some missing information or errors in any of the translations, help us by opening a [pull request](https://github.com/gbaptista/luminous/pulls) with the necessary modifications in the texts.* + +# Guides +> [back to index](../guides) + +## Screenshots +> en-US | [es](../../../doc/es/guides/screenshots.md) | [pt-BR](../../../doc/pt-BR/guides/screenshots.md) + +##### Popup +![popup](../../../images/stores/firefox-add-ons/screenshots/en-US/1-popup-1.png) + +##### Reports +![reports](../../../images/stores/firefox-add-ons/screenshots/en-US/2-reports-1.png) + +##### Settings +![settings](../../../images/stores/firefox-add-ons/screenshots/en-US/3-settings-1.png) + +##### Popup +![popup](../../../images/stores/firefox-add-ons/screenshots/en-US/4-popup-2.png) + +##### Reports +![reports](../../../images/stores/firefox-add-ons/screenshots/en-US/5-reports-2.png) + +##### Settings +![settings](../../../images/stores/firefox-add-ons/screenshots/en-US/6-settings-2.png) diff --git a/doc/en-US/guides/sites/google.md b/doc/en-US/guides/sites/google.md new file mode 100644 index 0000000..86f3dd4 --- /dev/null +++ b/doc/en-US/guides/sites/google.md @@ -0,0 +1,22 @@ +> *If you find some missing information or errors in any of the translations, help us by opening a [pull request](https://github.com/gbaptista/luminous/pulls) with the necessary modifications in the texts.* + +# Guides +> [back to index](../) + +## Google +> en-US | [es](../../../es/guides/sites/google.md) | [pt-BR](../../../pt-BR/guides/sites/google.md) + +With a few minutes of browsing the [Google](https://www.google.com) website the following codes were detected: + +| *JavaScript* | executions | required? | +| ---------------- | ---------- | --------- | +| scroll | 936 | no | +| mousewheel | 373 | no | +| message | 189 | not sure | +| mouseout | 60 | not sure | +| mouseover | 58 | no | +| keydown | 56 | not sure | +| keyup | 26 | not sure | +| load | 16 | not sure | +| visibilitychange | 14 | not sure | +| loadend | 14 | not sure | diff --git a/doc/es/README.md b/doc/es/README.md index e6003e4..6253ef9 100644 --- a/doc/es/README.md +++ b/doc/es/README.md @@ -8,11 +8,13 @@ Una extensión experimental para identificar, analizar y bloquear la ejecución - [Comprender la interfaz de usuario](#comprender-la-ui) - [Cómo instalar](#c%C3%B3mo-instalar) - [¡Pruébalo!](#pru%C3%A9balo) -- [Yendo más profundo](#yendo-m%C3%A1s-profundo) +- [Capturas de pantalla](#capturas-de-pantalla) +- [Profundizando](#profundizando) +- [Guías](#guías) - [Cómo contribuir](#c%C3%B3mo-contribuir) - [Problemas conocidos](#problemas-conocidos) - [Entender el código](#comprender-el-c%C3%B3digo) -- [Licencia](#license) +- [Licencia](#licencia) - [Donaciones](#donaciones) ## ¿Por qué? @@ -37,21 +39,21 @@ Es sobre este número (**7,6 mil**) que estamos perdidos y con las manos atadas, ## Cómo instalar -- Chromium e Google Chorme: [Chrome Web Store](https://chrome.google.com/webstore/detail/luminous-javascript-event/baacpbikplogpeecclpnajnlghmcldkb) +- Chromium y Google Chrome: [Chrome Web Store](https://chrome.google.com/webstore/detail/luminous-javascript-event/baacpbikplogpeecclpnajnlghmcldkb) - Mozilla Firefox: [Fifrefox Add-ons](https://addons.mozilla.org/es/firefox/addon/luminous/) -- Opera: *revisión pendiente (Opera add-ons)* +- Opera: [Complementos de Opera](https://addons.opera.com/es/extensions/details/luminous-javascript-events-blocker/) ## ¡Pruébalo! -[Instalar](#c%C3%B3mo-instalar) la extensión e ir a nuestra [página de demostración](https://gbaptista.github.io/luminous/html/demo-page.html) para experimentar y comprender mejor cómo funciona: +[Instalar](#c%C3%B3mo-instalar) la extensión e ir a nuestra [página de demostración](https://gbaptista.github.io/luminous/html/demos/detections/index.html) para experimentar y comprender mejor cómo funciona: ![Demo Page](../../images/doc/es/demo-page.png) -## Yendo más profundo +## Capturas de pantalla -Este experimento es parte de un libro que se está escribiendo sobre *WebExtensions API* desde la perspectiva de temas como libertad y privacidad en el mundo digital. Si desea recibir noticias sobre la publicación, deje su correo electrónico: [https://gbaptistas.typeform.com/to/VRklaw](https://gbaptistas.typeform.com/to/VRklaw) +Ver algunas capturas de pantalla [aquí](./guides/screenshots.md). -Si bien el libro no está publicado, sugiero las siguientes referencias para ampliar su opinión sobre el tema: +## Profundizando - Documental: [*Do Not Track*](https://donottrack-doc.com) - Libro: [*1984*](https://www.amazon.com.br/1984-George-Orwell-ebook/dp/B00BFGQYRQ) @@ -61,11 +63,16 @@ Si bien el libro no está publicado, sugiero las siguientes referencias para amp - Página web: [*Integridad de Internet*](https://www.mozilla.org/es-ES/internet-health/) - Página web: [*Acerca de Lightbeam*](https://www.mozilla.org/es-ES/lightbeam/about/) +## Guías + +Las Guías son documentos sobre temas muy específicos donde podemos ir profundamente en los detalles y encontrar fácilmente la información que estamos buscando. Ver [todas las guías](./guides/). + ## Cómo contribuir - [Corre la voz](#difundir-la-palabra) + - [Escriba alguna guía](#escriba-alguna-guía) - [Comparte](#compartir) - - [Escribir y hablar de ello](#escribir-y-hablar-sobre-eello) + - [Escribir y hablar sobre ello](#escribir-y-hablar-sobre-ello) - [Ayuda con traducciones](#ayuda-con-traducciones) - [Informar problemas](#informar-problemas) - [Problemas en sitios específicos](#problemas-en-sitios-espec%C3%ADficos) @@ -78,11 +85,15 @@ Si bien el libro no está publicado, sugiero las siguientes referencias para amp ### Difundir la palabra +#### Escriba alguna guía + +Colabora escribiendo una [guía](#guías) sobre temas relacionados con el proyecto. + #### Compartir ¡Cuénteles a sus amigos, familiares y compañeros de trabajo cómo se usó la extensión para mejorar su experiencia web y enséñeles a usarla también! -#### Escribir y hablar sobre eello +#### Escribir y hablar sobre ello ¿Encontraste un sitio web invadiendo tu privacidad? ¿Bloqueaste eventos que no querías? ¿Le hizo más fácil desarrollar su código o corregir errores? Grabe un video, prepare una charla, escriba un artículo o algo así para contar cómo se hizo, explicando cómo le ayudó la extensión y mostrando las posibilidades. @@ -108,9 +119,9 @@ No tenemos la interfaz más bella y amigable del mundo. [Discusiones](https://gi #### Mejorar el rendimiento -**Ejemplo 1**: Cuanto antes podamos inyectar código en los sitios web y cuantos menos recursos usemos para procesar la información, más ejecuciones podremos identificar y mejor será nuestra experiencia al tener una extensión que no disminuya. navegación. +**Ejemplo 1**: Cuanto antes podamos inyectar código en los sitios web y cuantos menos recursos usemos para procesar la información, más ejecuciones podremos identificar y mejor será nuestra experiencia al tener una extensión que no disminuya la velocidad de navegación. -Busque, por ejemplo, nuestra página de demostración (*`html/demo-page.html`*): +Busque, por ejemplo, nuestra página de demostración (*`html/demos/detections/index.html`*): ```javascript (function() { setTimeout(function() { @@ -157,6 +168,12 @@ Este es un proyecto experimental que creció de manera incontrolada, no tenemos ## Problemas conocidos +- [Sin soluciones](#sin-soluciones) +- [Con soluciones](#con-soluciones) + - [Mozilla Firefox Service Workers](#mozilla-firefox-service-workers) + +### Sin soluciones + - No hemos interceptado *códigos* en línea (``). @@ -165,11 +182,23 @@ Este es un proyecto experimental que creció de manera incontrolada, no tenemos - Algunos sitios con una cantidad absurda de eventos *JavaScript* pueden ralentizar la experiencia de navegación debido a la recopilación de datos en los códigos interceptados. +### Con soluciones + +#### Mozilla Firefox Service Workers + +En *Mozilla Firefox* y derivados, algunos sitios web que usan [*Service Workers*](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) (como [*WhatsApp Web*](https://web.whatsapp.com/)) pueden bloquear la interceptación del código debido a un error en la interceptación de las cabeceras con las pautas de [*Content-Security-Policy*](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy). La solución actual es volver a cargar el *Service Worker*: + + - Acceda a la pantalla *Service Workers* en: `about:debugging#workers` + - Haga clic en *unregister* en el *Service Worker* del sitio web deseado: + ![Service Workers](../../images/doc/global/firefox-service-workers.jpg) + - Recargar el sitio web. + ## Comprender el código - [Fondo](#fondo) - [Contenido](#contenido) - [Ventana emergente](#ventana-emergente) +- [Ajustes](#ajustes) - [Utiles](#utiles) - [Bibliotecas de terceros](#bibliotecas-de-terceros) @@ -196,6 +225,8 @@ Este es un proyecto experimental que creció de manera incontrolada, no tenemos - `/content/readers/data.js`: responsable de leer los datos en el elemento *HTML* del documento que almacena los detalles recopilados de las intercepciones y los pasa a la extensión. +`/content/injections_controller.js`: Responsable de tomar decisiones sobre las inyecciones de código. + `/content/interceptor.js`: responsable de interceptar ejecuciones de códigos *JavaScript* en el contexto del documento y recopilar detalles sobre ellos. ### Ventana Emergente @@ -208,6 +239,14 @@ Responsable de procesar y cuidar las interacciones realizadas en la ventana emer - `js/popup/popup.js` - `css/popup/popup.css` +### Ajustes + +Responsable de renderizar y manejar las interacciones en las páginas de ajustes: + +- `html/settings/*.html` +- `js/settings/*.js` +- `css/settings/*.css` + ### Utiles - `js/utils/colors.js`: Función utilizada para determinar el color mostrado en función del valor del contador. @@ -215,17 +254,18 @@ Responsable de procesar y cuidar las interacciones realizadas en la ventana emer ### Bibliotecas de terceros -- `js/vendor/jquery`: [*jQuery JavaScript Library*](https://github.com/jquery/jquery) -- `js/vendor/mustachejs`: [*Plantilla mínima con {{bigotes}} en JavaScript*](https://github.com/janl/mustache.js) -- `js/vendor/tippyjs`: [*Una biblioteca ligera, vainilla JS tooltip*](https://github.com/atomiks/tippyjs) +- `vendor/bootstrap`: [*Bootstrap: biblioteca de componente front-end*](https://github.com/twbs/bootstrap) +- `vendor/jquery`: [*jQuery JavaScript Library*](https://github.com/jquery/jquery) +- `vendor/mustachejs`: [*Plantilla mínima con {{bigotes}} en JavaScript*](https://github.com/janl/mustache.js) +- `vendor/tippyjs`: [*Una biblioteca ligera, vainilla JS tooltip*](https://github.com/atomiks/tippyjs) -## License +## Licencia Este proyecto está licenciado bajo la licencia [*GPLv3*](LICENSE). ## Donaciones -No hay ningún tipo de organización para recibir donaciones en este momento. Consulte nuestra guía sobre "[cómo contribuir](#c%C3%B3mo-contribuir)" a otras formas de contribuir y también vea sobre el libro escrito en "[profundizando](#yendo-m%C3%A1s-profundo)". Si realmente quieres hacer una donación, aquí hay algunos fundamentos increíbles que comparten algunos ideales de este proyecto que puedes ayudar: +No hay ningún tipo de organización para recibir donaciones en este momento. Consulte nuestra guía sobre "[cómo contribuir](#c%C3%B3mo-contribuir)" a otras formas de contribuir. Si realmente quieres hacer una donación, aquí hay algunos fundamentos increíbles que comparten algunos ideales de este proyecto que puedes ayudar: - [*Electronic Frontier Foundation*](https://supporters.eff.org/donate) - [*Free Software Foundation*](https://www.fsf.org/about/ways-to-donate) diff --git a/doc/es/guides/README.md b/doc/es/guides/README.md new file mode 100644 index 0000000..c8d3701 --- /dev/null +++ b/doc/es/guides/README.md @@ -0,0 +1,33 @@ +> *Si encuentra información que falta o errores en alguna de las traducciones, nos ayude abriendo un [pull request](https://github.com/gbaptista/luminous/pulls) con las modificaciones necesarias en los textos para que todos tengan acceso a las guías en su idioma.* + +# Guías +> [en-US](../../en-US/guides) | es | [pt-BR](../../pt-BR/guides) + +* [volver al inicio](../) + +Las Guías son documentos sobre temas muy específicos donde podemos ir profundamente en los detalles y encontrar fácilmente la información que estamos buscando. + +- [¿Como funciona?](#como-funciona) +- [Web API y eventos JavaScript](#web-api-y-eventos-javascript) +- [Análisis de sitios web](#análisis-de-sitios-web) +- [Contexto, Historia y Discusiones](#contexto-historia-y-discusiones) +- [Capturas de pantalla](./screenshots.md) + +## ¿Como funciona? + +- [Informes](./how-it-works/reports.md) +- [¿Qué se detecta?](./how-it-works/what-is-detected.md) +- [Interceptación](./how-it-works/interception.md) + +## Web API y eventos JavaScript + +- *addEventListener* - *handleEvent* + - [mousemove](./javascript/mousemove.md) + +## Análisis de sitios web + +- [Google](./sites/google.md) + +## Contexto, Historia y Discusiones + +- [Discusiones interesantes](./context/interesting-discussions.md) diff --git a/doc/es/guides/context/interesting-discussions.md b/doc/es/guides/context/interesting-discussions.md new file mode 100644 index 0000000..1d4cc78 --- /dev/null +++ b/doc/es/guides/context/interesting-discussions.md @@ -0,0 +1,10 @@ +> *Si encuentra información que falta o errores en alguna de las traducciones, nos ayude abriendo un [pull request](https://github.com/gbaptista/luminous/pulls) con las modificaciones necesarias en los textos para que todos tengan acceso a las guías en su idioma.* + +# Guías +> [volver al índice](../) + +### Discusiones interesantes +> [en-US](../../../en-US/guides/context/interesting-discussions.md) | es | [pt-BR](../../../pt-BR/guides/context/interesting-discussions.md) + +- [*heads up: Luminous: JavaScript events blocker*](https://github.com/ghacksuserjs/ghacks-user.js/issues/348) +- [*is this meant to be a blocker?*](https://github.com/gbaptista/luminous/issues/18) diff --git a/doc/es/guides/how-it-works/interception.md b/doc/es/guides/how-it-works/interception.md new file mode 100644 index 0000000..3f45b1b --- /dev/null +++ b/doc/es/guides/how-it-works/interception.md @@ -0,0 +1,9 @@ +> *Si encuentra información que falta o errores en alguna de las traducciones, nos ayude abriendo un [pull request](https://github.com/gbaptista/luminous/pulls) con las modificaciones necesarias en los textos para que todos tengan acceso a las guías en su idioma.* + +# Guías +> [volver al índice](../) + +## Interceptación +> [en-US](../../../en-US/guides/how-it-works/interception.md) | es | [pt-BR](../../../pt-BR/guides/how-it-works/interception.md) + +Traducción pendiente. diff --git a/doc/es/guides/how-it-works/reports.md b/doc/es/guides/how-it-works/reports.md new file mode 100644 index 0000000..d7ab770 --- /dev/null +++ b/doc/es/guides/how-it-works/reports.md @@ -0,0 +1,9 @@ +> *Si encuentra información que falta o errores en alguna de las traducciones, nos ayude abriendo un [pull request](https://github.com/gbaptista/luminous/pulls) con las modificaciones necesarias en los textos para que todos tengan acceso a las guías en su idioma.* + +# Guías +> [volver al índice](../) + +## Informes +> [en-US](../../../en-US/guides/how-it-works/reports.md) | es | [pt-BR](../../../pt-BR/guides/how-it-works/reports.md) + +Traducción pendiente. diff --git a/doc/es/guides/how-it-works/what-is-detected.md b/doc/es/guides/how-it-works/what-is-detected.md new file mode 100644 index 0000000..3449920 --- /dev/null +++ b/doc/es/guides/how-it-works/what-is-detected.md @@ -0,0 +1,9 @@ +> *Si encuentra información que falta o errores en alguna de las traducciones, nos ayude abriendo un [pull request](https://github.com/gbaptista/luminous/pulls) con las modificaciones necesarias en los textos para que todos tengan acceso a las guías en su idioma.* + +# Guías +> [volver al índice](../) + +## ¿Qué se detecta? +> [en-US](../../../en-US/guides/how-it-works/what-is-detected.md) | es | [pt-BR](../../../pt-BR/guides/how-it-works/what-is-detected.md) + +Traducción pendiente. diff --git a/doc/es/guides/javascript/mousemove.md b/doc/es/guides/javascript/mousemove.md new file mode 100644 index 0000000..e5977e1 --- /dev/null +++ b/doc/es/guides/javascript/mousemove.md @@ -0,0 +1,9 @@ +> *Si encuentra información que falta o errores en alguna de las traducciones, nos ayude abriendo un [pull request](https://github.com/gbaptista/luminous/pulls) con las modificaciones necesarias en los textos para que todos tengan acceso a las guías en su idioma.* + +# Guías +> [volver al índice](../) + +## mousemove +> [en-US](../../../en-US/guides/javascript/mousemove.md) | es | [pt-BR](../../../pt-BR/guides/javascript/mousemove.md) + +Traducción pendiente. diff --git a/doc/es/guides/screenshots.md b/doc/es/guides/screenshots.md new file mode 100644 index 0000000..d4a2990 --- /dev/null +++ b/doc/es/guides/screenshots.md @@ -0,0 +1,25 @@ +> *Si encuentra información que falta o errores en alguna de las traducciones, nos ayude abriendo un [pull request](https://github.com/gbaptista/luminous/pulls) con las modificaciones necesarias en los textos para que todos tengan acceso a las guías en su idioma.* + +# Guías +> [volver al índice](../guides) + +## Capturas de pantalla +> [en-US](../../../doc/en-US/guides/screenshots.md) | es | [pt-BR](../../../doc/pt-BR/guides/screenshots.md) + +##### Ventana emergente +![ventana emergente](../../../images/stores/firefox-add-ons/screenshots/en-US/1-popup-1.png) + +##### Informes +![informes](../../../images/stores/firefox-add-ons/screenshots/en-US/2-reports-1.png) + +##### Ajustes +![ajustes](../../../images/stores/firefox-add-ons/screenshots/en-US/3-settings-1.png) + +##### Ventana emergente +![ventana emergente](../../../images/stores/firefox-add-ons/screenshots/en-US/4-popup-2.png) + +##### Informes +![informes](../../../images/stores/firefox-add-ons/screenshots/en-US/5-reports-2.png) + +##### Ajustes +![ajustes](../../../images/stores/firefox-add-ons/screenshots/en-US/6-settings-2.png) diff --git a/doc/es/guides/sites/google.md b/doc/es/guides/sites/google.md new file mode 100644 index 0000000..de3620f --- /dev/null +++ b/doc/es/guides/sites/google.md @@ -0,0 +1,9 @@ +> *Si encuentra información que falta o errores en alguna de las traducciones, nos ayude abriendo un [pull request](https://github.com/gbaptista/luminous/pulls) con las modificaciones necesarias en los textos para que todos tengan acceso a las guías en su idioma.* + +# Guías +> [volver al índice](../) + +## Google +> [en-US](../../../en-US/guides/sites/google.md) | es | [pt-BR](../../../pt-BR/guides/sites/google.md) + +Traducción pendiente. diff --git a/doc/pt-BR/guides/README.md b/doc/pt-BR/guides/README.md new file mode 100644 index 0000000..58d08e6 --- /dev/null +++ b/doc/pt-BR/guides/README.md @@ -0,0 +1,33 @@ +> *Se você encontrar informações faltando ou erros em alguma das traduções, nos ajude abrindo um [pull request](https://github.com/gbaptista/luminous/pulls) com as modificações necessárias nos textos para que todos tenham acesso aos guias em seu idioma.* + +# Guias +> [en-US](../../en-US/guides) | [es](../../es/guides) | pt-BR + +* [voltar ao início](../../../) + +Guias são documentos sobre assuntos muitos específicos onde podemos ir fundo nos detalhes e encontrar facilmente as informações que estamos procurando. + +- [Como funciona?](#como-funciona) +- [Web APIs e eventos JavaScript](#web-apis-e-eventos-javascript) +- [Análise de sites](#an%C3%A1lise-de-sites) +- [Contexto, História e Discussões](#contexto-hist%C3%B3ria-e-discuss%C3%B5es) +- [Capturas de tela](screenshots.md) + +## Como funciona? + +- [Relatórios](./how-it-works/reports.md) +- [O que é detectado?](./how-it-works/what-is-detected.md) +- [Interceptação](./how-it-works/interception.md) + +## Web APIs e eventos JavaScript + +- *addEventListener* - *handleEvent* + - [mousemove](./javascript/mousemove.md) + +## Análise de sites + +- [Google](./sites/google.md) + +## Contexto, História e Discussões + +- [Discussões interessantes](./context/interesting-discussions.md) diff --git a/doc/pt-BR/guides/context/interesting-discussions.md b/doc/pt-BR/guides/context/interesting-discussions.md new file mode 100644 index 0000000..ea0a8d3 --- /dev/null +++ b/doc/pt-BR/guides/context/interesting-discussions.md @@ -0,0 +1,10 @@ +> *Se você encontrar informações faltando ou erros em alguma das traduções, nos ajude abrindo um [pull request](https://github.com/gbaptista/luminous/pulls) com as modificações necessárias nos textos para que todos tenham acesso aos guias em seu idioma.* + +## Guias +> [voltar ao índice](../) + +### Discussões interessantes +> [en-US](../../../en-US/guides/context/interesting-discussions.md) | [es](../../../es/guides/context/interesting-discussions.md) | pt-BR + +- [*heads up: Luminous: JavaScript events blocker*](https://github.com/ghacksuserjs/ghacks-user.js/issues/348) +- [*is this meant to be a blocker?*](https://github.com/gbaptista/luminous/issues/18) diff --git a/doc/pt-BR/guides/how-it-works/interception.md b/doc/pt-BR/guides/how-it-works/interception.md new file mode 100644 index 0000000..07f627d --- /dev/null +++ b/doc/pt-BR/guides/how-it-works/interception.md @@ -0,0 +1,10 @@ +> *Se você encontrar informações faltando ou erros em alguma das traduções, nos ajude abrindo um [pull request](https://github.com/gbaptista/luminous/pulls) com as modificações necessárias nos textos para que todos tenham acesso aos guias em seu idioma.* + +# Guias +> [voltar ao índice](../) + +## Interceptação + +> [en-US](../../../en-US/guides/how-it-works/interception.md) | [es](../../../es/guides/how-it-works/interception.md) | pt-BR + +Tradução pendente. diff --git a/doc/pt-BR/guides/how-it-works/reports.md b/doc/pt-BR/guides/how-it-works/reports.md new file mode 100644 index 0000000..bd2473f --- /dev/null +++ b/doc/pt-BR/guides/how-it-works/reports.md @@ -0,0 +1,49 @@ +> *Se você encontrar informações faltando ou erros em alguma das traduções, nos ajude abrindo um [pull request](https://github.com/gbaptista/luminous/pulls) com as modificações necessárias nos textos para que todos tenham acesso aos guias em seu idioma.* + +# Guias +> [voltar ao índice](../) + +## Relatórios +> [en-US](../../../en-US/guides/how-it-works/reports.md) | [es](../../../es/guides/how-it-works/reports.md) | pt-BR + +Os relatórios oferecem uma visão sobre todas as execuções de JavaScript detectadas no seu navegador. + +### Como os dados são coletados e armazenados? + +O arquivo [`js/background/reports.js`](https://github.com/gbaptista/luminous/blob/master/js/background/reports.js) busca informações sobre as abas abertas no [*storage.local*](https://developer.mozilla.org/pt-BR/Add-ons/WebExtensions/API/storage/local) e a partir da biblioteca [*Dexie.js*](http://dexie.org/) gera os dados que são armazenados no [*IndexedDB*](https://developer.mozilla.org/pt-BR/docs/Web/API/IndexedDB_API). + +A estrutura de dados utilizada é a seguinte: + +```json +{ + "id": "www.google.com^handleEvent^mouseover", + "domain": "www.google.com", + "kind": "handleEvent", + "code": "mouseover", + "allowed": 6, + "blocked": 3, + "calls": 9 +} +``` + +Você pode ver os dados armazenados no seu navegador: + +> ![IndexedDB](../../../../images/doc/global/guides/how-it-works/IndexedDB-1.jpg) + +> ![IndexedDB](../../../../images/doc/global/guides/how-it-works/IndexedDB-2.jpg) + +> ![IndexedDB](../../../../images/doc/global/guides/how-it-works/IndexedDB-3.jpg) + +### Visualizações disponíveis + +#### Domínios que mais executam códigos JavaScript: + +![Report View](../../../../images/doc/global/guides/how-it-works/report-view-1.jpg) + +#### Códigos JavaScript mais executados: + +![Report View](../../../../images/doc/global/guides/how-it-works/report-view-2.jpg) + +#### Filtro por site + +![Report View](../../../../images/doc/global/guides/how-it-works/report-view-3.jpg) diff --git a/doc/pt-BR/guides/how-it-works/what-is-detected.md b/doc/pt-BR/guides/how-it-works/what-is-detected.md new file mode 100644 index 0000000..4e97ce4 --- /dev/null +++ b/doc/pt-BR/guides/how-it-works/what-is-detected.md @@ -0,0 +1,10 @@ +> *Se você encontrar informações faltando ou erros em alguma das traduções, nos ajude abrindo um [pull request](https://github.com/gbaptista/luminous/pulls) com as modificações necessárias nos textos para que todos tenham acesso aos guias em seu idioma.* + +# Guias +> [voltar ao índice](../) + +## O que é detectado? + +> [en-US](../../../en-US/guides/how-it-works/what-is-detected.md) | [es](../../../es/guides/how-it-works/what-is-detected.md) | pt-BR + +Tradução pendente. diff --git a/doc/pt-BR/guides/javascript/mousemove.md b/doc/pt-BR/guides/javascript/mousemove.md new file mode 100644 index 0000000..3a3a57e --- /dev/null +++ b/doc/pt-BR/guides/javascript/mousemove.md @@ -0,0 +1,37 @@ +> *Se você encontrar informações faltando ou erros em alguma das traduções, nos ajude abrindo um [pull request](https://github.com/gbaptista/luminous/pulls) com as modificações necessárias nos textos para que todos tenham acesso aos guias em seu idioma.* + +# Guias +> [voltar ao índice](../) + +## mousemove +> [en-US](../../../en-US/guides/javascript/mousemove.md) | [es](../../../es/guides/javascript/mousemove.md) | pt-BR + +O evento [`mousemove`](https://developer.mozilla.org/en-US/docs/Web/Events/mousemove) é disparado toda vez que o ponteiro do seu mouse é movimentado sobre algum elemento. + +O mouse é interpretado como os seus olhos do ponto de vista dos sites. Ele pode ser utilizado para identificar o que você está lendo. Com [*jQuery*](https://jquery.com/) e poucas linhas de *JavaScript* o seguinte código poderia ser criado: + +```javascript +$(document).ready(function() { + var last_text = undefined; + + $('*').on('mousemove', function(event) { + var current_text = $(event.target).text().replace(/(\r\n|\n|\r)/gm, '').slice(0, 100); + + if(current_text && current_text != last_text) { + last_text = current_text; + + console.log(last_text); + } + }); +}); +``` + +Com ele o que você está lendo pode ser visto através do movimento do seu mouse: + +![Google Heatmap](../../../../images/doc/global/guides/javascript/mouse-move-demo.jpg) + +Veja o exemplo completo [aqui](https://gist.github.com/gbaptista/b5af05e273db9d16b2fb2636e2e0d39f). + +Outra aplicação é a saber "onde você está olhando" com a criação de mapas de calor: + +![Google Heatmap](../../../../images/doc/global/guides/javascript/google-heatmap.jpg) diff --git a/doc/pt-BR/guides/screenshots.md b/doc/pt-BR/guides/screenshots.md new file mode 100644 index 0000000..ff2440a --- /dev/null +++ b/doc/pt-BR/guides/screenshots.md @@ -0,0 +1,25 @@ +> *Se você encontrar informações faltando ou erros em alguma das traduções, nos ajude abrindo um [pull request](https://github.com/gbaptista/luminous/pulls) com as modificações necessárias nos textos para que todos tenham acesso aos guias em seu idioma.* + +# Guias +> [voltar ao índice](../guides) + +## Capturas de tela +> [en-US](../../../doc/en-US/guides/screenshots.md) | [es](../../../doc/es/guides/screenshots.md) | pt-BR + +##### Popup +![popup](../../../images/stores/firefox-add-ons/screenshots/en-US/1-popup-1.png) + +##### Relatórios +![relatórios](../../../images/stores/firefox-add-ons/screenshots/en-US/2-reports-1.png) + +##### Configurações +![configurações](../../../images/stores/firefox-add-ons/screenshots/en-US/3-settings-1.png) + +##### Popup +![popup](../../../images/stores/firefox-add-ons/screenshots/en-US/4-popup-2.png) + +##### Relatórios +![relatórios](../../../images/stores/firefox-add-ons/screenshots/en-US/5-reports-2.png) + +##### Configurações +![configurações](../../../images/stores/firefox-add-ons/screenshots/en-US/6-settings-2.png) diff --git a/doc/pt-BR/guides/sites/google.md b/doc/pt-BR/guides/sites/google.md new file mode 100644 index 0000000..324ca39 --- /dev/null +++ b/doc/pt-BR/guides/sites/google.md @@ -0,0 +1,22 @@ +> *Se você encontrar informações faltando ou erros em alguma das traduções, nos ajude abrindo um [pull request](https://github.com/gbaptista/luminous/pulls) com as modificações necessárias nos textos para que todos tenham acesso aos guias em seu idioma.* + +# Guias +> [voltar ao índice](../) + +## Google +> [en-US](../../../en-US/guides/sites/google.md) | [es](../../../es/guides/sites/google.md) | pt-BR + +Em poucos minutos de navegação no [Google](https://www.google.com) os seguintes códigos foram detectados: + +| *JavaScript* | execuções | necessário? | +| ---------------- | --------- | ----------- | +| scroll | 936 | não | +| mousewheel | 373 | não | +| message | 189 | incerto | +| mouseout | 60 | incerto | +| mouseover | 58 | não | +| keydown | 56 | incerto | +| keyup | 26 | incerto | +| load | 16 | incerto | +| visibilitychange | 14 | incerto | +| loadend | 14 | incerto | diff --git a/html/external-content.txt b/html/demos/detections/external-content.txt similarity index 100% rename from html/external-content.txt rename to html/demos/detections/external-content.txt diff --git a/html/demo-page.html b/html/demos/detections/index.html similarity index 61% rename from html/demo-page.html rename to html/demos/detections/index.html index 575ad4e..39a7710 100644 --- a/html/demo-page.html +++ b/html/demos/detections/index.html @@ -18,6 +18,8 @@ height: 100%; overflow: auto; padding-bottom: 20px; + white-space: nowrap; + padding-right: 20px; } .demo-box, .small-demo-box { @@ -78,11 +80,67 @@
XMLHttpRequest request...
fetch request...
await fetch request...
+ +
removeEventListener()
+ +

+ +
getCurrentPosition()
+
watchPosition()
+ +
getBattery()
+
getGamepads()
+ +

+ +
navigator.userAgent
+ +
requestAnimationFrame()
diff --git a/html/demos/iframes/cryptominer.html b/html/demos/iframes/cryptominer.html new file mode 100644 index 0000000..eef1706 --- /dev/null +++ b/html/demos/iframes/cryptominer.html @@ -0,0 +1,24 @@ + + + + Demo + + + + + cryptominer:3000 +

+ + + + diff --git a/html/demos/iframes/index.html b/html/demos/iframes/index.html new file mode 100644 index 0000000..b5fb635 --- /dev/null +++ b/html/demos/iframes/index.html @@ -0,0 +1,25 @@ + + + + Demo + + + + localhost:300 +

+ +
+ + + + diff --git a/html/demos/iframes/subtracker.html b/html/demos/iframes/subtracker.html new file mode 100644 index 0000000..1740fc9 --- /dev/null +++ b/html/demos/iframes/subtracker.html @@ -0,0 +1,21 @@ + + + + Demo + + + + subtracker:3000 + + + diff --git a/html/demos/iframes/tracker.html b/html/demos/iframes/tracker.html new file mode 100644 index 0000000..2c39221 --- /dev/null +++ b/html/demos/iframes/tracker.html @@ -0,0 +1,21 @@ + + + + Demo + + + + tracker:3000 + + + diff --git a/html/demos/interception/iframe.html b/html/demos/interception/iframe.html new file mode 100644 index 0000000..9f52c44 --- /dev/null +++ b/html/demos/interception/iframe.html @@ -0,0 +1,67 @@ + + + + + + Demo + + + injection from: +
+ cookie leak: no +
+ iframe_1 blocked: yes +
+ iframe_2 blocked: yes +
+ + + + + + + + diff --git a/html/demos/interception/index.html b/html/demos/interception/index.html new file mode 100644 index 0000000..1114473 --- /dev/null +++ b/html/demos/interception/index.html @@ -0,0 +1,64 @@ + + + + + + Demo + + + injection from: +
+ cookie leak: no +
+ main_1 blocked: yes +
+ main_2 blocked: yes +
+ + + + + + + diff --git a/html/demos/interception/null.html b/html/demos/interception/null.html new file mode 100644 index 0000000..d7c77b3 --- /dev/null +++ b/html/demos/interception/null.html @@ -0,0 +1 @@ +null frame diff --git a/html/demos/interception/simple.html b/html/demos/interception/simple.html new file mode 100644 index 0000000..7cdd65b --- /dev/null +++ b/html/demos/interception/simple.html @@ -0,0 +1,30 @@ + + + + + diff --git a/html/demos/interception/sub-iframe.html b/html/demos/interception/sub-iframe.html new file mode 100644 index 0000000..e53d265 --- /dev/null +++ b/html/demos/interception/sub-iframe.html @@ -0,0 +1,58 @@ + + + + + + Demo + + + injection from: +
+ cookie leak: no +
+ sub_iframe_1 blocked: yes +
+ sub_iframe_2 blocked: yes + + + diff --git a/html/interface-sample.html b/html/demos/interface/index.html similarity index 69% rename from html/interface-sample.html rename to html/demos/interface/index.html index 3b7a60e..38fe49d 100644 --- a/html/interface-sample.html +++ b/html/demos/interface/index.html @@ -1,379 +1,550 @@ Luminous: JavaScript events blocker - + - +
- 0.0.4help -
- -
-