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.
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.
- 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
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.
- 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.
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".