Traduzir-paginas-web is a browser extension that translates full web pages, selected text, and PDF documents directly within the current tab. It operates as an in-page translation add-on, allowing users to translate content without leaving the page or navigating to an external service.
The extension supports multiple translation providers, including Google and Yandex, and lets users choose which service to use for processing text. It can translate an entire web page with a single click, handle the text inside PDF files displayed in the browser, and translate only the specific portion of text a user has highlighted on a page.
Under the hood, the extension uses a background script to coordinate translation requests and provider selection, injects a translation overlay into the active tab via a content script, and walks the page's DOM tree to isolate visible text nodes while skipping scripts, styles, and hidden elements. For PDFs, it renders pages to a hidden canvas and extracts text for translation. Translation requests are chained as asynchronous promises to handle multiple concurrent page sections without blocking the UI.