Commit Graph
317 Commits
Author SHA1 Message Date
Cepera f337a47cf8 Add chain validation to wallet_addEthereumChain api call (#11930) 2022-01-22 11:26:36 +03:00
Brian R. Bondy 8c1fd1b113 Handle eth_sendTransaction data errors
Before it would crash because of a null parse data result that was being used

You can see the null check added in this commit with !tx_data_1559
2022-01-19 13:05:05 -05:00
Brian R. Bondy 819279a801 Disallow deletion of ethereum properties
This is for webcompat with MetaMask.

The https://wallet.polygon.technology/ site does this when web3 is
defined:
```
void 0 !== n.ethereumProvider ?
  i = n.ethereumProvider :
  void 0 !== n.web3 &&
  n.web3.currentProvider &&
  (
    n.web3.currentProvider.sendAsync &&
    (n.web3.currentProvider.send = n.web3.currentProvider.sendAsync, delete n.web3.currentProvider.sendAsync),
```

We used to not include web3 at all, then this code is not hit and
there's no problem.
Recently we started including a web3 shim so that's why it's hit now.

Now that it's hit, we were failing because the Polygon site deleted
`window.ethereum.sendAsync` and then tried to use it.
We allowed this property deletion but MetaMask did not.

Instead of the fix in this commit (with the proxy method), I wanted to instead do this in `components/brave_wallet/renderer/brave_wallet_js_handler.cc`
but that won't work because it makes delete return false.

```
- ->Set(context, gin::StringToSymbol(isolate, "networkVersion"),
+ ->DefineOwnProperty(context, gin::StringToSymbol(isolate, "networkVersion", DontDelete),
        gin::StringToV8(isolate, std::to_string(networkVersion)))
         .Check();
```

The Polygon site won't load at all if it thinks it can't delete the
property.
2022-01-11 15:30:28 -05:00
Aleksey Khoroshilov 3b7488d8af Add ServiceWorker tests. 2021-12-30 11:20:32 +07:00
Aleksey Khoroshilov ced9ecda64 Use top frame origin if possible for resource pool keying. 2021-12-30 11:20:32 +07:00
Mark Pilgrim 41dd7c974a Farble service and shared workers (#11452)
* Farble service and shared workers

* fewer patches

* use chromium_src override for mojom changes

* update chromium_src includes

* fix patch spacing

* fix patch spacing

* fewer patches, more chromium_src overrides

* remove comment

* use browser_context directly

* remove unused render_frames parameter

* remove final patch
2021-12-15 09:45:34 -05:00
Jocelyn Liu 7be9fb06dd Tests for wallet_watchAsset 2021-12-09 17:08:01 -08:00
Anthony Tseng 11d338ae26 Use bundled torrc 2021-12-03 15:26:24 -08:00
Jocelyn Liu f785f8efbd Fix send transaction browser tests 2021-11-24 00:52:04 -08:00
Brian R. Bondy 04efce03ee Implement ethereum._metamask.isUnlocked 2021-11-21 09:04:04 -05:00
Brian R. Bondy d0be53a4ea Add networkVersion property 2021-11-20 23:45:21 -05:00
Francois Marier 5e415ed9df Add browsertest for cross-origin .onion requests. 2021-11-18 16:03:25 -08:00
Mark Pilgrim ee55d8600c Migrate contentSettingsAgent tests away from kIgnoreCertificateErrors 2021-11-15 12:11:37 -05:00
Sergey ef019ce960 Signing Transaction with Trezor accounts (#10902) 2021-11-12 00:57:01 +03:00
Brian R. Bondy 09972c4270 Fix chainChanged event to have string arg not obj 2021-11-07 18:50:17 -05:00
Brian R. Bondy 692d872b06 Add ethereum.selectedAddress and ethereum.chainId properties
For MM webcompat
2021-11-07 14:43:50 -05:00
Mark Pilgrim 8a6e84d049 Add a farbling-determined voice name to getVoices
call upstream function if farbling is off
add DEPS
exit early if no voices
extend test timeout
move exit condition earlier
feedback
2021-11-05 10:44:19 -04:00
Brian Clifton f78efb260c Merge pull request #10100 from brave/cr96
Upgrade from Chromium 95 to Chromium 96
2021-11-03 11:17:24 -07:00
Brian R. Bondy 2f2dbc19cc Add more tests around signing for all methods 2021-11-02 14:39:56 -04:00
mkarolin 23081e88c1 Extend CH browser test with additional CH features.
Adds all current CH feature switches to the test to make sure the
feature switch state doesn't affect disablement of CH in Brave.

Alphabetized CH headers in the test data.
2021-11-02 12:41:31 -04:00
Shivan Kaul Sahib a87d3e4fce Redirect URL support for adblock
- Add support for redirect URLs in adblock ffi
- Rename `mock_data_url`
- If the adblock url in ctx is of type http/https, redirect
- Add tests
- Add CSP bypass for sugarcoat rules + tests
- Add restrictions for CSP bypass
- Add feature flag for Sugarcoat in net::features
2021-10-29 15:18:07 -07:00
Jocelyn Liu ef908d3430 Add tests to make sure eth_sendTransaction will not take arbitary nonce 2021-10-26 23:24:33 -07:00
Brian R. Bondy 1da3221030 Remove old BitGo code which was never used 2021-10-26 11:00:16 -04:00
Brian R. Bondy 2e81ecfd3c Deprecate old default wallet migration
In the new way we will always pick BraveWalletPreferExtension unless it is None
2021-10-26 11:00:15 -04:00
Brian R. Bondy 589cc33d0b Add tests for eth_sendTransaction 2021-10-24 18:40:03 -04:00
Mikhail 293c56995e Enable internal translate engine (#10453)
* Move the buildflags

* Remove dummy TranslateURLFetcher

* Add runtime switching between extension and brave-translate-go

* Fix buildflags in network redirects

* Update patches

* Change translate-security-origin

* Fix lint

* Fix deps

* More lint

* Remove network redirection code

* Fix formatting

* Adjust CSP policy

* Use js requests redirection

* Adjust DEPS

* Fix !enable_extensions platforms

* Fix comment

* Improve js redirections, cleanup, fix tests

* Change a function name

* Remove NOLINT

* Remove logs

* Review fixes

* Remove C++ translate network redirections completely

* More review fixes

* Add browsertests

* Fix footers

* Add comments

* Fix test

* Remove the icon

* Use base::MockCallback

* Fix lint

* Improve the test

* Fix comments

* Move code to common

* Add a test switch for the google endpoint

* Update urls and add a switch
2021-10-20 20:26:52 +07:00
Brian R. Bondy 530bf6fc7d Update test for wallet img src handling 2021-10-18 11:06:51 -04:00
Anthony Tseng 0df017aaa4 Add BraveWalletSignMessageBrowserTest 2021-10-13 19:49:45 -07:00
Brian R. Bondy 925f95429b Fix handling of request,send,sendASync 2021-10-10 22:43:56 -04:00
Anton Lazarev fa0be14128 Merge pull request #10090 from brave/remove-outdated-adblock
Remove legacy speedreader backend and adblock dependency
2021-10-06 19:32:55 +02:00
Max 90ba094d9f Merge pull request #9934 from brave/cr95
Upgrade from Chromium 94 to Chromium 95
2021-10-05 21:19:56 -04:00
mkarolin 9c1161ba0c Adjust disabled features.
Added:
 * kAppDiscoveryRemoteUrlSearch

Removed:
 * kLangClientHintHeader - we disable all hint headers, so there is no
   need to disable this one individually. Also adjusted hint headers
   browser test to test for viewport-height hint.

Reordered disabled tests alphabetically regardless of platforms.
2021-10-05 16:21:43 -04:00
Serg eb067f5ad1 Adds a test for a wallet 2021-10-05 14:42:53 -04:00
Kevin Kuehler d08513dd50 remove speedreader whitelist cli flag 2021-09-30 15:38:53 -07:00
Anton Lazarev 95d09d5e38 Merge pull request #10143 from brave/adblock-rust-0.4.0
update adblock-rust to 0.4.0
2021-09-30 16:26:43 +02:00
Anton Lazarev d3530c82ad add test for redirection independent of blocking 2021-09-24 15:35:41 -07:00
Brian R. Bondy f4bffae6cf Remove promptToEnableWallet and related code 2021-09-22 16:03:53 -04:00
Brian R. Bondy 2c3ae103b8 Remove dapp detection and Ask option for default dapp setting 2021-09-22 16:03:53 -04:00
Mikhail c782fbc829 Merge pull request #10038 from brave/cosmeticfix
Fix cosmetic filters first party machinery #10035
2021-09-13 22:41:58 +07:00
Mikhail Atuchin a5ce93dde0 Enable and improve AdBlockServiceTest.CosmeticFilteringProtect1p 2021-09-10 13:22:30 +07:00
Mark Pilgrim f44782000c Implement debouncing 2021-09-09 21:39:25 -04:00
Sergey P 81c96aa1a7 Added precompiled network ids to brave_wallet.mojom
Some fixes from review comments and added some tests
2021-09-08 17:41:20 +03:00
Sergey P 266884c472 Moved pending chains list to EthJsonRpcController
- Added limitation for 1 request per origin
- Added queue of panel views for pending requests
- Removed usage of url query parameters to pass networks payload,
  using EthJsonRpcController interfaces instead.
2021-09-08 17:41:20 +03:00
Kevin Kuehler d95845e817 speedreader: Add session logic tests
We add two browser test cases for Speedreader. In these tests
Speedreader is enabled.
  (1) Run a readable page through Speedreader. Close the browser and
      open it back up. The page should restore as readable.
  (2) Navigate to a non-readable page, then to a readable page, then do
      a back navigation. The readable state should not "stick".
2021-09-02 11:37:27 -07:00
Brian Johnson db5da23611 Merge pull request #8124 from brave/adblock-custom-subscriptions
Support custom filter list subscriptions in brave://adblock
2021-09-01 08:59:07 -07:00
Anton Lazarev b4e209870f add tests 2021-08-20 11:13:52 -07:00
sergey 66e98f3fcd Added gateway url validation 2021-08-18 17:34:44 +03:00
mkarolin 01af140ac1 Normialized line endings after adding .gitattributes. 2021-08-05 10:22:04 -04:00
Aleksey Seren eb56767476 Updated ad notifications test snapshots. 2021-07-22 17:50:27 +07:00
Aleksey Seren 7c6880b18a Renamed tests & updated original snapshot paths. 2021-07-22 13:52:08 +07:00