Apply a second `contentShape(.rect)` after `hoverEffect` to re-assert the custom ButtonStyle hit-test boundaries, which `hoverEffect` was breaking on iPad by restoring the default increased Button hit-test slop.
Xcode 26.4 has a stricter type checker when it comes to numbers which can cause ambiguity errors when compiling code with custom equality & comparison overloads that use strict number types (`Double` in this case)
This dependency doesn't seem to be maintained anymore and needs further updates to compile with Xcode 26.4. Since its only used for certain wallet frontend pieces in iOS and may go away completely in the future, vendoring this in for simplicity
This introduces a Chromium JavaScriptFeature based on `BraveTalkScript.js`
The script itself deviates from its original in that it is now sandboxed to the isolated content world
This adds access to `WebState::GetFaviconStatus` in `CWVWebView`. At the moment this will always report as `nil` because we don't use Chromiums `WebFaviconDriver`
This introduces a Chromium JavaScriptFeature based on `ReaderModeScript.js`
The script itself deviates from its original in that it:
- No longer sends messages to the app in favour of allowing the app to instead just call `checkReadability` when the page finishes loading (this better matches typical Chromium architecture).
- Makes `checkReadability` return the result and removes the `readerize` JavaScript method.
This updates the bottom bar & keyboard handling relationship such that we only collapse the bottom bar when the keyboard appears if the reason for the keyboard appearing is that the active tab has focused an element on the page.
[iOS] Add AdsTabHelper for page notifications
This also adds temporary methods in BraveWebView to pass media notifications since the tab ID will be different than whats in Swift
WebState's created to handle tab sync would save session restoration data to disk since they are added and activated in the WebStateList, however these sessions were never restored on launch and thus never get removed leading to hundreds of session data files being stored and never cleaned up.
This adds a new override on `web::NavigationManager` to expose the private field in `NavigatonManagerImpl`: `native_restore_in_progress_`. This field can be used the same way `TabState.isRestoring` was used on the Swift side which is a requirement for moving certain logic done in the Swift side into WebState tab helpers.
The script handler was incorrectly reading from `data` instead of `data.playing` so the script handler was not functioning correctly and never reporting media playback status to the ads service.
This fixes a bug where Force Paste didn't work if you attempted to force paste into an iframe that had nested iframes. It also moves the script from being injected into all frames to only be injected in the main frame since thats the only frame we execute the JavaScript on.
Follow-up fix for #34329 where a WebKit configuration was being passed in when creating popup tabs since `tab.configuration` will be the underlying `WKWebView`'s configuration
* [iOS] Add package.json to control module type in iOS
This adds a new `package.json` in `//brave/ios` to ensure that usages of the iOS JS tooling `optimize_ts`/`compile_ts` use the correct module type (`nodenext`). This is a prerequisite to building Brave JavaScriptFeature's with TypeScript
* Migrate iOS webpack.config.js to ESM syntax
Follow-up fix for #34329 where a default WebKit configuration was being created anyways and would assert when `UseProfileWebViewConfiguration` was enabled.
Now that `TabStateFactory` is only used when creating actual tabs, the responsibility of passing in a nil `WKWebViewConfiguration` when `UseProfileWebViewConfiguration` is enabled can be shifted to the call site.
This also adds new asserts to ensure we aren't using TabManager's configurations when the feature flag is enabled.
This is a speculative fix for the URL bar being hidden after background Brave. It attempts to restore toolbar interactivity based on the keyboards state upon the scene activating along with adds additional checks during the visibility updates.
This officially removes the remaining path that would create `WebKitTabState` (which can now be removed in future PRs). To ensure TabManager is still testable, a closure/factory is now passed into its initializer to allow returning `FakeTabState` in its unit tests.
This replaces all the places `TabStateFactory.create` was being called in unit tests & SwiftUI previews that needed a `TabState` for some reason with a new `FakeTabState`
This updates the shred feature to use the correct website data store from the shared configuration rather than use TabManager's when the `UseProfileWebViewConfiguration` feature flag is enabled
This updates the `TabStateFactory` to no longer pass in the initial WebKit configuration when the `UseProfileWebViewConfiguration` feature flag is enabled
This disables all of the JS injection & script handlers done on the Swift side (obviously breaking all JS related features in the meantime) when the `UseProfileWebViewConfiguration` feature flag is enabled
This new method will also be used when handling `BraveWebView.didResetConfiguration`. This also cleans up a number of configuration defaults that were already being set inside of `WKWebViewConfigurationProvider::ResetWithWebViewConfiguration`
This exposes a property in `BraveWebViewConfiguration` to fetch the web view configuration's data store from `WKWebViewConfigurationProvider`. This property will be used for the shred feature when the `UseProfileWebViewConfiguration` feature flag is enabled.
We dont support adding arbitrary URLs to a reader mode list so this code was never used. This removes an instance where a TabState is created without providing a profile.
Adds the new methods to the Obj-C bridge to access purchase state from `BraveOriginService`. This change also updates the `BraveOriginServiceFactory` to pass in a valid skus service getter
This adds a temporary WebClient method–exposed through `BraveWebView`–that will allow Brave to perform additional changes to the underlying `WKWebViewConfiguration ` when said configuration is reset in `WKWebViewConfigurationProvider`. This is a requirement for being able to add the `internal` scheme handler and adjust a few WebKit preferences still controlled by Brave when the `UseProfileWebViewConfiguration` feature flag is enabled.
This updates the new tab page url to `about://newtab/` which matches Chromium (they use `chrome://newtab/` but its rewritten to `about://newtab/`) and removes the "about home" related URL extensions and `InternalURL` paths.
- `InternalURL` will eventually go away as we shift those pages into Chromium's WebUI setup and new tab page hasn't been an actual WebUI for years
- As a side-effect, this cleans up a number of places that checked both `URL.isWebPage()` and `InternalURL` which both do scheme checks so are mutually exclusive.
This adds a few AI Chat feature flags that were also relevant to iOS to `brave://flgas` (`brave-ai-chat-rich-search-widgets`, `brave-ai-chat-conversation-api-v2`, `brave-ai-chat-user-choice-tool`)
This changes the name from `UseChromiumWebViewsJavaScript` to `UseProfileWebViewConfiguration` to better clarify what the feature flag does, which is to remove the usage of per-tab web view configurations.
This property was returning a brand new `WKWebViewConfiguration` when there was no real configuration to return which is not useful anyways. This is also a step towards removing this property in the future since `ChromiumTabState` will only ever be able to fetch this configuration from the underlying WKWebView once configurations are no longer passed in during creation.
This fixes a flow where zombie tabs created on launch were only actually avoiding a request load because the tab's web view hadn't been created yet. In the future this is not guaranteed and a load request may realize a WebState unintentionally
This is setting up changes where we eventually never pass in a `WKWebViewConfiguration` when creating ChromiumTabState, so we need to ensure we have the correct profile up front instead of obtaining the OTR profile based on the configuration passed in.
The `FocusScript` script was only used for disabling certain keyboard shortcuts while a field is focused, but this can be determined with other means so its not needed
This feature is disabled explicitly on app specific URLS (i.e. WebUI/internal schemes) in Chromium's `-[CRWWebController createFullPagePDFWithCompletion:]`
This exposes the stable identifier in `password_manager::PasswordForm` that isn't exposed in `CWVPassword` which can be helpful for SwiftUI related methods that require identifiable objects
This exposes the stable identifier in `autofill::AutofillProfile` that isn't exposed in `CWVAutofillProfile` which can be helpful for SwiftUI related methods that require identifiable objects.
This exposes the stable identifier in `autofill::CreditCard` that isn't exposed in `CWVCreditCard` which can be helpful for SwiftUI related methods that require identifiable objects
The `CWVCreditCard` class is a read-only bridge on top of `autofill::CreditCard`, this change exposes util methods in Chromium for handling the credit card creation/update form input and validation. A future change will add methods for adding/updating/removing credit cards from the payments data manager
This change introduces a new provider type that conforms to `base::SupportsUserData::Data` such that we can associate a single `BraveWebViewConfiguration` to a single `web::BrowserState` in a similar fashion as `web::WKWebViewConfigurationProvider`.