3 Commits

8 changed files with 2479 additions and 2356 deletions

View File

@@ -1,314 +1,322 @@
{
"extensionName": {
"message": "I2P In Private Browsing",
"description": "Name of the extension."
},
"extensionNameVariant": {
"message": "I2P In Private Browsing - Rhizome Variant",
"description": "Name of the extension."
},
"toopieName": {
"message": "toopie.html",
"description": "Name of the sidebar."
},
"toopieTLS": {
"message": "Site Properties",
"description": "Name of the security panel."
},
"extensionDescription": {
"message": "Your browser is now set up to use I2P.",
"description": "Description of the extension."
},
"extensionVersion": {
"message": "1.28",
"description": "Version of the extension."
},
"proxyFailedStatus": {
"message": "Proxy is not ready",
"description": "Proxy failed status."
},
"proxySuccessStatus": {
"message": "Proxy is ready",
"description": "Proxy failed status."
},
"controlHeader": {
"message": "Control",
"description": "Headline for control panel."
},
"controlExplain": {
"message": "These controls are used to tailor your I2P Browsing Experience",
"description": "Introduce the control panel."
},
"clearData": {
"message": "Clear Browsing Data: ",
"description": "Clear Browsing Data menu item."
},
"clearDesc": {
"message": "Use this to erase your I2P browsing data.",
"description": "Clear browsing data action description."
},
"enableWebRTC": {
"message": "Enable WebRTC with proxy?",
"description": "WebRTC checkbox label."
},
"rtcDesc": {
"message": "WebRTC is disabled by default, but you can turn it back on and force it to honor the proxy. If you are a user of the Snowflake browser extension, this option is disabled and WebRTC is turned on by default.",
"description": "WebRTC action description"
},
"disableHistory": {
"message": "Disable History in I2P Tabs?",
"description": "History checkbox label."
},
"histDesc": {
"message": "History is automatically cleared when your I2P tabs are closed. If you want to clear history as you go, check this box.",
"description": "History action description"
},
"applicationHeader": {
"message": "Applications",
"description": "Header for applications section."
},
"applicationExplain": {
"message": "These applications work with I2P directly to provide them with security and privacy.",
"description": "Description for application section."
},
"windowVisitConsole": {
"message": "Router Console: ",
"description": "Router Console label."
},
"routerConsole": {
"message": "The entrypoint for all other I2P applications is the I2P Router Console. To visit it, click here.",
"description": "Description for the router console."
},
"windowVisitHomepage": {
"message": "Home Page: ",
"description": "Home page for the extension label."
},
"abouthome": {
"message": "For more information about this extension, visit this page.",
"description": "Description for the extension button page."
},
"windowVisitHelppage": {
"message": "Help Page: ",
"description": "Help page for the extension label."
},
"help": {
"message": "For more information about this extension, visit this page.",
"description": "Description for the extension button page."
},
"windowVisitI2ptunnel": {
"message": "Hidden Services Manager: ",
"description": "Title for i2ptunnel"
},
"i2ptunnel": {
"message": "I2P has a web-based interface for configuring .i2p services like web sites which you can set up.",
"description": "Description for i2ptunnel"
},
"windowVisitSusimail": {
"message": "E-Mail: ",
"description": "Title for e-mail"
},
"susimail": {
"message": "I2P also bundles a webmail client which can be used to access in-I2P e-mail.",
"description": "Description for e-mail"
},
"windowVisitSnark": {
"message": "Bittorrent: ",
"description": "Title for Bittorrent"
},
"snark": {
"message": "I2P is capable of anonymous Peer-to-Peer file sharing using the built-in bittorrent application.",
"description": "Description for Bittorrent"
},
"windowVisitSources": {
"message": "Extension Source Code: ",
"description": "Title for source code link"
},
"sources": {
"message": "Browse the source code here",
"description": "Description for the Source code link"
},
"windowVisitWebPage": {
"message": "Extension Home Page: ",
"description": "Visit extension homepage on Github"
},
"homepage": {
"message": "More information is available here",
"description": "Find more information"
},
"windowVisitReleases": {
"message": "Extension Releases: ",
"description": "Visit the release page"
},
"releases": {
"message": "Check for new releases here",
"description": "Description for new release page"
},
"titlePreface": {
"message": "I2P Browser",
"description": "Preface for the browser titlebar"
},
"titlePrefacePrivate": {
"message": "I2P Browser (Private)",
"description": "Preface for the browser titlebar"
},
"extensionPreface": {
"message": "I2P Management",
"description": "Preface for the browser titlebar"
},
"webPreface": {
"message": "Web Browser",
"description": "Preface for the browser titlebar"
},
"webPrefacePrivate": {
"message": "Web Browser (Private)",
"description": "Preface for the browser titlebar"
},
"ircPreface": {
"message": "Dispatch IRC",
"description": "Preface for the browser titlebar"
},
"ircPrefacePrivate": {
"message": "Dispatch IRC (Private)",
"description": "Preface for the browser titlebar"
},
"blogPreface": {
"message": "Blog",
"description": "Preface for the browser titlebar"
},
"blogPrefacePrivate": {
"message": "Blog (Private)",
"description": "Preface for the browser titlebar"
},
"botePreface": {
"message": "I2P-Bote Mail",
"description": "Preface for the browser titlebar"
},
"botePrefacePrivate": {
"message": "I2P-Bote Mail (Private)",
"description": "Preface for the browser titlebar"
},
"routerPreface": {
"message": "Router Console",
"description": "Preface for the browser titlebar"
},
"routerPrefacePrivate": {
"message": "Router Console (Private)",
"description": "Preface for the browser titlebar"
},
"torrentPreface": {
"message": "Bittorrent",
"description": "Preface for the browser titlebar"
},
"torrentPrefacePrivate": {
"message": "Bittorrent (Private)",
"description": "Preface for the browser titlebar"
},
"mailPreface": {
"message": "Web Mail",
"description": "Preface for the browser titlebar"
},
"mailPrefacePrivate": {
"message": "Web Mail (Private)",
"description": "Preface for the browser titlebar"
},
"i2ptunnelPreface": {
"message": "Hidden Services Manager",
"description": "Preface for the browser titlebar"
},
"i2ptunnelPrefacePrivate": {
"message": "Hidden Services Manager (Private)",
"description": "Preface for the browser titlebar"
},
"muwirePreface": {
"message": "MuWire",
"description": "Preface for the browser titlebar"
},
"muwirePrefacePrivate": {
"message": "MuWire (Private)",
"description": "Preface for the browser titlebar"
},
"resetMessage": {
"message": "Reset Tunnel",
"description": "Message for the Reset Tunnel button"
},
"infoTitle": {
"message": "I2P Help",
"description": "Title for the help menu"
},
"infoMessage": {
"message": "You are now free to browse the eepWeb! Your browser is now configured to browse anonymously on the I2P network. As you browse, your traffic will be routed through other network nodes to disguise it's origin, both from the server and from the nodes themselves.",
"description": "Help Message"
},
"helpMessage": {
"message": "Get additional help",
"description": "Help Message"
},
"newsMessage": {
"message": "Visit the I2P Blog to learn the latest about i2p.",
"description": "Help Message"
},
"forumMessage": {
"message": "Visit the I2P Forum to learn more or ask for assistance",
"description": "Help Message"
},
"proxyHelpText": {
"message": "Configure your I2P proxy here.",
"description": "Help for configuring the options for the Reset Tunnel button"
},
"hostText": {
"message": "Host: ",
"description": "Host for the HTTP or SOCKS5 Proxy"
},
"portText": {
"message": "Port: ",
"description": "Port for the HTTP or SOCKS5 Proxy"
},
"controlHelpText": {
"message": "Configure your router console here.",
"description": "Help for configuring the options for the Reset Tunnel button"
},
"controlHostText": {
"message": "Control Host: ",
"description": "Host for the Router Console"
},
"controlPortText": {
"message": "Control Port: ",
"description": "Port for the Router Console"
},
"controlHostValue": {
"message": "127.0.0.1",
"description": "Host for the Router Console"
},
"controlPortValue": {
"message": "7657",
"description": "Port for the Router Console"
},
"isBase32": {
"message": "I2P Base32-Formatted Address",
"description": "Message for site info panel base32"
},
"isHostName": {
"message": "I2P Jump Hostname",
"description": "Message for the site info panel hostname"
},
"siteLabel": {
"message": "Address/Site Information:",
"description": "Label for i2p site info"
},
"certLabel": {
"message": "Certificate Information:",
"description": "Label for certificate info"
},
"certAbsent": {
"message": "This site is not using HTTPS. It is still verified cryptographically by I2P.",
"description": "Content for certificate info if absent"
},
"certPresent": {
"message": "This site is using HTTPS. HTTPS over I2P is experimental and requires self-signed certificates or alternate root authorites.",
"description": "Content for certificate info if present"
},
"protocolHandlerValue": {
"message": "http://127.0.0.1:7657/i2psnark/?nofilter_newURL=%s&action=Add&foo=Add+torrent",
"description": "Value for the magnet protocol handler"
}
}
"extensionName": {
"message": "I2P In Private Browsing",
"description": "Name of the extension."
},
"extensionNameVariant": {
"message": "I2P In Private Browsing - Rhizome Variant",
"description": "Name of the extension."
},
"toopieName": {
"message": "toopie.html",
"description": "Name of the sidebar."
},
"toopieTLS": {
"message": "Site Properties",
"description": "Name of the security panel."
},
"extensionDescription": {
"message": "Your browser is now set up to use I2P.",
"description": "Description of the extension."
},
"extensionVersion": {
"message": "1.28",
"description": "Version of the extension."
},
"proxyFailedStatus": {
"message": "Proxy is not ready",
"description": "Proxy failed status."
},
"proxySuccessStatus": {
"message": "Proxy is ready",
"description": "Proxy failed status."
},
"controlHeader": {
"message": "Control",
"description": "Headline for control panel."
},
"controlExplain": {
"message": "These controls are used to tailor your I2P Browsing Experience",
"description": "Introduce the control panel."
},
"clearData": {
"message": "Clear Browsing Data: ",
"description": "Clear Browsing Data menu item."
},
"clearDesc": {
"message": "Use this to erase your I2P browsing data.",
"description": "Clear browsing data action description."
},
"enableWebRTC": {
"message": "Enable WebRTC with proxy?",
"description": "WebRTC checkbox label."
},
"rtcDesc": {
"message": "WebRTC is disabled by default, but you can turn it back on and force it to honor the proxy. If you are a user of the Snowflake browser extension, this option is disabled and WebRTC is turned on by default.",
"description": "WebRTC action description"
},
"disableHistory": {
"message": "Disable History in I2P Tabs?",
"description": "History checkbox label."
},
"histDesc": {
"message": "History is automatically cleared when your I2P tabs are closed. If you want to clear history as you go, check this box.",
"description": "History action description"
},
"applicationHeader": {
"message": "Applications",
"description": "Header for applications section."
},
"applicationExplain": {
"message": "These applications work with I2P directly to provide them with security and privacy.",
"description": "Description for application section."
},
"windowVisitConsole": {
"message": "Router Console: ",
"description": "Router Console label."
},
"routerConsole": {
"message": "The entrypoint for all other I2P applications is the I2P Router Console. To visit it, click here.",
"description": "Description for the router console."
},
"windowVisitHomepage": {
"message": "Home Page: ",
"description": "Home page for the extension label."
},
"abouthome": {
"message": "For more information about this extension, visit this page.",
"description": "Description for the extension button page."
},
"windowVisitHelppage": {
"message": "Help Page: ",
"description": "Help page for the extension label."
},
"help": {
"message": "For more information about this extension, visit this page.",
"description": "Description for the extension button page."
},
"windowVisitI2ptunnel": {
"message": "Hidden Services Manager: ",
"description": "Title for i2ptunnel"
},
"i2ptunnel": {
"message": "I2P has a web-based interface for configuring .i2p services like web sites which you can set up.",
"description": "Description for i2ptunnel"
},
"windowVisitSusimail": {
"message": "E-Mail: ",
"description": "Title for e-mail"
},
"susimail": {
"message": "I2P also bundles a webmail client which can be used to access in-I2P e-mail.",
"description": "Description for e-mail"
},
"windowVisitSnark": {
"message": "Bittorrent: ",
"description": "Title for Bittorrent"
},
"snark": {
"message": "I2P is capable of anonymous Peer-to-Peer file sharing using the built-in bittorrent application.",
"description": "Description for Bittorrent"
},
"windowVisitSources": {
"message": "Extension Source Code: ",
"description": "Title for source code link"
},
"sources": {
"message": "Browse the source code here",
"description": "Description for the Source code link"
},
"windowVisitWebPage": {
"message": "Extension Home Page: ",
"description": "Visit extension homepage on Github"
},
"homepage": {
"message": "More information is available here",
"description": "Find more information"
},
"windowVisitReleases": {
"message": "Extension Releases: ",
"description": "Visit the release page"
},
"releases": {
"message": "Check for new releases here",
"description": "Description for new release page"
},
"titlePreface": {
"message": "I2P Browser",
"description": "Preface for the browser titlebar"
},
"titlePrefacePrivate": {
"message": "I2P Browser (Private)",
"description": "Preface for the browser titlebar"
},
"extensionPreface": {
"message": "I2P Management",
"description": "Preface for the browser titlebar"
},
"torPreface": {
"message": "Tor Management",
"description": "Preface for the browser titlebar"
},
"reseedPreface": {
"message": "Reseed Management",
"description": "Preface for the browser titlebar"
},
"webPreface": {
"message": "Web Browser",
"description": "Preface for the browser titlebar"
},
"webPrefacePrivate": {
"message": "Web Browser (Private)",
"description": "Preface for the browser titlebar"
},
"ircPreface": {
"message": "Dispatch IRC",
"description": "Preface for the browser titlebar"
},
"ircPrefacePrivate": {
"message": "Dispatch IRC (Private)",
"description": "Preface for the browser titlebar"
},
"blogPreface": {
"message": "Blog",
"description": "Preface for the browser titlebar"
},
"blogPrefacePrivate": {
"message": "Blog (Private)",
"description": "Preface for the browser titlebar"
},
"botePreface": {
"message": "I2P-Bote Mail",
"description": "Preface for the browser titlebar"
},
"botePrefacePrivate": {
"message": "I2P-Bote Mail (Private)",
"description": "Preface for the browser titlebar"
},
"routerPreface": {
"message": "Router Console",
"description": "Preface for the browser titlebar"
},
"routerPrefacePrivate": {
"message": "Router Console (Private)",
"description": "Preface for the browser titlebar"
},
"torrentPreface": {
"message": "Bittorrent",
"description": "Preface for the browser titlebar"
},
"torrentPrefacePrivate": {
"message": "Bittorrent (Private)",
"description": "Preface for the browser titlebar"
},
"mailPreface": {
"message": "Web Mail",
"description": "Preface for the browser titlebar"
},
"mailPrefacePrivate": {
"message": "Web Mail (Private)",
"description": "Preface for the browser titlebar"
},
"i2ptunnelPreface": {
"message": "Hidden Services Manager",
"description": "Preface for the browser titlebar"
},
"i2ptunnelPrefacePrivate": {
"message": "Hidden Services Manager (Private)",
"description": "Preface for the browser titlebar"
},
"muwirePreface": {
"message": "MuWire",
"description": "Preface for the browser titlebar"
},
"muwirePrefacePrivate": {
"message": "MuWire (Private)",
"description": "Preface for the browser titlebar"
},
"resetMessage": {
"message": "Reset Tunnel",
"description": "Message for the Reset Tunnel button"
},
"infoTitle": {
"message": "I2P Help",
"description": "Title for the help menu"
},
"infoMessage": {
"message": "You are now free to browse the eepWeb! Your browser is now configured to browse anonymously on the I2P network. As you browse, your traffic will be routed through other network nodes to disguise it's origin, both from the server and from the nodes themselves.",
"description": "Help Message"
},
"helpMessage": {
"message": "Get additional help",
"description": "Help Message"
},
"newsMessage": {
"message": "Visit the I2P Blog to learn the latest about i2p.",
"description": "Help Message"
},
"forumMessage": {
"message": "Visit the I2P Forum to learn more or ask for assistance",
"description": "Help Message"
},
"proxyHelpText": {
"message": "Configure your I2P proxy here.",
"description": "Help for configuring the options for the Reset Tunnel button"
},
"hostText": {
"message": "Host: ",
"description": "Host for the HTTP or SOCKS5 Proxy"
},
"portText": {
"message": "Port: ",
"description": "Port for the HTTP or SOCKS5 Proxy"
},
"controlHelpText": {
"message": "Configure your router console here.",
"description": "Help for configuring the options for the Reset Tunnel button"
},
"controlHostText": {
"message": "Control Host: ",
"description": "Host for the Router Console"
},
"controlPortText": {
"message": "Control Port: ",
"description": "Port for the Router Console"
},
"controlHostValue": {
"message": "127.0.0.1",
"description": "Host for the Router Console"
},
"controlPortValue": {
"message": "7657",
"description": "Port for the Router Console"
},
"isBase32": {
"message": "I2P Base32-Formatted Address",
"description": "Message for site info panel base32"
},
"isHostName": {
"message": "I2P Jump Hostname",
"description": "Message for the site info panel hostname"
},
"siteLabel": {
"message": "Address/Site Information:",
"description": "Label for i2p site info"
},
"certLabel": {
"message": "Certificate Information:",
"description": "Label for certificate info"
},
"certAbsent": {
"message": "This site is not using HTTPS. It is still verified cryptographically by I2P.",
"description": "Content for certificate info if absent"
},
"certPresent": {
"message": "This site is using HTTPS. HTTPS over I2P is experimental and requires self-signed certificates or alternate root authorites.",
"description": "Content for certificate info if present"
},
"protocolHandlerValue": {
"message": "http://127.0.0.1:7657/i2psnark/?nofilter_newURL=%s&action=Add&foo=Add+torrent",
"description": "Value for the magnet protocol handler"
}
}

View File

@@ -1,314 +1,322 @@
{
"extensionName": {
"message": "I2P en navegación privada",
"description": "Nombre de la extensión."
},
"extensionNameVariant": {
"message": "I2P en navegación privada - Rhizome",
"description": "Nombre de la extensión."
},
"toopieName": {
"message": "toopie.html",
"description": "Nombre de la barra lateral."
},
"toopieTLS": {
"message": "Propiedades del sitio",
"description": "Nombre del panel de seguridad."
},
"extensionDescription": {
"message": "Su navegador ahora está configurado para usar I2P.",
"description": "Descripción de la extensión."
},
"extensionVersion": {
"message": "1.28",
"description": "Versión de la extensión."
},
"proxyFailedStatus": {
"message": "El proxy no está listo",
"description": "Estado fallido del proxy."
},
"proxySuccessStatus": {
"message": "El proxy está listo",
"description": "Estado fallido del proxy."
},
"controlHeader": {
"message": "Control",
"description": "Título del panel de control."
},
"controlExplain": {
"message": "Estos controles se utilizan para personalizar su experiencia de navegación I2P",
"description": "Introduce el panel de control."
},
"clearData": {
"message": "Borrar datos de navegación:",
"description": "Elemento de menú Borrar datos de navegación."
},
"clearDesc": {
"message": "Use esto para borrar sus datos de navegación I2P.",
"description": "Borrar descripción de la acción de datos de navegación."
},
"enableWebRTC": {
"message": "¿Habilitar WebRTC con proxy?",
"description": "Etiqueta de casilla de verificación de WebRTC."
},
"rtcDesc": {
"message": "WebRTC está deshabilitado de forma predeterminada, pero puede volver a encenderlo y forzarlo para que respete el proxy. Si es un usuario de la extensión del navegador Snowflake, esta opción está deshabilitada y WebRTC está activado de forma predeterminada.",
"description": "Descripción de la acción de WebRTC"
},
"disableHistory": {
"message": "¿Deshabilitar el historial en las pestañas I2P?",
"description": "Etiqueta de casilla de verificación del historial."
},
"histDesc": {
"message": "El historial se borra automáticamente cuando se cierran las pestañas de I2P. Si desea borrar el historial sobre la marcha, marque esta casilla.",
"description": "Descripción de la acción del historial"
},
"applicationHeader": {
"message": "Aplicaciones",
"description": "Encabezado de la sección de aplicaciones."
},
"applicationExplain": {
"message": "Estas aplicaciones funcionan con I2P directamente para brindarles seguridad y privacidad.",
"description": "Descripción de la sección de aplicación."
},
"windowVisitConsole": {
"message": "Consola del enrutador:",
"description": "Etiqueta de la consola del enrutador."
},
"routerConsole": {
"message": "El punto de entrada para todas las demás aplicaciones I2P es la consola del enrutador I2P. Para visitarla, haga clic aquí.",
"description": "Descripción de la consola del enrutador."
},
"windowVisitHomepage": {
"message": "Página de inicio:",
"description": "Página de inicio para la etiqueta de extensión."
},
"abouthome": {
"message": "Para obtener más información sobre esta extensión, visite esta página.",
"description": "Descripción de la página del botón de extensión."
},
"windowVisitHelppage": {
"message": "Página de ayuda:",
"description": "Página de ayuda para la etiqueta de extensión."
},
"help": {
"message": "Para obtener más información sobre esta extensión, visite esta página.",
"description": "Descripción de la página del botón de extensión."
},
"windowVisitI2ptunnel": {
"message": "Administrador de servicios ocultos:",
"description": "Título para i2ptunnel"
},
"i2ptunnel": {
"message": "I2P tiene una interfaz basada en web para configurar servicios .i2p como sitios web que puede configurar.",
"description": "Descripción de i2ptunnel"
},
"windowVisitSusimail": {
"message": "Correo electrónico:",
"descripción": "Título del correo electrónico"
},
"susimail": {
"message": "I2P también incluye un cliente de correo web que se puede utilizar para acceder al correo electrónico in-I2P.",
"description": "Descripción para correo electrónico"
},
"windowVisitSnark": {
"message": "Bittorrent:",
"description": "Título para Bittorrent"
},
"snark": {
"message": "I2P es capaz de compartir archivos de igual a igual de forma anónima utilizando la aplicación bittorrent incorporada.",
"description": "Descripción de Bittorrent"
},
"windowVisitSources": {
"message": "Código fuente de extensión:",
"description": "Título del enlace del código fuente"
},
"sources": {
"message": "Examine el código fuente aquí",
"description": "Descripción del enlace del código fuente"
},
"windowVisitWebPage": {
"message": "Página de inicio de la extensión:",
"description": "Visita la página de inicio de la extensión en Github"
},
"homepage": {
"message": "Hay más información disponible aquí",
"description": "Encontrar más información"
},
"windowVisitReleases": {
"message": "Extension Releases:",
"description": "Visite la página de lanzamiento"
},
"releases": {
"message": "Compruebe si hay nuevas versiones aquí",
"description": "Descripción de la nueva página de lanzamiento"
},
"titlePreface": {
"message": "Navegador I2P",
"description": "Prefacio de la barra de título del navegador"
},
"titlePrefacePrivate": {
"message": "Navegador I2P (privado)",
"description": "Prefacio de la barra de título del navegador"
},
"extensionPreface": {
"message": "Gestión I2P",
"description": "Prefacio de la barra de título del navegador"
},
"webPreface": {
"message": "Navegador web",
"description": "Prefacio de la barra de título del navegador"
},
"webPrefacePrivate": {
"message": "Navegador web (privado)",
"description": "Prefacio de la barra de título del navegador"
},
"ircPreface": {
"message": "Envío de IRC",
"description": "Prefacio de la barra de título del navegador"
},
"ircPrefacePrivate": {
"message": "Despacho de IRC (privado)",
"description": "Prefacio de la barra de título del navegador"
},
"blogPreface": {
"message": "Blog",
"description": "Prefacio de la barra de título del navegador"
},
"blogPrefacePrivate": {
"message": "Blog (Private)",
"description": "Prefacio de la barra de título del navegador"
},
"botePreface": {
"message": "I2P-Bote Mail",
"description": "Prefacio de la barra de título del navegador"
},
"botePrefacePrivate": {
"message": "I2P-Bote Mail (privado)",
"description": "Prefacio de la barra de título del navegador"
},
"routerPreface": {
"message": "Consola del enrutador",
"description": "Prefacio de la barra de título del navegador"
},
"routerPrefacePrivate": {
"message": "Consola del enrutador (privada)",
"description": "Prefacio de la barra de título del navegador"
},
"torrentPreface": {
"message": "Bittorrent",
"description": "Prefacio de la barra de título del navegador"
},
"torrentPrefacePrivate": {
"message": "Bittorrent (privado)",
"description": "Prefacio de la barra de título del navegador"
},
"mailPreface": {
"message": "Correo web",
"description": "Prefacio de la barra de título del navegador"
},
"mailPrefacePrivate": {
"message": "Correo web (privado)",
"description": "Prefacio de la barra de título del navegador"
},
"i2ptunnelPreface": {
"message": "Administrador de servicios ocultos",
"description": "Prefacio de la barra de título del navegador"
},
"i2ptunnelPrefacePrivate": {
"message": "Administrador de servicios ocultos (privado)",
"description": "Prefacio de la barra de título del navegador"
},
"muwirePreface": {
"message": "MuWire",
"description": "Prefacio de la barra de título del navegador"
},
"muwirePrefacePrivate": {
"message": "MuWire (privado)",
"description": "Prefacio de la barra de título del navegador"
},
"resetMessage": {
"message": "Reset Tunnel",
"description": "Mensaje para el botón Reset Tunnel"
},
"infoTitle": {
"message": "Ayuda I2P",
"description": "Título del menú de ayuda"
},
"infoMessage": {
"message": "¡Ahora puede navegar libremente por eepWeb! Su navegador ahora está configurado para navegar de forma anónima en la red I2P. Mientras navega, su tráfico se enrutará a través de otros nodos de red para disfrazar su origen, tanto desde el servidor de los propios nodos. ",
"description": "Mensaje de ayuda"
},
"helpMessage": {
"message": "Obtén ayuda adicional",
"description": "Mensaje de ayuda"
},
"newsMessage": {
"message": "Visite el blog de I2P para conocer las últimas novedades sobre i2p.",
"description": "Mensaje de ayuda"
},
"forumMessage": {
"message": "Visite el Foro I2P para obtener más información o solicitar ayuda",
"description": "Mensaje de ayuda"
},
"proxyHelpText": {
"message": "Configure aquí su proxy I2P",
"description": "Ayuda para configurar las opciones del botón Reset Tunnel"
},
"hostText": {
"message": "Anfitrión:",
"description": "Host para el proxy HTTP o SOCKS5"
},
"portText": {
"message": "Puerto:",
"description": "Puerto para el proxy HTTP o SOCKS5"
},
"controlHelpText": {
"message": "Configure aquí la consola de su enrutador.",
"description": "Ayuda para configurar las opciones del botón Reset Tunnel"
},
"controlHostText": {
"message": "Host de control:",
"description": "Host para la consola del enrutador"
},
"controlPortText": {
"message": "Puerto de control:",
"description": "Puerto para la consola del enrutador"
},
"controlHostValue": {
"message": "127.0.0.1",
"description": "Host para la consola del enrutador"
},
"controlPortValue": {
"message": "7657",
"description": "Puerto para la consola del enrutador"
},
"isBase32": {
"message": "Dirección con formato I2P Base32",
"description": "Mensaje para el panel de información del sitio base32"
},
"isHostName": {
"message": "Nombre de host de salto I2P",
"description": "Mensaje para el nombre de host del panel de información del sitio"
},
"siteLabel": {
"message": "Dirección / Información del sitio:",
"description": "Etiqueta para la información del sitio i2p"
},
"certLabel": {
"message": "Información del certificado:",
"description": "Etiqueta para la información del certificado"
},
"certAbsent": {
"message": "Este sitio no está usando HTTPS. I2P aún lo verifica criptográficamente.",
"description": "Contenido de la información del certificado si no está"
},
"certPresent": {
"message": "Este sitio utiliza HTTPS. HTTPS sobre I2P es experimental y requiere certificados autofirmados o autorizaciones raíz alternativas.",
"description": "Contenido de la información del certificado si está presente"
},
"protocolHandlerValue": {
"message": "http://127.0.0.1:7657/i2psnark/?nofilter_newURL=%s&action=Add&foo=Add+torrent",
"description": "Valor para el controlador de protocolo magnético"
}
}
"extensionName": {
"message": "I2P en navegación privada",
"description": "Nombre de la extensión."
},
"extensionNameVariant": {
"message": "I2P en navegación privada - Rhizome",
"description": "Nombre de la extensión."
},
"toopieName": {
"message": "toopie.html",
"description": "Nombre de la barra lateral."
},
"toopieTLS": {
"message": "Propiedades del sitio",
"description": "Nombre del panel de seguridad."
},
"extensionDescription": {
"message": "Su navegador ahora está configurado para usar I2P.",
"description": "Descripción de la extensión."
},
"extensionVersion": {
"message": "1.28",
"description": "Versión de la extensión."
},
"proxyFailedStatus": {
"message": "El proxy no está listo",
"description": "Estado fallido del proxy."
},
"proxySuccessStatus": {
"message": "El proxy está listo",
"description": "Estado fallido del proxy."
},
"controlHeader": {
"message": "Control",
"description": "Título del panel de control."
},
"controlExplain": {
"message": "Estos controles se utilizan para personalizar su experiencia de navegación I2P",
"description": "Introduce el panel de control."
},
"clearData": {
"message": "Borrar datos de navegación:",
"description": "Elemento de menú Borrar datos de navegación."
},
"clearDesc": {
"message": "Use esto para borrar sus datos de navegación I2P.",
"description": "Borrar descripción de la acción de datos de navegación."
},
"enableWebRTC": {
"message": "¿Habilitar WebRTC con proxy?",
"description": "Etiqueta de casilla de verificación de WebRTC."
},
"rtcDesc": {
"message": "WebRTC está deshabilitado de forma predeterminada, pero puede volver a encenderlo y forzarlo para que respete el proxy. Si es un usuario de la extensión del navegador Snowflake, esta opción está deshabilitada y WebRTC está activado de forma predeterminada.",
"description": "Descripción de la acción de WebRTC"
},
"disableHistory": {
"message": "¿Deshabilitar el historial en las pestañas I2P?",
"description": "Etiqueta de casilla de verificación del historial."
},
"histDesc": {
"message": "El historial se borra automáticamente cuando se cierran las pestañas de I2P. Si desea borrar el historial sobre la marcha, marque esta casilla.",
"description": "Descripción de la acción del historial"
},
"applicationHeader": {
"message": "Aplicaciones",
"description": "Encabezado de la sección de aplicaciones."
},
"applicationExplain": {
"message": "Estas aplicaciones funcionan con I2P directamente para brindarles seguridad y privacidad.",
"description": "Descripción de la sección de aplicación."
},
"windowVisitConsole": {
"message": "Consola del enrutador:",
"description": "Etiqueta de la consola del enrutador."
},
"routerConsole": {
"message": "El punto de entrada para todas las demás aplicaciones I2P es la consola del enrutador I2P. Para visitarla, haga clic aquí.",
"description": "Descripción de la consola del enrutador."
},
"windowVisitHomepage": {
"message": "Página de inicio:",
"description": "Página de inicio para la etiqueta de extensión."
},
"abouthome": {
"message": "Para obtener más información sobre esta extensión, visite esta página.",
"description": "Descripción de la página del botón de extensión."
},
"windowVisitHelppage": {
"message": "Página de ayuda:",
"description": "Página de ayuda para la etiqueta de extensión."
},
"help": {
"message": "Para obtener más información sobre esta extensión, visite esta página.",
"description": "Descripción de la página del botón de extensión."
},
"windowVisitI2ptunnel": {
"message": "Administrador de servicios ocultos:",
"description": "Título para i2ptunnel"
},
"i2ptunnel": {
"message": "I2P tiene una interfaz basada en web para configurar servicios .i2p como sitios web que puede configurar.",
"description": "Descripción de i2ptunnel"
},
"windowVisitSusimail": {
"message": "Correo electrónico:",
"descripción": "Título del correo electrónico"
},
"susimail": {
"message": "I2P también incluye un cliente de correo web que se puede utilizar para acceder al correo electrónico in-I2P.",
"description": "Descripción para correo electrónico"
},
"windowVisitSnark": {
"message": "Bittorrent:",
"description": "Título para Bittorrent"
},
"snark": {
"message": "I2P es capaz de compartir archivos de igual a igual de forma anónima utilizando la aplicación bittorrent incorporada.",
"description": "Descripción de Bittorrent"
},
"windowVisitSources": {
"message": "Código fuente de extensión:",
"description": "Título del enlace del código fuente"
},
"sources": {
"message": "Examine el código fuente aquí",
"description": "Descripción del enlace del código fuente"
},
"windowVisitWebPage": {
"message": "Página de inicio de la extensión:",
"description": "Visita la página de inicio de la extensión en Github"
},
"homepage": {
"message": "Hay más información disponible aquí",
"description": "Encontrar más información"
},
"windowVisitReleases": {
"message": "Extension Releases:",
"description": "Visite la página de lanzamiento"
},
"releases": {
"message": "Compruebe si hay nuevas versiones aquí",
"description": "Descripción de la nueva página de lanzamiento"
},
"titlePreface": {
"message": "Navegador I2P",
"description": "Prefacio de la barra de título del navegador"
},
"titlePrefacePrivate": {
"message": "Navegador I2P (privado)",
"description": "Prefacio de la barra de título del navegador"
},
"extensionPreface": {
"message": "Gestión I2P",
"description": "Prefacio de la barra de título del navegador"
},
"torPreface": {
"message": "Tor Management",
"description": "Preface for the browser titlebar"
},
"reseedPreface": {
"message": "Reseed Management",
"description": "Preface for the browser titlebar"
},
"webPreface": {
"message": "Navegador web",
"description": "Prefacio de la barra de título del navegador"
},
"webPrefacePrivate": {
"message": "Navegador web (privado)",
"description": "Prefacio de la barra de título del navegador"
},
"ircPreface": {
"message": "Envío de IRC",
"description": "Prefacio de la barra de título del navegador"
},
"ircPrefacePrivate": {
"message": "Despacho de IRC (privado)",
"description": "Prefacio de la barra de título del navegador"
},
"blogPreface": {
"message": "Blog",
"description": "Prefacio de la barra de título del navegador"
},
"blogPrefacePrivate": {
"message": "Blog (Private)",
"description": "Prefacio de la barra de título del navegador"
},
"botePreface": {
"message": "I2P-Bote Mail",
"description": "Prefacio de la barra de título del navegador"
},
"botePrefacePrivate": {
"message": "I2P-Bote Mail (privado)",
"description": "Prefacio de la barra de título del navegador"
},
"routerPreface": {
"message": "Consola del enrutador",
"description": "Prefacio de la barra de título del navegador"
},
"routerPrefacePrivate": {
"message": "Consola del enrutador (privada)",
"description": "Prefacio de la barra de título del navegador"
},
"torrentPreface": {
"message": "Bittorrent",
"description": "Prefacio de la barra de título del navegador"
},
"torrentPrefacePrivate": {
"message": "Bittorrent (privado)",
"description": "Prefacio de la barra de título del navegador"
},
"mailPreface": {
"message": "Correo web",
"description": "Prefacio de la barra de título del navegador"
},
"mailPrefacePrivate": {
"message": "Correo web (privado)",
"description": "Prefacio de la barra de título del navegador"
},
"i2ptunnelPreface": {
"message": "Administrador de servicios ocultos",
"description": "Prefacio de la barra de título del navegador"
},
"i2ptunnelPrefacePrivate": {
"message": "Administrador de servicios ocultos (privado)",
"description": "Prefacio de la barra de título del navegador"
},
"muwirePreface": {
"message": "MuWire",
"description": "Prefacio de la barra de título del navegador"
},
"muwirePrefacePrivate": {
"message": "MuWire (privado)",
"description": "Prefacio de la barra de título del navegador"
},
"resetMessage": {
"message": "Reset Tunnel",
"description": "Mensaje para el botón Reset Tunnel"
},
"infoTitle": {
"message": "Ayuda I2P",
"description": "Título del menú de ayuda"
},
"infoMessage": {
"message": "¡Ahora puede navegar libremente por eepWeb! Su navegador ahora está configurado para navegar de forma anónima en la red I2P. Mientras navega, su tráfico se enrutará a través de otros nodos de red para disfrazar su origen, tanto desde el servidor de los propios nodos. ",
"description": "Mensaje de ayuda"
},
"helpMessage": {
"message": "Obtén ayuda adicional",
"description": "Mensaje de ayuda"
},
"newsMessage": {
"message": "Visite el blog de I2P para conocer las últimas novedades sobre i2p.",
"description": "Mensaje de ayuda"
},
"forumMessage": {
"message": "Visite el Foro I2P para obtener más información o solicitar ayuda",
"description": "Mensaje de ayuda"
},
"proxyHelpText": {
"message": "Configure aquí su proxy I2P",
"description": "Ayuda para configurar las opciones del botón Reset Tunnel"
},
"hostText": {
"message": "Anfitrión:",
"description": "Host para el proxy HTTP o SOCKS5"
},
"portText": {
"message": "Puerto:",
"description": "Puerto para el proxy HTTP o SOCKS5"
},
"controlHelpText": {
"message": "Configure aquí la consola de su enrutador.",
"description": "Ayuda para configurar las opciones del botón Reset Tunnel"
},
"controlHostText": {
"message": "Host de control:",
"description": "Host para la consola del enrutador"
},
"controlPortText": {
"message": "Puerto de control:",
"description": "Puerto para la consola del enrutador"
},
"controlHostValue": {
"message": "127.0.0.1",
"description": "Host para la consola del enrutador"
},
"controlPortValue": {
"message": "7657",
"description": "Puerto para la consola del enrutador"
},
"isBase32": {
"message": "Dirección con formato I2P Base32",
"description": "Mensaje para el panel de información del sitio base32"
},
"isHostName": {
"message": "Nombre de host de salto I2P",
"description": "Mensaje para el nombre de host del panel de información del sitio"
},
"siteLabel": {
"message": "Dirección / Información del sitio:",
"description": "Etiqueta para la información del sitio i2p"
},
"certLabel": {
"message": "Información del certificado:",
"description": "Etiqueta para la información del certificado"
},
"certAbsent": {
"message": "Este sitio no está usando HTTPS. I2P aún lo verifica criptográficamente.",
"description": "Contenido de la información del certificado si no está"
},
"certPresent": {
"message": "Este sitio utiliza HTTPS. HTTPS sobre I2P es experimental y requiere certificados autofirmados o autorizaciones raíz alternativas.",
"description": "Contenido de la información del certificado si está presente"
},
"protocolHandlerValue": {
"message": "http://127.0.0.1:7657/i2psnark/?nofilter_newURL=%s&action=Add&foo=Add+torrent",
"description": "Valor para el controlador de protocolo magnético"
}
}

View File

@@ -18,447 +18,469 @@ var muwireprefpriv = chrome.i18n.getMessage('muwirePrefacePrivate');
var botepref = chrome.i18n.getMessage('botePreface');
var blogpref = chrome.i18n.getMessage('blogPreface');
var blogprefpriv = chrome.i18n.getMessage('blogPrefacePrivate');
var torpref = chrome.i18n.getMessage('torPreface');
var reseedpref = chrome.i18n.getMessage('reseedPreface');
function onError(err) {
console.log('(background)', err);
console.log('(background)', err);
}
function onContextGotLog(contexts) {
if (contexts != null) {
console.log(contexts);
}
if (contexts != null) {
console.log(contexts);
}
}
function onContextsGot(contexts) {
var ids = [];
for (let context of contexts) {
console.log(`Name : ${context.name}`);
ids.push(context.name);
}
console.log('Checking new contexts');
if (ids.indexOf(titlepref) == -1) {
browser.contextualIdentities
.create({
name: titlepref,
color: 'orange',
icon: 'fingerprint'
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(blogpref) == -1) {
browser.contextualIdentities
.create({
name: blogpref,
color: 'pink',
icon: 'pet'
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(webpref) == -1) {
browser.contextualIdentities
.create({
name: webpref,
color: 'red',
icon: 'circle'
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(routerpref) == -1) {
browser.contextualIdentities
.create({
name: routerpref,
color: 'blue',
icon: 'briefcase'
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(tunnelpref) == -1) {
browser.contextualIdentities
.create({
name: tunnelpref,
color: 'green',
icon: 'tree'
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(mailpref) == -1) {
browser.contextualIdentities
.create({
name: mailpref,
color: 'yellow',
icon: 'briefcase'
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(torrentpref) == -1) {
browser.contextualIdentities
.create({
name: torrentpref,
color: 'purple',
icon: 'chill'
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(ircpref) == -1) {
browser.contextualIdentities
.create({
name: ircpref,
color: 'red',
icon: 'vacation'
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(muwirepref) == -1) {
browser.contextualIdentities
.create({
name: muwirepref,
color: 'turquoise',
icon: 'gift'
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(botepref) == -1) {
browser.contextualIdentities
.create({
name: botepref,
color: 'blue',
icon: 'fence'
})
.then(onCreated, onNotCreated);
}
var ids = [];
for (let context of contexts) {
console.log(`Name : ${context.name}`);
ids.push(context.name);
}
console.log('Checking new contexts');
if (ids.indexOf(titlepref) == -1) {
browser.contextualIdentities
.create({
name: titlepref,
color: 'orange',
icon: 'fingerprint'
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(blogpref) == -1) {
browser.contextualIdentities
.create({
name: blogpref,
color: 'pink',
icon: 'pet'
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(webpref) == -1) {
browser.contextualIdentities
.create({
name: webpref,
color: 'red',
icon: 'circle'
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(routerpref) == -1) {
browser.contextualIdentities
.create({
name: routerpref,
color: 'blue',
icon: 'briefcase'
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(tunnelpref) == -1) {
browser.contextualIdentities
.create({
name: tunnelpref,
color: 'green',
icon: 'tree'
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(mailpref) == -1) {
browser.contextualIdentities
.create({
name: mailpref,
color: 'yellow',
icon: 'briefcase'
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(torrentpref) == -1) {
browser.contextualIdentities
.create({
name: torrentpref,
color: 'purple',
icon: 'chill'
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(ircpref) == -1) {
browser.contextualIdentities
.create({
name: ircpref,
color: 'red',
icon: 'vacation'
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(muwirepref) == -1) {
browser.contextualIdentities
.create({
name: muwirepref,
color: 'turquoise',
icon: 'gift'
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(botepref) == -1) {
browser.contextualIdentities
.create({
name: botepref,
color: 'blue',
icon: 'fence'
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(torpref) == -1) {
browser.contextualIdentities
.create({
name: torpref,
color: 'purple',
icon: 'food'
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(reseedpref) == -1) {
browser.contextualIdentities
.create({
name: reseedpref,
color: 'green',
icon: 'briefcase'
})
.then(onCreated, onNotCreated);
}
}
function onContextsError() {
console.log('Error finding contextual identities, is the API enabled?');
console.log('Error finding contextual identities, is the API enabled?');
}
function onCreated(context) {
console.log(' ID:', context.cookieStoreId, 'created.');
console.log(' ID:', context.cookieStoreId, 'created.');
}
function onNotCreated(context) {
console.log('ID:', context.cookieStoreId, 'not created.');
console.log('ID:', context.cookieStoreId, 'not created.');
}
browser.contextualIdentities.query({}).then(onContextsGot, onContextsError);
var gettingInfo = browser.runtime.getPlatformInfo();
gettingInfo.then((got) => {
if (got.os != 'android') {
browser.windows.onCreated.addListener(themeWindow);
browser.windows.onFocusChanged.addListener(themeWindow);
browser.windows.onRemoved.addListener(themeWindow);
browser.tabs.onUpdated.addListener(themeWindowByTab);
browser.tabs.onActivated.addListener(themeWindowByTab);
}
if (got.os != 'android') {
browser.windows.onCreated.addListener(themeWindow);
browser.windows.onFocusChanged.addListener(themeWindow);
browser.windows.onRemoved.addListener(themeWindow);
browser.tabs.onUpdated.addListener(themeWindowByTab);
browser.tabs.onActivated.addListener(themeWindowByTab);
}
});
function themeWindowByTab(tabId) {
function tabWindow(tab) {
var gettingPlatformInfo = browser.runtime.getPlatformInfo();
gettingPlatformInfo.then((got) => {
if (got.os == 'android') {
let getwindow = browser.tabs.get(tab.tabId);
getwindow.then(themeWindow);
} else {
let getwindow = browser.windows.get(tab.windowId);
getwindow.then(themeWindow);
}
});
}
if (typeof tabId === 'number') {
let tab = browser.tabs.get(tabId);
tab.then(tabWindow);
} else {
tabWindow(tabId);
}
function tabWindow(tab) {
var gettingPlatformInfo = browser.runtime.getPlatformInfo();
gettingPlatformInfo.then((got) => {
if (got.os == 'android') {
let getwindow = browser.tabs.get(tab.tabId);
getwindow.then(themeWindow);
} else {
let getwindow = browser.windows.get(tab.windowId);
getwindow.then(themeWindow);
}
});
}
if (typeof tabId === 'number') {
let tab = browser.tabs.get(tabId);
tab.then(tabWindow);
} else {
tabWindow(tabId);
}
}
function isEmpty(obj) {
if (obj === undefined || obj === null) {
return true;
}
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
return false;
if (obj === undefined || obj === null) {
return true;
}
}
return true;
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
return false;
}
}
return true;
}
let btheme = {
colors: {
frame: '#363A68',
toolbar: '#363A68',
tab_text: '#ECF3FF'
}
colors: {
frame: '#363A68',
toolbar: '#363A68',
tab_text: '#ECF3FF'
}
};
let dtheme = {
colors: {
frame: '#4456B7',
toolbar: '#4456B7',
tab_text: '#ECF3FF'
}
colors: {
frame: '#4456B7',
toolbar: '#4456B7',
tab_text: '#ECF3FF'
}
};
function themeWindow(window) {
// Check if the window is in private browsing
function onThemeError() {
console.log('(theme) color set error');
browserTheme();
}
function dynamicTheme() {
if (window.incognito) {
browser.theme.update(window.id, dtheme);
} else {
browser.theme.update(window.id, dtheme);
}
}
function browserTheme() {
console.log('(theme)Active in I2P window');
if (window.incognito) {
browser.theme.update(window.id, btheme);
} else {
browser.theme.update(window.id, btheme);
}
}
function unsetTheme() {
console.log('(theme)Resetting theme window');
browser.theme.reset(window.id);
}
function logTabs(tabInfo) {
function onContextGotTheme(context) {
if (context.name == titlepref) {
// Check if the window is in private browsing
function onThemeError() {
console.log('(theme) color set error');
browserTheme();
browser.pageAction.show(tabInfo[0].id);
} else if (context.name == routerpref) {
console.log('(theme) Active in Router Console window');
dynamicTheme();
} else if (context.name == tunnelpref) {
console.log('(theme) Active in Hidden Services Manager window');
dynamicTheme();
} else if (context.name == mailpref) {
console.log('(theme) Active in Web Mail window');
dynamicTheme();
} else if (context.name == torrentpref) {
console.log('(theme) Active in Bittorrent window');
dynamicTheme();
} else if (context.name == botepref) {
console.log('(theme) Active in Bote window');
dynamicTheme();
} else if (context.name == ircpref) {
console.log('(theme) Active in IRC window');
dynamicTheme();
} else if (context.name == blogpref) {
console.log('(theme) (theme) Active in Blog window');
dynamicTheme();
} else if (context.name == muwirepref) {
console.log('(theme) Active in MuWire window');
dynamicTheme();
} else {
console.log('(theme) Not active in I2P Window');
unsetTheme();
}
}
if (
tabInfo[0].cookieStoreId != 'firefox-default' &&
tabInfo[0].cookieStoreId != 'firefox-private'
) {
browser.contextualIdentities
.get(tabInfo[0].cookieStoreId)
.then(onContextGotTheme, onThemeError);
} else {
console.log('(theme) Not active in I2P window');
unsetTheme();
}
}
var querying = browser.tabs.query({
currentWindow: true,
active: true
});
querying.then(logTabs, onThemeError);
function dynamicTheme() {
if (window.incognito) {
browser.theme.update(window.id, dtheme);
} else {
browser.theme.update(window.id, dtheme);
}
}
function browserTheme() {
console.log('(theme)Active in I2P window');
if (window.incognito) {
browser.theme.update(window.id, btheme);
} else {
browser.theme.update(window.id, btheme);
}
}
function unsetTheme() {
console.log('(theme)Resetting theme window');
browser.theme.reset(window.id);
}
function logTabs(tabInfo) {
function onContextGotTheme(context) {
if (context.name == titlepref) {
browserTheme();
browser.pageAction.show(tabInfo[0].id);
} else if (context.name == routerpref) {
console.log('(theme) Active in Router Console window');
dynamicTheme();
} else if (context.name == tunnelpref) {
console.log('(theme) Active in Hidden Services Manager window');
dynamicTheme();
} else if (context.name == mailpref) {
console.log('(theme) Active in Web Mail window');
dynamicTheme();
} else if (context.name == torrentpref) {
console.log('(theme) Active in Bittorrent window');
dynamicTheme();
} else if (context.name == botepref) {
console.log('(theme) Active in Bote window');
dynamicTheme();
} else if (context.name == ircpref) {
console.log('(theme) Active in IRC window');
dynamicTheme();
} else if (context.name == blogpref) {
console.log('(theme) (theme) Active in Blog window');
dynamicTheme();
} else if (context.name == muwirepref) {
console.log('(theme) Active in MuWire window');
dynamicTheme();
} else {
console.log('(theme) Not active in I2P Window');
unsetTheme();
}
}
if (
tabInfo[0].cookieStoreId != 'firefox-default' &&
tabInfo[0].cookieStoreId != 'firefox-private'
) {
browser.contextualIdentities
.get(tabInfo[0].cookieStoreId)
.then(onContextGotTheme, onThemeError);
} else {
console.log('(theme) Not active in I2P window');
unsetTheme();
}
}
var querying = browser.tabs.query({
currentWindow: true,
active: true
});
querying.then(logTabs, onThemeError);
}
function setTitle(window) {
// Check if the window is in private browsing
function onContextError() {
console.log('Context Error');
}
function setTitle(title, privtitle) {
if (window.incognito) {
browser.windows.update(window.id, {
titlePreface: privtitle + ': '
});
} else {
browser.windows.update(window.id, {
titlePreface: title + ': '
});
}
}
function logTabs(tabInfo) {
function onContextGotTitle(context) {
if (context.name == titlepref) {
console.log('Active in I2P window');
setTitle(titlepref, titleprefpriv);
} else if (context.name == muwirepref) {
console.log('Active in MuWire window');
setTitle(muwirepref, muwireprefpriv);
} else if (context.name == routerpref) {
console.log('Active in Router Console window');
setTitle(routerpref, routerprefpriv);
} else if (context.name == botepref) {
console.log('Active in Bote window');
setTitle(botepref, boteprefpriv);
} else if (context.name == tunnelpref) {
console.log('Active in Hidden Services Manager window');
setTitle(tunnelpref, tunnelprefpriv);
} else if (context.name == mailpref) {
console.log('Active in I2P Web Mail window');
setTitle(mailpref, mailprefpriv);
} else if (context.name == blogpref) {
console.log('Active in I2P Blog window');
setTitle(blogpref, blogprefpriv);
} else if (context.name == torrentpref) {
console.log('Active in I2P Torrent window');
setTitle(torrentpref, torrentprefpriv);
} else if (context.name == ircpref) {
console.log('Active in IRC window');
setTitle(ircpref, ircprefpriv);
}
// Check if the window is in private browsing
function onContextError() {
console.log('Context Error');
}
if (
tabInfo[0].cookieStoreId != 'firefox-default' &&
tabInfo[0].cookieStoreId != 'firefox-private'
) {
browser.contextualIdentities
.get(tabInfo[0].cookieStoreId)
.then(onContextGotTitle, onContextError);
} else if (window.incognito) {
browser.windows.update(window.id, {
titlePreface: ''
});
} else {
browser.windows.update(window.id, {
titlePreface: ''
});
function setTitle(title, privtitle) {
if (window.incognito) {
browser.windows.update(window.id, {
titlePreface: privtitle + ': '
});
} else {
browser.windows.update(window.id, {
titlePreface: title + ': '
});
}
}
}
var querying = browser.tabs.query({
currentWindow: true,
active: true
});
querying.then(logTabs, onContextError);
function logTabs(tabInfo) {
function onContextGotTitle(context) {
if (context.name == titlepref) {
console.log('Active in I2P window');
setTitle(titlepref, titleprefpriv);
} else if (context.name == muwirepref) {
console.log('Active in MuWire window');
setTitle(muwirepref, muwireprefpriv);
} else if (context.name == routerpref) {
console.log('Active in Router Console window');
setTitle(routerpref, routerprefpriv);
} else if (context.name == botepref) {
console.log('Active in Bote window');
setTitle(botepref, boteprefpriv);
} else if (context.name == tunnelpref) {
console.log('Active in Hidden Services Manager window');
setTitle(tunnelpref, tunnelprefpriv);
} else if (context.name == mailpref) {
console.log('Active in I2P Web Mail window');
setTitle(mailpref, mailprefpriv);
} else if (context.name == blogpref) {
console.log('Active in I2P Blog window');
setTitle(blogpref, blogprefpriv);
} else if (context.name == torrentpref) {
console.log('Active in I2P Torrent window');
setTitle(torrentpref, torrentprefpriv);
} else if (context.name == ircpref) {
console.log('Active in IRC window');
setTitle(ircpref, ircprefpriv);
}
}
if (
tabInfo[0].cookieStoreId != 'firefox-default' &&
tabInfo[0].cookieStoreId != 'firefox-private'
) {
browser.contextualIdentities
.get(tabInfo[0].cookieStoreId)
.then(onContextGotTitle, onContextError);
} else if (window.incognito) {
browser.windows.update(window.id, {
titlePreface: ''
});
} else {
browser.windows.update(window.id, {
titlePreface: ''
});
}
}
var querying = browser.tabs.query({
currentWindow: true,
active: true
});
querying.then(logTabs, onContextError);
}
var gettingListenerInfo = browser.runtime.getPlatformInfo();
gettingListenerInfo.then((got) => {
function onPlatformError() {
console.log('Error finding platform info');
}
if (got.os != 'android') {
browser.tabs.onCreated.addListener(() => {
var getting = browser.windows.getCurrent({
populate: true
});
getting.then(setTitle, onPlatformError);
});
browser.tabs.onActivated.addListener(() => {
var getting = browser.windows.getCurrent({
populate: true
});
getting.then(setTitle, onPlatformError);
});
}
function onPlatformError() {
console.log('Error finding platform info');
}
if (got.os != 'android') {
browser.tabs.onCreated.addListener(() => {
var getting = browser.windows.getCurrent({
populate: true
});
getting.then(setTitle, onPlatformError);
});
browser.tabs.onActivated.addListener(() => {
var getting = browser.windows.getCurrent({
populate: true
});
getting.then(setTitle, onPlatformError);
});
}
});
function handleClick() {
console.log("Opening page action");
browser.pageAction.openPopup();
console.log("Opening page action");
browser.pageAction.openPopup();
}
browser.pageAction.onClicked.addListener(handleClick);
async function certCheck(details) {
if (details.url.startsWith("https")) {
console.log("(cert) https site", details.url);
} else {
return;
}
if (!details.url.includes(".i2p")) {
return;
}
var tabs = await browser.tabs.query({ active: true });
if (tabs == null) {
return;
}
console.log("(cert) checking cert", tabs);
for (tab in tabs) {
if (details.url == tabs[tab].url) {
console.log("(cert) right tab", tabs[tab].id);
try {
let securityInfo = await browser.webRequest.getSecurityInfo(
details.requestId,
{ certificateChain: true }
);
console.log("(cert) state is complete", securityInfo);
console.log("(cert) certificates", securityInfo.certificates);
} catch (error) {
console.error(error);
}
if (details.url.startsWith("https")) {
console.log("(cert) https site", details.url);
} else {
return;
}
if (!details.url.includes(".i2p")) {
return;
}
var tabs = await browser.tabs.query({ active: true });
if (tabs == null) {
return;
}
console.log("(cert) checking cert", tabs);
for (tab in tabs) {
if (details.url == tabs[tab].url) {
console.log("(cert) right tab", tabs[tab].id);
try {
let securityInfo = await browser.webRequest.getSecurityInfo(
details.requestId, { certificateChain: true }
);
console.log("(cert) state is complete", securityInfo);
console.log("(cert) certificates", securityInfo.certificates);
} catch (error) {
console.error(error);
}
}
}
}
}
// Listen for onHeaderReceived for the target page.
// Set "blocking" and "responseHeaders".
browser.webRequest.onHeadersReceived.addListener(
certCheck,
{ urls: ["<all_urls>"] },
["blocking", "responseHeaders"]
certCheck, { urls: ["<all_urls>"] }, ["blocking", "responseHeaders"]
);
function onClosedWindowCheck() {
var getContext = browser.contextualIdentities.query({ name: titlepref });
function checkTabs(ctx) {
for (let context in ctx) {
function conditionallyDelete(tabs) {
if (tabs.length == 0) {
browser.contextualIdentities.remove(context.cookieStoreId);
var getContext = browser.contextualIdentities.query({ name: titlepref });
function checkTabs(ctx) {
for (let context in ctx) {
function conditionallyDelete(tabs) {
if (tabs.length == 0) {
browser.contextualIdentities.remove(context.cookieStoreId);
}
}
var tabs = browser.tabs.query({ cookieStoreId: context.cookieStoreId });
tabs.then(conditionallyDelete, onError);
}
}
var tabs = browser.tabs.query({ cookieStoreId: context.cookieStoreId });
tabs.then(conditionallyDelete, onError);
}
}
getContext.then(checkTabs, onError);
getContext.then(checkTabs, onError);
}
function onOpenedWindowCheck() {
var getContext = browser.contextualIdentities.query({ name: titlepref });
function checkTabs(ctx) {
for (let context in ctx) {
function conditionallyDelete(tabs) {
if (tabs.length == 0 && context != 0) {
console.log(context);
browser.contextualIdentities.remove(context.cookieStoreId);
var getContext = browser.contextualIdentities.query({ name: titlepref });
function checkTabs(ctx) {
for (let context in ctx) {
function conditionallyDelete(tabs) {
if (tabs.length == 0 && context != 0) {
console.log(context);
browser.contextualIdentities.remove(context.cookieStoreId);
}
}
var tabs = browser.tabs.query({ cookieStoreId: context.cookieStoreId });
tabs.then(conditionallyDelete, onError);
}
}
var tabs = browser.tabs.query({ cookieStoreId: context.cookieStoreId });
tabs.then(conditionallyDelete, onError);
}
}
getContext.then(checkTabs, onError);
getContext.then(checkTabs, onError);
}
onOpenedWindowCheck();
@@ -466,7 +488,7 @@ onOpenedWindowCheck();
browser.tabs.onRemoved.addListener(onClosedWindowCheck);
if (browser.windows != undefined) {
console.log("windows unavailable on android", browser.runtime.PlatformOs);
browser.windows.onRemoved.addListener(onClosedWindowCheck);
browser.windows.onCreated.addListener(onOpenedWindowCheck);
}
console.log("windows unavailable on android", browser.runtime.PlatformOs);
browser.windows.onRemoved.addListener(onClosedWindowCheck);
browser.windows.onCreated.addListener(onOpenedWindowCheck);
}

323
host.js
View File

@@ -1,178 +1,187 @@
function proxyHost(url) {
let hostname = '';
if (url.indexOf('://') > -1) {
hostname = url.split('/')[2];
} else {
hostname = url.split('/')[0];
}
if (hostname == 'proxy.i2p') {
return true;
}
if (
hostname == 'c6lilt4cr5x7jifxridpkesf2zgfwqfchtp6laihr4pdqomq25iq.b32.i2p'
) {
return true;
}
return false;
let hostname = '';
if (url.indexOf('://') > -1) {
hostname = url.split('/')[2];
} else {
hostname = url.split('/')[0];
}
if (hostname == 'proxy.i2p') {
return true;
}
if (
hostname == 'c6lilt4cr5x7jifxridpkesf2zgfwqfchtp6laihr4pdqomq25iq.b32.i2p'
) {
return true;
}
return false;
}
function localHost(url) {
let hostname = '';
if (url.indexOf('://') > -1) {
hostname = url.split('/')[2];
} else {
hostname = url.split('/')[0];
}
hostname = hostname.split(':')[0];
console.log('(urlcheck) hostname localhost', hostname);
console.log('(urlcheck) url localhost', url);
if (hostname === '127.0.0.1') {
if (url.indexOf(':8084') != -1) return 'blog';
if (url.indexOf(':7669') != -1) return 'irc';
} else if (hostname === 'localhost') {
if (url.indexOf(':8084') != -1) return 'blog';
if (url.indexOf(':7669') != -1) return 'irc';
}
let hostname = '';
if (url.indexOf('://') > -1) {
hostname = url.split('/')[2];
} else {
hostname = url.split('/')[0];
}
hostname = hostname.split(':')[0];
console.log('(urlcheck) hostname localhost', hostname);
console.log('(urlcheck) url localhost', url);
if (hostname === '127.0.0.1') {
if (url.indexOf(':7671') != -1) return 'reseed';
if (url.indexOf(':8084') != -1) return 'blog';
if (url.indexOf(':7672') != -1) return 'blog';
if (url.indexOf(':7673') != -1) return 'blog';
if (url.indexOf(':7669') != -1) return 'irc';
if (url.indexOf(':7695') != -1) return 'tortab';
} else if (hostname === 'localhost') {
if (url.indexOf(':7671') != -1) return 'reseed';
if (url.indexOf(':8084') != -1) return 'blog';
if (url.indexOf(':7672') != -1) return 'blog';
if (url.indexOf(':7673') != -1) return 'blog';
if (url.indexOf(':7669') != -1) return 'irc';
if (url.indexOf(':7695') != -1) return 'tortab';
}
return false;
return false;
}
function extensionHost(url) {
var prefix = browser.runtime
.getURL('')
.replace('moz-extension://', '')
.replace('/', '');
if (url.originUrl !== undefined) {
var originUrl = url.originUrl
.replace('moz-extension://', '')
.replace('/', '');
// console.log("(urlcheck) Extension application path", originUrl);
// console.log("(urlcheck) Extension application path", prefix);
var res = originUrl.startsWith(prefix);
// console.log("(urlcheck) Extension application path", res);
if (res) return res;
}
if (url.documentUrl !== undefined) {
// console.log("(urlcheck) Extension application path", originUrl);
// console.log("(urlcheck) Extension application path", prefix);
var res = originUrl.startsWith(prefix);
// console.log("(urlcheck) Extension application path", res);
if (res) return res;
}
console.log('(urlcheck) Extension application path', url);
var prefix = browser.runtime
.getURL('')
.replace('moz-extension://', '')
.replace('/', '');
if (url.originUrl !== undefined) {
var originUrl = url.originUrl
.replace('moz-extension://', '')
.replace('/', '');
// console.log("(urlcheck) Extension application path", originUrl);
// console.log("(urlcheck) Extension application path", prefix);
var res = originUrl.startsWith(prefix);
// console.log("(urlcheck) Extension application path", res);
if (res) return res;
}
if (url.documentUrl !== undefined) {
// console.log("(urlcheck) Extension application path", originUrl);
// console.log("(urlcheck) Extension application path", prefix);
var res = originUrl.startsWith(prefix);
// console.log("(urlcheck) Extension application path", res);
if (res) return res;
}
console.log('(urlcheck) Extension application path', url);
}
function i2pHostName(url) {
let hostname = '';
console.log('(hosts)', url);
let u = new URL(url);
if (u.host.endsWith('.i2p')) {
hostname = u.host;
} else if (url.includes('=')) {
if (url.includes('.i2p')) {
lsit = url.split('=');
for (let item in lsit) {
var items = lsit[item].split(`\ % `); //"\%")
for (let p in items) {
if (items[p].includes('.i2p')) {
hostname = items[p].replace('3D', 1);
}
break;
let hostname = '';
console.log('(hosts)', url);
let u = new URL(url);
if (u.host.endsWith('.i2p')) {
hostname = u.host;
} else if (url.includes('=')) {
if (url.includes('.i2p')) {
lsit = url.split('=');
for (let item in lsit) {
var items = lsit[item].split(`\ % `); //"\%")
for (let p in items) {
if (items[p].includes('.i2p')) {
hostname = items[p].replace('3D', 1);
}
break;
}
if (hostname != '') {
break;
}
}
}
if (hostname != '') {
break;
}
}
} else if (url.indexOf('://') > -1) {
hostname = url.split('/')[2];
} else {
hostname = url.split('/')[0];
}
} else if (url.indexOf('://') > -1) {
hostname = url.split('/')[2];
} else {
hostname = url.split('/')[0];
}
console.log('(hosts) scrub', hostname);
return hostname;
console.log('(hosts) scrub', hostname);
return hostname;
}
function i2pHost(url) {
let hostname = i2pHostName(url);
let postname = hostname.split(':')[0];
return postname.endsWith('.i2p');
let hostname = i2pHostName(url);
let postname = hostname.split(':')[0];
return postname.endsWith('.i2p');
}
function routerHost(url) {
// console.log("(urlcheck) HOST URL CHECK");
let hostname = '';
let path = '';
function pathcheck(str) {
if (str != undefined) {
let final = str.split('/')[0];
if (final === 'i2ptunnelmgr' || final === 'i2ptunnel') {
console.log('(urlcheck) Tunnel application path', final);
return 'i2ptunnelmgr';
} else if (
final === 'i2psnark' ||
final === 'torrents' ||
final.startsWith('transmission') ||
final.startsWith('tracker') ||
url.includes(':7662')
) {
console.log('(urlcheck) Torrent application path', final);
return 'i2psnark';
} else if (final === 'webmail' || final === 'susimail') {
if (!url.includes('.css')) {
console.log('(urlcheck) Mail application path', final);
return 'webmail';
// console.log("(urlcheck) HOST URL CHECK");
let hostname = '';
let path = '';
function pathcheck(str) {
if (str != undefined) {
let final = str.split('/')[0];
if (final === 'i2ptunnelmgr' || final === 'i2ptunnel') {
console.log('(urlcheck) Tunnel application path', final);
return 'i2ptunnelmgr';
} else if (
final === 'i2psnark' ||
final === 'torrents' ||
final.startsWith('transmission') ||
final.startsWith('tracker') ||
url.includes(':7662')
) {
console.log('(urlcheck) Torrent application path', final);
return 'i2psnark';
} else if (final === 'webmail' || final === 'susimail') {
if (!url.includes('.css')) {
console.log('(urlcheck) Mail application path', final);
return 'webmail';
}
} else if (final.startsWith('MuWire')) {
if (!url.includes('.png')) {
console.log('(urlcheck) MuWire application path', final);
return 'muwire';
}
} else if (final.startsWith('i2pbote')) {
if (!url.includes('.png')) {
console.log('(urlcheck) I2PBote application path', final);
return 'i2pbote';
}
} else if (
final === 'home' ||
final === 'console' ||
final === 'dns' ||
final === 'susidns' ||
final.startsWith('susidns') ||
final === 'sitemap' ||
final.startsWith('config')
) {
console.log('(urlcheck) Console application path', final);
return 'routerconsole';
}
}
} else if (final.startsWith('MuWire')) {
if (!url.includes('.png')) {
console.log('(urlcheck) MuWire application path', final);
return 'muwire';
}
} else if (final.startsWith('i2pbote')) {
if (!url.includes('.png')) {
console.log('(urlcheck) I2PBote application path', final);
return 'i2pbote';
}
} else if (
final === 'home' ||
final === 'console' ||
final === 'dns' ||
final === 'susidns' ||
final.startsWith('susidns') ||
final === 'sitemap' ||
final.startsWith('config')
) {
console.log('(urlcheck) Console application path', final);
return 'routerconsole';
}
return true;
}
return true;
}
if (url.indexOf('://') > -1) {
hostname = url.split('/')[2];
let prefix = url.substr(0, url.indexOf('://') + 3);
path = url.replace(prefix + hostname + '/', '');
} else if (identifyProtocolHandler(url)) {
let newurl = identifyProtocolHandler(url);
return routerHost(newurl);
} else {
hostname = url.split('/')[0];
path = url.replace(hostname + '/', '');
}
if (hostname === control_host + ':' + control_port) {
return pathcheck(path);
}
if (hostname === 'localhost' + ':' + control_port) {
return pathcheck(path);
}
if (hostname === '127.0.0.1' + ':' + control_port) {
return pathcheck(path);
}
if (hostname === 'localhost' + ':' + 7070) {
return pathcheck(path);
}
if (hostname === '127.0.0.1' + ':' + 7070) {
return pathcheck(path);
}
return false;
}
if (url.indexOf('://') > -1) {
hostname = url.split('/')[2];
let prefix = url.substr(0, url.indexOf('://') + 3);
path = url.replace(prefix + hostname + '/', '');
} else if (identifyProtocolHandler(url)) {
let newurl = identifyProtocolHandler(url);
return routerHost(newurl);
} else {
hostname = url.split('/')[0];
path = url.replace(hostname + '/', '');
}
if (hostname === control_host + ':' + control_port) {
return pathcheck(path);
}
if (hostname === 'localhost' + ':' + control_port) {
return pathcheck(path);
}
if (hostname === '127.0.0.1' + ':' + control_port) {
return pathcheck(path);
}
if (hostname === 'localhost' + ':' + 7070) {
return pathcheck(path);
}
if (hostname === '127.0.0.1' + ':' + 7070) {
return pathcheck(path);
}
return false;
}

View File

@@ -27,7 +27,7 @@
],
"manifest_version": 2,
"name": "__MSG_extensionName__",
"version": "0.129",
"version": "0.130",
"description": "__MSG_extensionDescription__",
"homepage_url": "https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox",
"icons": {

733
proxy.js
View File

@@ -10,397 +10,450 @@ var muwirepref = chrome.i18n.getMessage('muwirePreface');
var botepref = chrome.i18n.getMessage('botePreface');
var blogpref = chrome.i18n.getMessage('blogPreface');
var blogprefpriv = chrome.i18n.getMessage('blogPrefacePrivate');
var torpref = chrome.i18n.getMessage('torPreface');
var reseedpref = chrome.i18n.getMessage('reseedPreface');
browser.privacy.network.peerConnectionEnabled.set({
value: true
value: true
});
chrome.privacy.network.networkPredictionEnabled.set({
value: false
value: false
});
chrome.privacy.network.webRTCIPHandlingPolicy.set({
value: 'disable_non_proxied_udp'
value: 'disable_non_proxied_udp'
});
console.log('Disabled unproxied UDP.');
function shouldProxyRequest(requestInfo) {
return requestInfo.parentFrameId != -1;
return requestInfo.parentFrameId != -1;
}
var handleContextProxyRequest = async function(requestDetails) {
function ircProxy() {
if (!requestDetails.url.includes('7669')) {
proxy = {
type: getScheme(),
host: getHost(),
port: getPort()
};
return proxy;
function ircProxy() {
if (!requestDetails.url.includes('7669')) {
proxy = {
type: getScheme(),
host: getHost(),
port: getPort(),
failoverTimeout: 864000
};
return proxy;
}
if (requestDetails.url.includes(':7669')) {
proxy = null;
return proxy;
}
}
if (requestDetails.url.includes(':7669')) {
proxy = null;
return proxy;
}
}
function blogProxy() {
if (!requestDetails.url.includes('8084')) {
proxy = {
type: getScheme(),
host: getHost(),
port: getPort()
};
return proxy;
}
if (requestDetails.url.includes(':8084')) {
proxy = null;
return proxy;
}
}
function btProxy() {
proxy = routerProxy();
if (requestDetails.url.includes(':7662')) {
proxy = null;
return proxy;
function blogProxy() {
if (!requestDetails.url.includes('8084')) {
proxy = {
type: getScheme(),
host: getHost(),
port: getPort(),
failoverTimeout: 864000
};
return proxy;
}
if (requestDetails.url.includes(':8084')) {
proxy = null;
return proxy;
}
}
console.log('(bt proxy)', proxy);
return proxy;
}
function mainProxy() {
console.log('(proxy) mainproxy 0');
proxy = {
type: getScheme(),
host: getHost(),
port: getPort()
};
let url = new URL(requestDetails.url);
if (
requestDetails.url.startsWith(
'http://' + getHost() + ':' + getConsolePort() + '/i2psnark/'
)
) {
//+url.host)) {
console.log('(proxy) mainproxy 2', url);
proxy = null;
}
return proxy;
}
function routerProxy() {
if (routerHost(requestDetails.url)) {
proxy = null;
return proxy;
} else if (!routerHost(requestDetails.url)) {
proxy = {
type: getScheme(),
host: getHost(),
port: getPort()
};
return proxy;
}
}
try {
var handleProxyRequest = function(context) {
proxy = {
type: getScheme(),
host: getHost(),
port: getPort()
};
if (context == 'firefox-default' || context == 'firefox-private') {
proxy = null;
return proxy;
}
function torManagerProxy() {
if (!requestDetails.url.includes('7695')) {
proxy = {
type: getScheme(),
host: getHost(),
port: getPort(),
failoverTimeout: 864000
};
return proxy;
}
if (requestDetails.url.includes(':7695')) {
proxy = null;
return proxy;
}
}
if (context != undefined) {
console.log('(proxy), context', context);
function reseedProxy() {
if (!requestDetails.url.includes('7671')) {
proxy = {
type: getScheme(),
host: getHost(),
port: getPort(),
failoverTimeout: 864000
};
return proxy;
}
if (requestDetails.url.includes(':7671')) {
proxy = null;
return proxy;
}
}
function btProxy() {
proxy = routerProxy();
if (context.name == ircpref) {
proxy = ircProxy();
return proxy;
} else if (context.name == blogpref) {
proxy = blogProxy();
return proxy;
} else if (context.name == titlepref) {
proxy = mainProxy();
return proxy;
} else if (context.name == routerpref) {
proxy = routerProxy();
return proxy;
} else if (context.name == torrentpref) {
proxy = btProxy();
return proxy;
} else if (context.name == mailpref) {
return proxy;
} else if (context.name == tunnelpref) {
return proxy;
} else if (context.name == muwirepref) {
return proxy;
} else if (context.name == botepref) {
return proxy;
if (requestDetails.url.includes(':7662')) {
proxy = null;
return proxy;
}
} else {
if (!routerHost(requestDetails.url)) {
if (localHost(requestDetails.url)) {
if (requestDetails.url.includes(':7669')) {
proxy = null;
} else if (requestDetails.url.includes(':7662')) {
proxy = null;
} else {
console.log(
'(proxy) non-routerconsole localhost url, will not interfere',
requestDetails.url
);
}
}
}
if (i2pHost(requestDetails.url)) {
proxy = {
console.log('(bt proxy)', proxy);
return proxy;
}
function mainProxy() {
console.log('(proxy) mainproxy 0');
proxy = {
type: getScheme(),
host: getHost(),
port: getPort()
};
} else {
proxy = null;
}
if (requestDetails.url.includes('rpc')) {
console.log('(proxy for rpc url)', rpc);
}
//var tab = tabGet(requestDetails.tabId);
//tab.then(handleTabRequest,)
return proxy;
}
};
var contextGet = async function(tabInfo) {
try {
context = await browser.contextualIdentities.get(tabInfo.cookieStoreId);
return context;
} catch (error) {
console.warn(error);
return 'firefox-default';
}
};
var tabGet = async function(tabId) {
try {
let tabInfo = await browser.tabs.get(tabId);
return tabInfo;
} catch (error) {
console.log('(proxy)Tab error', error);
}
};
if (proxyHost(requestDetails.url)) {
proxy = {
type: getScheme(),
host: getHost(),
port: getPort()
};
return proxy;
}
if (requestDetails.originUrl == browser.runtime.getURL('security.html')) {
proxy = {
type: getScheme(),
host: getHost(),
port: getPort()
};
return proxy;
}
if (
requestDetails.cookieStoreId == 'firefox-default' ||
requestDetails.cookieStoreId == 'firefox-private'
) {
if (browser.windows != undefined) {
return browser.proxy.settings.get({});
}
}
if (requestDetails.tabId > 0) {
if (requestDetails.url.includes('MuWire')) {
return;
}
if (proxyHost(requestDetails.url)) {
proxy = {
type: getScheme(),
host: getHost(),
port: getPort()
port: getPort(),
failoverTimeout: 864000
};
let url = new URL(requestDetails.url);
if (
requestDetails.url.startsWith(
'http://' + getHost() + ':' + getConsolePort() + '/i2psnark/'
)
) {
//+url.host)) {
console.log('(proxy) mainproxy 2', url);
proxy = null;
}
return proxy;
} else if (i2pHost(requestDetails.url)) {
var tab = tabGet(requestDetails.tabId);
requestDetails.tabId = tab;
var context = tab.then(contextGet);
var proxy = await context.then(handleProxyRequest);
//console.log('(proxy)Returning I2P Proxy', proxy);
return proxy;
} else if (extensionHost(requestDetails)) {
return;
} else {
var tab = tabGet(requestDetails.tabId);
var context = tab.then(contextGet);
var proxy = await context.then(handleProxyRequest);
//console.log("(proxy)Returning I2P Proxy", proxy);
return proxy;
}
/*proxy = {};
console.log("(proxy)Returning unset Proxy", proxy);
return proxy;*/
} else {
proxy = {
type: getScheme(),
host: getHost(),
port: getPort()
};
//console.log('(proxy for rpc url)', rpc);
return proxy;
}
} catch (error) {
console.log('(proxy)Not using I2P Proxy.', error);
}
function routerProxy() {
if (routerHost(requestDetails.url)) {
proxy = null;
return proxy;
} else if (!routerHost(requestDetails.url)) {
proxy = {
type: getScheme(),
host: getHost(),
port: getPort(),
failoverTimeout: 864000
};
return proxy;
}
}
try {
var handleProxyRequest = function(context) {
proxy = {
type: getScheme(),
host: getHost(),
port: getPort(),
failoverTimeout: 864000
};
if (context == 'firefox-default' || context == 'firefox-private') {
proxy = null;
return proxy;
}
if (context != undefined) {
console.log('(proxy), context', context);
proxy = routerProxy();
if (context.name == ircpref) {
proxy = ircProxy();
return proxy;
} else if (context.name == blogpref) {
proxy = blogProxy();
return proxy;
} else if (context.name == titlepref) {
proxy = mainProxy();
return proxy;
} else if (context.name == torpref) {
proxy = torManagerProxy();
return proxy;
} else if (context.name == reseedpref) {
proxy = reseedProxy();
return proxy;
} else if (context.name == routerpref) {
proxy = routerProxy();
return proxy;
} else if (context.name == torrentpref) {
proxy = btProxy();
return proxy;
} else if (context.name == mailpref) {
return proxy;
} else if (context.name == tunnelpref) {
return proxy;
} else if (context.name == muwirepref) {
return proxy;
} else if (context.name == botepref) {
return proxy;
}
} else {
if (!routerHost(requestDetails.url)) {
if (localHost(requestDetails.url)) {
if (requestDetails.url.includes(':7669')) {
proxy = null;
} else if (requestDetails.url.includes(':7662')) {
proxy = null;
} else {
console.log(
'(proxy) non-routerconsole localhost url, will not interfere',
requestDetails.url
);
}
}
}
if (i2pHost(requestDetails.url)) {
proxy = {
type: getScheme(),
host: getHost(),
port: getPort(),
failoverTimeout: 864000
};
} else {
proxy = null;
}
if (requestDetails.url.includes('rpc')) {
console.log('(proxy for rpc url)', rpc);
}
//var tab = tabGet(requestDetails.tabId);
//tab.then(handleTabRequest,)
return proxy;
}
};
var contextGet = async function(tabInfo) {
try {
context = await browser.contextualIdentities.get(tabInfo.cookieStoreId);
return context;
} catch (error) {
console.warn(error);
return 'firefox-default';
}
};
var tabGet = async function(tabId) {
try {
let tabInfo = await browser.tabs.get(tabId);
return tabInfo;
} catch (error) {
console.log('(proxy)Tab error', error);
}
};
if (proxyHost(requestDetails.url)) {
proxy = {
type: getScheme(),
host: getHost(),
port: getPort(),
failoverTimeout: 864000
};
return proxy;
}
if (requestDetails.originUrl == browser.runtime.getURL('security.html')) {
proxy = {
type: getScheme(),
host: getHost(),
port: getPort(),
failoverTimeout: 864000
};
return proxy;
}
if (
requestDetails.cookieStoreId == 'firefox-default' ||
requestDetails.cookieStoreId == 'firefox-private'
) {
if (browser.windows != undefined) {
return browser.proxy.settings.get({});
}
}
if (requestDetails.tabId > 0) {
if (requestDetails.url.includes('MuWire')) {
return;
}
if (proxyHost(requestDetails.url)) {
proxy = {
type: getScheme(),
host: getHost(),
port: getPort()
};
return proxy;
} else if (i2pHost(requestDetails.url)) {
var tab = tabGet(requestDetails.tabId);
requestDetails.tabId = tab;
var context = tab.then(contextGet);
var proxy = await context.then(handleProxyRequest);
//console.log('(proxy)Returning I2P Proxy', proxy);
return proxy;
} else if (extensionHost(requestDetails)) {
return;
} else {
var tab = tabGet(requestDetails.tabId);
var context = tab.then(contextGet);
var proxy = await context.then(handleProxyRequest);
//console.log("(proxy)Returning I2P Proxy", proxy);
return proxy;
}
/*proxy = {};
console.log("(proxy)Returning unset Proxy", proxy);
return proxy;*/
} else {
proxy = {
type: getScheme(),
host: getHost(),
port: getPort(),
failoverTimeout: 864000
};
//console.log('(proxy for rpc url)', rpc);
return proxy;
}
} catch (error) {
console.log('(proxy)Not using I2P Proxy.', error);
}
}
function SetupSettings() {
console.log('Initialising Settings');
function onSetupError() {
console.log('Settings initialization error');
}
//
function checkSchemeStoredSettings(storedSettings) {
if (storedSettings.proxy_scheme == undefined)
storedSettings.proxy_scheme = 'http';
else proxy_scheme = storedSettings.proxy_scheme;
console.log('Initialising Settings');
console.log('Initialising Proxy Scheme', storedSettings.proxy_scheme);
setupProxy();
}
var gettingSchemeStoredSettings = browser.storage.local.get('proxy_scheme');
gettingSchemeStoredSettings.then(checkSchemeStoredSettings, onSetupError);
function onSetupError() {
console.log('Settings initialization error');
}
//
function checkSchemeStoredSettings(storedSettings) {
if (storedSettings.proxy_scheme == undefined)
storedSettings.proxy_scheme = 'http';
else proxy_scheme = storedSettings.proxy_scheme;
//
function checkHostStoredSettings(storedSettings) {
if (storedSettings.proxy_host == undefined)
storedSettings.proxy_host = '127.0.0.1';
else proxy_host = storedSettings.proxy_host;
console.log('Initialising Proxy Scheme', storedSettings.proxy_scheme);
setupProxy();
}
var gettingSchemeStoredSettings = browser.storage.local.get('proxy_scheme');
gettingSchemeStoredSettings.then(checkSchemeStoredSettings, onSetupError);
console.log('Initialising Host', storedSettings.proxy_host);
setupProxy();
}
var gettingHostStoredSettings = browser.storage.local.get('proxy_host');
gettingHostStoredSettings.then(checkHostStoredSettings, onSetupError);
//
function checkHostStoredSettings(storedSettings) {
if (storedSettings.proxy_host == undefined)
storedSettings.proxy_host = '127.0.0.1';
else proxy_host = storedSettings.proxy_host;
//
function checkPortStoredSettings(storedSettings) {
if (storedSettings.proxy_port == undefined)
storedSettings.proxy_port = '4444';
else proxy_port = storedSettings.proxy_port;
console.log('Initialising Host', storedSettings.proxy_host);
setupProxy();
}
var gettingHostStoredSettings = browser.storage.local.get('proxy_host');
gettingHostStoredSettings.then(checkHostStoredSettings, onSetupError);
console.log('Initialising Port', storedSettings.proxy_port);
setupProxy();
}
var gettingPortStoredSettings = browser.storage.local.get('proxy_port');
gettingPortStoredSettings.then(checkPortStoredSettings, onSetupError);
//
function checkPortStoredSettings(storedSettings) {
if (storedSettings.proxy_port == undefined)
storedSettings.proxy_port = '4444';
else proxy_port = storedSettings.proxy_port;
//
function checkControlHostStoredSettings(storedSettings) {
if (storedSettings.control_host == undefined)
storedSettings.control_host = '127.0.0.1';
else control_host = storedSettings.control_host;
console.log('Initialising Port', storedSettings.proxy_port);
setupProxy();
}
var gettingPortStoredSettings = browser.storage.local.get('proxy_port');
gettingPortStoredSettings.then(checkPortStoredSettings, onSetupError);
console.log('Initialising Control Host', storedSettings.control_host);
setupProxy();
}
var gettingControlHostStoredSettings =
browser.storage.local.get('control_host');
gettingControlHostStoredSettings.then(
checkControlHostStoredSettings,
onSetupError
);
//
function checkControlHostStoredSettings(storedSettings) {
if (storedSettings.control_host == undefined)
storedSettings.control_host = '127.0.0.1';
else control_host = storedSettings.control_host;
//
function checkControlPortStoredSettings(storedSettings) {
if (storedSettings.control_port == undefined)
storedSettings.control_port = '7657';
else control_port = storedSettings.control_port;
console.log('Initialising Control Port', storedSettings.control_port);
setupProxy();
}
var gettingControlPortStoredSettings =
browser.storage.local.get('control_port');
gettingControlPortStoredSettings.then(
checkControlPortStoredSettings,
onSetupError
);
//
function checkHistoryStoredSettings(storedSettings) {
if (storedSettings.disable_history == undefined)
storedSettings.disable_history = false;
else disable_history = storedSettings.disable_history;
console.log(
'Initialising Disabled History',
storedSettings.disable_history
console.log('Initialising Control Host', storedSettings.control_host);
setupProxy();
}
var gettingControlHostStoredSettings =
browser.storage.local.get('control_host');
gettingControlHostStoredSettings.then(
checkControlHostStoredSettings,
onSetupError
);
setupProxy();
}
var gettingHistoryStoredSettings =
browser.storage.local.get('disable_history');
gettingHistoryStoredSettings.then(checkHistoryStoredSettings, onSetupError);
//
function checkControlPortStoredSettings(storedSettings) {
if (storedSettings.control_port == undefined)
storedSettings.control_port = '7657';
else control_port = storedSettings.control_port;
console.log('Initialising Control Port', storedSettings.control_port);
setupProxy();
}
var gettingControlPortStoredSettings =
browser.storage.local.get('control_port');
gettingControlPortStoredSettings.then(
checkControlPortStoredSettings,
onSetupError
);
//
function checkHistoryStoredSettings(storedSettings) {
if (storedSettings.disable_history == undefined)
storedSettings.disable_history = false;
else disable_history = storedSettings.disable_history;
console.log(
'Initialising Disabled History',
storedSettings.disable_history
);
setupProxy();
}
var gettingHistoryStoredSettings =
browser.storage.local.get('disable_history');
gettingHistoryStoredSettings.then(checkHistoryStoredSettings, onSetupError);
}
function getScheme() {
if (proxy_scheme == 'HTTP') return 'http';
if (proxy_scheme == 'SOCKS') return 'socks';
if (proxy_scheme == 'http') return 'http';
if (proxy_scheme == 'socks') return 'socks';
else return 'http';
if (proxy_scheme == 'HTTP') return 'http';
if (proxy_scheme == 'SOCKS') return 'socks';
if (proxy_scheme == 'http') return 'http';
if (proxy_scheme == 'socks') return 'socks';
else return 'http';
}
function getHost() {
if (proxy_host == undefined) {
proxy_host = '127.0.0.1';
}
return proxy_host;
if (proxy_host == undefined) {
proxy_host = '127.0.0.1';
}
return proxy_host;
}
function getPort() {
if (proxy_port == undefined) {
var scheme = getScheme();
if (scheme == 'socks') proxy_port = '4446';
else proxy_port = '4444';
}
return proxy_port;
if (proxy_port == undefined) {
var scheme = getScheme();
if (scheme == 'socks') proxy_port = '4446';
else proxy_port = '4444';
}
return proxy_port;
}
function getConsolePort() {
if (control_port == undefined) {
var scheme = getScheme();
if (scheme == 'socks') proxy_port = '7657';
else control_port = '7657';
}
return control_port;
if (control_port == undefined) {
var scheme = getScheme();
if (scheme == 'socks') proxy_port = '7657';
else control_port = '7657';
}
return control_port;
}
function setupProxy() {
console.log('Setting up Firefox WebExtension proxy');
browser.proxy.onRequest.addListener(handleContextProxyRequest, {
urls: ['<all_urls>']
});
console.log('i2p settings created for WebExtension Proxy');
console.log('Setting up Firefox WebExtension proxy');
browser.proxy.onRequest.addListener(handleContextProxyRequest, {
urls: ['<all_urls>']
});
console.log('i2p settings created for WebExtension Proxy');
}
function update() {
console.log('restoring proxy scheme:', proxy_scheme);
console.log('restoring proxy host:', proxy_host);
console.log('restoring proxy port:', proxy_port);
console.log('restoring control host:', control_host);
console.log('restoring control port:', control_port);
console.log('restoring proxy scheme:', proxy_scheme);
console.log('restoring proxy host:', proxy_host);
console.log('restoring proxy port:', proxy_port);
console.log('restoring control host:', control_host);
console.log('restoring control port:', control_port);
}
function updateFromStorage() {
console.log('updating settings from storage');
chrome.storage.local.get(function() {
SetupSettings();
update();
setupProxy();
});
console.log('updating settings from storage');
chrome.storage.local.get(function() {
SetupSettings();
update();
setupProxy();
});
}
updateFromStorage();
@@ -410,11 +463,11 @@ setupProxy();
var gettingListenerInfo = browser.runtime.getPlatformInfo();
gettingListenerInfo.then((got) => {
if (browser.windows != undefined) {
browser.windows.onCreated.addListener(() => {
chrome.storage.local.get(function() {
setupProxy();
});
});
}
});
if (browser.windows != undefined) {
browser.windows.onCreated.addListener(() => {
chrome.storage.local.get(function() {
setupProxy();
});
});
}
});

1370
scrub.js

File diff suppressed because it is too large Load Diff

View File

@@ -3,220 +3,216 @@
////// Session extraction
function setupExtractor() {
browser.webRequest.onHeadersReceived.removeListener(extractSession);
browser.storage.local.get('server').then(({ server }) => {
if (!server) {
return;
}
console.log('Session extractor setup for', server.base_url);
browser.webRequest.onBeforeSendHeaders.addListener(
extractSession,
{ urls: [server.base_url + '*'] },
['requestHeaders']
);
});
browser.webRequest.onHeadersReceived.removeListener(extractSession);
browser.storage.local.get('server').then(({ server }) => {
if (!server) {
return;
}
console.log('Session extractor setup for', server.base_url);
browser.webRequest.onBeforeSendHeaders.addListener(
extractSession, { urls: [server.base_url + '*'] }, ['requestHeaders']
);
});
}
setupExtractor();
function extractSession(requestDetails) {
const hdr = requestDetails.requestHeaders.filter(
(x) => x.name.toLowerCase() === "x-transmission-session-id"
)[0];
if (!hdr) {
return;
}
browser.storage.local.get("server").then(({ server }) => {
server.session = hdr.value;
browser.storage.local.set({ server });
});
const hdr = requestDetails.requestHeaders.filter(
(x) => x.name.toLowerCase() === "x-transmission-session-id"
)[0];
if (!hdr) {
return;
}
browser.storage.local.get("server").then(({ server }) => {
server.session = hdr.value;
browser.storage.local.set({ server });
});
}
////// Adding
function blobToBase64(blob) {
return new Promise((resolve, reject) => {
const rdr = new FileReader();
rdr.onload = () => resolve(rdr.result.substr(rdr.result.indexOf(",") + 1));
rdr.onerror = reject;
rdr.readAsDataURL(blob);
});
return new Promise((resolve, reject) => {
const rdr = new FileReader();
rdr.onload = () => resolve(rdr.result.substr(rdr.result.indexOf(",") + 1));
rdr.onerror = reject;
rdr.readAsDataURL(blob);
});
}
function addUrl(torrentUrl, downloadDir) {
let p,
params = {};
if (downloadDir) {
params = { "download-dir": downloadDir };
}
if (torrentUrl.startsWith("magnet:")) {
console.log("Adding magnet", torrentUrl);
params.filename = torrentUrl;
p = rpcCall("torrent-add", params);
} else {
// Download the torrent file *in the browser* to support private torrents
console.log("Downloading torrent", torrentUrl);
p = fetch(torrentUrl, {
method: "GET",
credentials: "include",
})
.then((resp) => {
if (resp.ok) {
return resp.blob();
}
throw new Error("Could not download torrent");
})
.then(blobToBase64)
.then((b64) => {
params.metainfo = b64;
return rpcCall("torrent-add", params);
});
}
return p.then((x) => {
updateBadge();
return x;
});
let p,
params = {};
if (downloadDir) {
params = { "download-dir": downloadDir };
}
if (torrentUrl.startsWith("magnet:")) {
console.log("Adding magnet", torrentUrl);
params.filename = torrentUrl;
p = rpcCall("torrent-add", params);
} else {
// Download the torrent file *in the browser* to support private torrents
console.log("Downloading torrent", torrentUrl);
p = fetch(torrentUrl, {
method: "GET",
credentials: "include",
})
.then((resp) => {
if (resp.ok) {
return resp.blob();
}
throw new Error("Could not download torrent");
})
.then(blobToBase64)
.then((b64) => {
params.metainfo = b64;
return rpcCall("torrent-add", params);
});
}
return p.then((x) => {
updateBadge();
return x;
});
}
////// magnet: Handler
function handleUrl(requestDetails) {
return addUrl(
decodeURIComponent(
requestDetails.url.replace("http://transmitter.web-extension/", "")
)
).then((x) => {
return browser.storage.local.get("server").then(({ server }) => {
return { redirectUrl: server.base_url + "web/" };
return addUrl(
decodeURIComponent(
requestDetails.url.replace("http://transmitter.web-extension/", "")
)
).then((x) => {
return browser.storage.local.get("server").then(({ server }) => {
return { redirectUrl: server.base_url + "web/" };
});
});
});
}
browser.webRequest.onBeforeRequest.addListener(
handleUrl,
{ urls: ["http://transmitter.web-extension/*"] },
["blocking"]
handleUrl, { urls: ["http://transmitter.web-extension/*"] }, ["blocking"]
);
////// Context menu
function createContextMenu() {
browser.storage.local.get("server").then(({ server }) => {
browser.contextMenus.removeAll();
if (!server || !server.locations || !server.locations.length) {
browser.contextMenus.create({
id: "transmitter-add",
title: "Download with Transmission remote",
contexts: ["link"],
});
} else {
browser.contextMenus.create({
id: "transmitter-add",
title: "Download to Default location",
contexts: ["link"],
});
server.locations.forEach((location) => {
browser.contextMenus.create({
id: "transmitter-add-loc-" + location.index,
title: "Download to " + location.name,
contexts: ["link"],
});
});
}
});
browser.storage.local.get("server").then(({ server }) => {
browser.contextMenus.removeAll();
if (!server || !server.locations || !server.locations.length) {
browser.contextMenus.create({
id: "transmitter-add",
title: "Download with Transmission remote",
contexts: ["link"],
});
} else {
browser.contextMenus.create({
id: "transmitter-add",
title: "Download to Default location",
contexts: ["link"],
});
server.locations.forEach((location) => {
browser.contextMenus.create({
id: "transmitter-add-loc-" + location.index,
title: "Download to " + location.name,
contexts: ["link"],
});
});
}
});
}
if (browser.windows != undefined) {
createContextMenu();
createContextMenu();
browser.contextMenus.onClicked.addListener((info, tab) => {
if (info.menuItemId === "transmitter-add") {
return addUrl(info.linkUrl);
} else if (info.menuItemId.startsWith("transmitter-add-loc-")) {
let index = parseInt(
info.menuItemId.substr("transmitter-add-loc-".length)
);
browser.storage.local.get("server").then(({ server }) => {
let path = server.locations[index].path;
addUrl(info.linkUrl, path);
});
}
});
browser.contextMenus.onClicked.addListener((info, tab) => {
if (info.menuItemId === "transmitter-add") {
return addUrl(info.linkUrl);
} else if (info.menuItemId.startsWith("transmitter-add-loc-")) {
let index = parseInt(
info.menuItemId.substr("transmitter-add-loc-".length)
);
browser.storage.local.get("server").then(({ server }) => {
let path = server.locations[index].path;
addUrl(info.linkUrl, path);
});
}
});
}
////// Badge
function updateBadge() {
browser.storage.local.get("server").then(({ server }) => {
if (
server.badge !== "num" &&
server.badge !== "dl" &&
server.badge !== "ul" &&
server.badge !== "auto"
) {
return;
}
return rpcCall("session-stats", {}).then((response) => {
const args = response.arguments; // lol the name 'arguments' means destructuring in strict mode is impossible
switch (server.badge) {
case "num":
browser.browserAction.setBadgeBackgroundColor({ color: "gray" });
browser.browserAction.setBadgeText({
text: "" + args.activeTorrentCount,
});
break;
case "dl":
browser.browserAction.setBadgeBackgroundColor({ color: "green" });
browser.browserAction.setBadgeText({
text: formatSpeed(args.downloadSpeed),
});
break;
case "ul":
browser.browserAction.setBadgeBackgroundColor({ color: "blue" });
browser.browserAction.setBadgeText({
text: formatSpeed(args.uploadSpeed),
});
break;
case "auto":
if (args.downloadSpeed > 0) {
browser.browserAction.setBadgeBackgroundColor({ color: "green" });
browser.browserAction.setBadgeText({
text: formatSpeed(args.downloadSpeed),
});
} else if (args.uploadSpeed > 0) {
browser.browserAction.setBadgeBackgroundColor({ color: "blue" });
browser.browserAction.setBadgeText({
text: formatSpeed(args.uploadSpeed),
});
} else {
browser.browserAction.setBadgeBackgroundColor({ color: "gray" });
browser.browserAction.setBadgeText({
text: "" + args.activeTorrentCount,
});
}
break;
}
browser.storage.local.get("server").then(({ server }) => {
if (
server.badge !== "num" &&
server.badge !== "dl" &&
server.badge !== "ul" &&
server.badge !== "auto"
) {
return;
}
return rpcCall("session-stats", {}).then((response) => {
const args = response.arguments; // lol the name 'arguments' means destructuring in strict mode is impossible
switch (server.badge) {
case "num":
browser.browserAction.setBadgeBackgroundColor({ color: "gray" });
browser.browserAction.setBadgeText({
text: "" + args.activeTorrentCount,
});
break;
case "dl":
browser.browserAction.setBadgeBackgroundColor({ color: "green" });
browser.browserAction.setBadgeText({
text: formatSpeed(args.downloadSpeed),
});
break;
case "ul":
browser.browserAction.setBadgeBackgroundColor({ color: "blue" });
browser.browserAction.setBadgeText({
text: formatSpeed(args.uploadSpeed),
});
break;
case "auto":
if (args.downloadSpeed > 0) {
browser.browserAction.setBadgeBackgroundColor({ color: "green" });
browser.browserAction.setBadgeText({
text: formatSpeed(args.downloadSpeed),
});
} else if (args.uploadSpeed > 0) {
browser.browserAction.setBadgeBackgroundColor({ color: "blue" });
browser.browserAction.setBadgeText({
text: formatSpeed(args.uploadSpeed),
});
} else {
browser.browserAction.setBadgeBackgroundColor({ color: "gray" });
browser.browserAction.setBadgeText({
text: "" + args.activeTorrentCount,
});
}
break;
}
});
});
});
}
browser.alarms.onAlarm.addListener((alarm) => {
if (alarm.name === "transmitter-badge-update") {
return updateBadge();
}
if (alarm.name === "transmitter-badge-update") {
return updateBadge();
}
});
function setupBadge() {
browser.alarms.clear("transmitter-badge-update").then((x) => {
browser.storage.local.get("server").then(({ server }) => {
if (!server) {
return;
}
browser.alarms.create("transmitter-badge-update", {
periodInMinutes: parseInt(server.badge_interval || "1"),
});
updateBadge();
browser.alarms.clear("transmitter-badge-update").then((x) => {
browser.storage.local.get("server").then(({ server }) => {
if (!server) {
return;
}
browser.alarms.create("transmitter-badge-update", {
periodInMinutes: parseInt(server.badge_interval || "1"),
});
updateBadge();
});
});
});
}
setupBadge();
@@ -224,27 +220,26 @@ setupBadge();
////// Storage updates
browser.storage.onChanged.addListener((changes, area) => {
if (!Object.keys(changes).includes("server")) {
return;
}
const oldv = changes.server.oldValue;
const newv = changes.server.newValue;
if (
!oldv ||
oldv.base_url !== newv.base_url ||
oldv.username !== newv.username ||
oldv.password !== newv.password ||
oldv.badge_interval !== newv.badge_interval ||
oldv.badge !== newv.badge ||
arraysEqualDeep(oldv.locations, newv.locations)
) {
setupExtractor();
setupBadge();
updateBadge();
createContextMenu();
}
if (!Object.keys(changes).includes("server")) {
return;
}
const oldv = changes.server.oldValue;
const newv = changes.server.newValue;
if (!oldv ||
oldv.base_url !== newv.base_url ||
oldv.username !== newv.username ||
oldv.password !== newv.password ||
oldv.badge_interval !== newv.badge_interval ||
oldv.badge !== newv.badge ||
arraysEqualDeep(oldv.locations, newv.locations)
) {
setupExtractor();
setupBadge();
updateBadge();
createContextMenu();
}
});
function arraysEqualDeep(arr1, arr2) {
return JSON.stringify(arr1) !== JSON.stringify(arr2);
}
return JSON.stringify(arr1) !== JSON.stringify(arr2);
}