This change scrubs the device related info from GPUAdapterInfo namely vendor, architecture and device.
This change adds a patch to the upstream gpu_adapter.cc to intercept right before the moment we create the gpu adapter info, to scrub out these attributes. It was not possible to do it in gpu_adapter_info.cc as it lacked any context around ExecutionContext which was needed to get the farbling level.
Below are the final behaviour with different farbling levels after this change:
Farbling "off"
- No change in behaviour i.e no scrubbing will occur.
Farbling "balanced" with WebGLBalancedFingerprintingProtection enabled
- Scrub the device related info from GPUAdapterInfo.
Farbling "balanced" with WebGLBalancedFingerprintingProtection disabled
- No change in behaviour i.e no scrubbing will occur.
Farbling "maximum":
- Scrub the device related info from GPUAdapterInfo. Note that this is a new behaviour and not to tied to any feature flag. For maximum farbling it makes sense to have the maximum protection.
Resolvesbrave/brave-browser#55677
Added failed consent dialog state to handle cases where applying privacy
settings fails midway through the process and async handling
to the policy script, along with additional browser tests to cover it.
Resolves: https://github.com/brave/brave-browser/issues/55649
---------
Signed-off-by: Vadym Struts <vstruts@brave.com>
* [AI Chat] Add kText file type and ProcessTextFile mojom interface
Add kText to UploadedFileType enum and ProcessTextFile method to
AIChatUIHandler for upcoming text file upload support. Include iOS
no-op implementation.
* [AI Chat] Add TextFileExtractor for text file upload
Add TextFileExtractor subclass of FileTextExtractorBase that extracts
text via document.body.innerText after loading the file in a hidden
WebContents. The renderer handles MIME sniffing and encoding detection.
* [AI Chat] Add text file type detection and unfiltered file picker
Treat all non-image/non-PDF files as text (kText), letting the
renderer handle MIME sniffing — matching how Chromium's
Browser::OpenFile works. Remove extension-based file picker filtering.
* [AI Chat] Integrate TextFileExtractor into page handler
Add ProcessTextFile mojo endpoint implementation and text extraction
in the file picker upload flow. Text files from the file picker are
extracted via TextFileExtractor after PDF extraction completes.
* [AI Chat] Add text file content blocks for LLM engine
Handle kText uploaded files in BuildOAIMessages by sending extracted
text as TextContentBlock with "[File: filename]" prefix, following
the same pattern as PDF text extraction.
* [AI Chat] Add frontend support for text file uploads
Accept all files in drag-and-drop and paste. Handle non-image/non-PDF
files as text via processTextFile mojo call. Treat kText as document
type for upload limits. Display text files with file icon.
* [AI Chat] Add unit tests for text file type detection
Update AcceptedFileExtensions test for unfiltered file picker.
Add tests for text file handling: known extension (.txt),
extensionless files, and unknown extensions (.diff).
* [AI Chat] Show alert when files cannot be read as text
Show an error alert via Leo AlertCenter when uploaded files are
dropped because the renderer could not extract text from them
(e.g. binary files, unsupported formats).
* [AI Chat] Move ExtractText overloads to FileTextExtractorBase
Both PdfTextExtractor and TextFileExtractor had identical
ExtractText implementations. Move both the file-path and
file-bytes overloads to the base class. PdfTextExtractor
keeps a convenience overload that passes "pdf" as extension.
* [AI Chat] Unify PDF and text file extraction into a single flow
Use one barrier callback and one extractors_ vector instead of
separate pdf_extractors_/text_extractors_ and chained extraction
passes. This removes duplicated scanning, barrier setup, and
per-file callback logic.
* Revert "Disable Screen AI accessibility features"
This reverts commit 6d237a5923.
* Revert "Disable screen_ai component download/installation (#26167)"
This reverts commit 27b10ae93a.
Print preview tests from the original commit are not re-added because
they were independently removed by b13af2e384 ("Unify Print Preview
extraction across all desktop platforms") which changed the architecture
to use autoscreenshots for docs.google.com hosts.
UpstreamPDFIntegratoinTest is not re-added because the API it uses
(GetPageContent, features::kPdfOcr, accessibility tree) no longer exists.
New OCR tests are added in the next commit using the current architecture.
chromium_src/pdf/pdfium/pdfium_page.cc is not re-added because
https://chromium-review.googlesource.com/c/chromium/src/+/6854968
handles it upstream.
* Add PDF OCR browsertests for image-only PDFs
Test extraction via PDFDocumentHelper::GetPageText() for:
- Single/multi-page image-only PDFs (upstream test data)
- Image PDFs with blank pages (brave test data)
Also adds PrintPreviewHostReturnsEmpty test to verify that
docs.google.com hosts return empty content (autoscreenshots).
The wait_for_text() JavaScript function in rewrite.html used only a
MutationObserver to detect text changes. MutationObserver observes DOM
node mutations (childList, subtree, characterData) but does NOT observe
.value property changes on <input> and <textarea> elements. When the
Replace() IPC updates an input element's value asynchronously, the
MutationObserver never fires, causing EvalJs to time out.
Add an 'input' event listener alongside the MutationObserver so that
value changes on form elements are properly detected. MutationObserver
continues to handle contenteditable elements. A resolved flag prevents
duplicate resolution.
Resolvesbrave/brave-browser#53073
Fix flaky RewriteInPlace_ContentEditable test
Two issues were causing flakiness:
1. Focus issue: For contenteditable elements, the test was selecting
text without focusing the element first. This caused params_.is_editable
to sometimes be false, preventing GenerateRewriteSuggestion from being
called. Fixed by adding element.focus() before selection in rewrite.html.
2. DOM timing issue: The Replace() IPC updates the DOM asynchronously,
but the test was checking immediately after the completion callback.
Fixed by using a MutationObserver to wait for the DOM to update to
the expected value before verifying.
The MutationObserver pattern follows the approach used in Chromium's
service_worker_internals_ui_browsertest.cc.
Resolvesbrave/brave-browser#52417
* Use universal binary for Tor tests
The test data binary at brave/test/data/tor/components/mac/cldoidikboihgcjfkhdeidbpclkineef/1.0.0/tor-0.3.3.8-darwin-brave-5 is x86_64 only.
But the component is a universal binary: cldoidikboihgcjfkhdeidbpclkineef
Tor tests BraveTorBrowserTest and BraveTorWithCustomProfileBrowserTest are failing with EBADARCH.
* Ensure component cleanup finishes before test exits
When PRE_ResetBridges sets bridges to not used, it triggers cleanup of the pluggable transport component. The test was only waiting for the snowflake process to exit (WaitProcessExit), but the component cleanup happens asynchronously on a separate thread
`BraveWindowNameBrowserTest.SameOrigin` loads a document that rus a script that
sets `window.location.href` to a new URL. Since the script is in `<head>` it may
run before the initial navigation is fully committed. Blink therefore saw the
previous document in a pre-commit state where its `SecurityOrigin` was still
opaque. When it compared origins, they didn't match due to that perceived
difference and `window.name` was erroneously cleared.
Instead of this, we set `location.href` once the document has finished loading.
Then the same-origin check won't fail.
The test was checking document.title before the async WebAudio operations completed.
Changed it to await the promise resolution instead of an immediate title check.
* Added extensions mv2 settings backup.
Added ExtensionsManifectV2Migrator which observes webstore extensions. When it detects certain extension is disabled by unsupported manifest version reason, it stores the Local Extension Settings and IndexedDB settings to ExtensionsMV2Backup directory in the browser profile.
Boolean feature param import_settings [requires backup_settings to be enabled]:
If enabled, ExtensionsManifectV2Migrator observes the brave-hosted extensions installation events. When brave-hosted extension in installed and there is the settings backup then ExtensionsManifectV2Migrator imports settings to the newly installed extension.
It is first stage of the PSST feature implementation. The main goal
was to make the existing code ready to the next implementation
steps and be consistent with feature requirements.
Resolves: https://github.com/brave/brave-browser/issues/46045
---------
Signed-off-by: Vadym Struts <vstruts@brave.com>
* Use InnerTube API to fetch caption tracks as ytplayer method now
gives us empty content when fetching from its content url.
It also fixes unresponsive content fetching due to callback will never be
called when xml parsing failed.
* Fix AIChatBrowserTest.YoutubeNavigations
* Add ParseYoutubeTranscriptXml util function along with unit tests
* Remove AIChatResourceSniffer along with old YT <transcript> xml handling
* Add missing PageContentExtractorRenderViewTest
* Enforce browser/ai_chat runtime data files deps
* Add support for separate components unit test exe
* add brave_components_unittests ci feature
* Add missing PageContentFetcherTest
* URLEncoded InnerTube API key
* Make components/ai_chat/core/common/yt_util.h as non-public API
* Add validations for YT video id and innertube API key
* Disable brave_components_unittests becasuse it failed on Android test
runner. We will re-enable it in a seperate PR.
---------
Co-authored-by: bridiver <34129+bridiver@users.noreply.github.com>
* Added support for installing Brave's packed extensions.
* Added installer for mv2 extensions.
* Added Brave's public key to check verified_contents.json metadata for extension.
* For procedural filtering, check child nodes when failing to match root element to the selector.
* Add browser test for element with child procedural filter match.
* Add iOS test for element with child procedural filter match.
* Remove outdated procedural filters script sync comment after landing https://github.com/brave/brave-browser/issues/43262.
There was a flag from long ago that allowed you to select Crypto Wallets as your wallet. However if you did this, it no longer works. There is no one that can feasibly still be using this wallet because it hasn't worked for many versions
Addressed review comments
Remove references to 21070F3D60711361C1210B870439BE49B5D995F4
21070F3D60711361C1210B870439BE49B5D995F4 is for Ethereum Remote Client which is removed
Remove unused ReinstallAsNonComponent
Remove unused comment IsInstallationExplicitlyAllowed
Remove _permission_features.json because it's an override that only
exists because of CW extension.
Remove unused string braveWalletImportFromLegacy
Use constexpr for kMetamaskExtensionId
Remove need subscription to kDefaultEthereumWallet and OnWalletTypeChanged handler
Remove DISABLED_ImportLegacyWallet
Add Migration for people with CryptoWallets pref
Deprecate and keep CryptoWallets prefs
1
Implements a strategy to bring back picture in picture support for YouTube videos.
Picture in picture implementation is behind feature flag `kBravePictureInPictureForYouTubeVideos` enabled by default.
Test coverage has been extensively discussed and introduced to make sure:
- We don't have race conditions when injecting the JS script
- We don't inject the script multiple times on same page navigation
- We don't create side effects in case of unexpected changes, and/or serialzed flags don't match
- We inject/modify the serialized flags in case of partial match
---------
Co-authored-by: bridiver <34129+bridiver@users.noreply.github.com>
* Importing settings for extension from indexed db source.
* Added dialog to notify user about the source profile in use.
* Fixed UI state not update properly on import start.
fix https://github.com/brave/brave-browser/issues/45603
Some users got crash while importing password from MS-edge.
According to the crash log, it happened when importing password
form that blocked by user but username or password are not empty.
Not sure how this happened in MS-edge's password store.
Fix this by not importing invalid blocked forms.
* Increase associated content lengths
Mixtral -> 8x increase
Llama -> 8x increase
Qwen -> 8x increase
* Add trimmed tokens warning
For now this only appears after the first message and it updates over
time on that first message. So the warning could show for example that
it could only use 65% of tokens, then later change to 62% after
subsequent messages.
* Store has_trimmed_tokens in database
With DB migration to v3