Commit Graph
269 Commits
Author SHA1 Message Date
Taher b3e57c5efa Manually fixed lint issues to conform to eslint 2021-11-11 06:34:23 -08:00
Taher 804b09abc2 Autofixed lint issues via eslint 2021-11-11 06:34:18 -08:00
Mihai PLESA 376cec7ee7 tslint fix 2021-11-04 17:27:06 -07:00
Pete Miller a8e0d7f810 Remove 'deep-freeze-node' dep 2021-11-04 17:27:06 -07:00
Brian Clifton c172d4ff67 Remove onboard search engine filtering logic which broke index
Removing Brave search from the list (for regions outside of US/CA) was
breaking the `Set Default` button during onboarding outside of US/CA.

Fixes https://github.com/brave/brave-browser/issues/18728
2021-10-12 23:39:56 -07:00
Emerick Rogul 715a69a9ca Remove DDG search toggle from private tabs 2021-10-08 10:51:43 -04:00
Brian Clifton 2058682484 Update Desktop onboarding to skip Search card for specific regions
Fixes https://github.com/brave/brave-browser/issues/18415
2021-09-29 23:14:23 -07:00
Brian R. Bondy f4bffae6cf Remove promptToEnableWallet and related code 2021-09-22 16:03:53 -04:00
Anton Lazarev ff223a5176 remove cosmetic filtering extension version 2021-09-07 15:06:30 -07:00
mkarolin 56fa7fc68f Fixes unit test expectation for insertCss. 2021-08-25 15:02:26 -04:00
mkarolin 7d5228c593 Reverts usage of JS APIs that return promises.
These were introduced by https://github.com/brave/brave-core/pull/9545,
however, according to Chrome documentation, e.g.:
* https://developer.chrome.com/docs/extensions/reference/tabs/
* https://developer.chrome.com/docs/extensions/reference/browserAction/
the API versions that return Promise are only available to extensions
that use Manifest V3. We are using Manifest V2 and should instead be
using APIs that take a callback.

Replaced all usages of these APIs that expected a Promise returned with
the versions that take a callback.

Fixes brave/brave-browser#17654

Additionally, added some return statements inside .then() in
shieldsPanelReducer.ts to get rid of the Bluebird warnings that "a
promise was created in a handler but was not returned from it".
2021-08-25 13:42:14 -04:00
Mario Sanchez Prada fd68dd92d0 Fix "Cannot read property 'catch' of undefined" errors on TS unit tests
There're apparently a few cases where we can't simply use the .catch()
method over the Promises returned by some APIs, because there could end
up being called over an undefined object i.e. some functions inside
browserActionAPI.ts, cosmeticFilterEvents.ts and browserAction.ts,
which would results in errors like this running npm run test-unit:

  Summary of all failing tests
  FAIL components/test/brave_extension/background/reducers/shieldsPanelReducer_test.ts (8.315 s)
    ● braveShieldsPanelReducer › WINDOW_FOCUS_CHANGED › calls shieldsPanelState.updateFocusedWindow

      TypeError: Cannot read property 'catch' of undefined

        50 | export const setBadgeText = (tabId: number, text: string) => {
        51 |   if (chrome.browserAction) {
      > 52 |     chrome.browserAction.setBadgeText({
           |     ^
        53 |       tabId,
        54 |       text: String(text)
        55 |     }).catch((e) => { console.error(e) })

This CL fixes this using a "try { await <async func> } catch(e) { .. }"
statement instead in those cases, which implies making the functions
where this is done asynchronous and adapting tests as needed.
2021-08-11 17:06:32 +02:00
zenparsing 1ee0d15cca Fix localStorage display issues on Rewards settings page 2021-07-13 11:46:11 -04:00
Mario Sanchez Prada 9f67011e35 Fix build error due to non-existing window.loadTimeData
We need to import loadTimeData from the internal module and
use it from there instead of accessing window.loadTimeData.

ERROR in /home/work/brave-browser/src/brave/components/brave_welcome_ui/reducers/welcome_reducer.ts
in /home/work/brave-browser/src/brave/components/brave_welcome_ui/reducers/welcome_reducer.ts(47,40)
TS2339: Property \'loadTimeData\' does not exist on type \'Window & typeof globalThis\'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! brave-core@1.28.4 web-ui: `webpack --config
components/webpack/webpack.config.js --progress --colors "--mode=development"
"brave_welcome=/home/work/brave-browser/src/brave/components/brave_welcome_ui/brave_welcome.tsx"`

Traceback (most recent call last):
  File "/home/work/brave-browser/src/out/Component/../../brave/script/transpile-web-ui.py", line 118, in <module>
    sys.exit(main())
  File "/home/work/brave-browser/src/out/Component/../../brave/script/transpile-web-ui.py", line 31, in main
    transpile_web_uis(args.production, webpack_gen_dir, root_gen_dir,
  File "/home/work/brave-browser/src/out/Component/../../brave/script/transpile-web-ui.py", line 98, in transpile_web_uis
    execute_stdout(args, env)
  File "/home/work/brave-browser/src/brave/script/lib/util.py", line 192, in execute_stdout
    execute(argv, env)
  File "/home/work/brave-browser/src/brave/script/lib/util.py", line 180, in execute
    raise e
  File "/home/work/brave-browser/src/brave/script/lib/util.py", line 173, in execute
    output = subprocess.check_output(argv, stderr=subprocess.STDOUT,
  File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['npm', 'run', 'web-ui', '--', '--mode=development', 'brave_welcome=/home/work/brave-browser/src/brave/components/brave_welcome_ui/brave_welcome.tsx']' returned non-zero exit status 2.
2021-06-29 16:37:35 -04:00
Brian Clifton 3367be6d8e lint / clang-format / review feedback 2021-06-17 02:11:24 -07:00
Brian Clifton 19b27568ad Add local check for brave search (desktop)
This ensures user is in US/CA before show Brave Search during
brave://welcome experience. We'll update this as search rolls out
2021-06-16 22:56:33 -07:00
Pete Miller 3968d7a16c NTP: Introduce new "all widgets off" pref and migrate previous style of setting all individual widget prefs 2021-06-10 22:47:06 -07:00
zenparsing cfd0d60cfb Update display of estimated pending rewards 2021-06-03 10:52:36 -04:00
zenparsing e97b62270b Remove usage of RewardsService::OnlyAnonWallet and bitFlyer feature flag 2021-06-02 12:59:51 -04:00
Pete Miller 68bb77d3b1 Merge pull request #8629 from brave/ntp-ftx 2021-05-14 10:37:10 -07:00
Jacob Lamont 35bc0d82b5 New Tab Page WebUI: FTX Widget UI 2021-05-13 19:15:07 -07:00
Pete Miller 5700e70eae JS Unit Tests: fix test failure with webtorrent constructor
A webtorrent dependency expects that in a node environment (i.e. Jest), Uint8Array is a superclass of Buffer. May be platform-specific (macOS only).
2021-05-11 10:00:39 -05:00
Kevin Kuehler 47f46be67c Fix cosmetic filter tests 2021-04-26 13:29:50 -07:00
zenparsing 9f02be4cfc Add support for custom one-time tip amounts 2021-04-19 14:21:31 -04:00
Anton Lazarev 9f9d886b22 fix onSelectorReturned unit tests 2021-04-04 23:54:38 -07:00
zenparsing 60b0f7a65d Fix delimited pattern substitutions on the tip dialog 2021-03-26 11:01:32 -04:00
Anton Lazarev 225fcb666e update actions available from right click context menu 2021-03-10 09:37:48 -08:00
Simon Hong 945298693f Fix renderer crash from adblock page
fix https://github.com/brave/brave-browser/issues/13775

When navigting from adblock to other pages, renderer is crashed.
This crash comes from referring RFH to try update stats whlie
new naviagion occurs. As we don't need to show stats, stats updating
logic is removed.
2021-02-04 10:49:36 +09:00
Mario Sanchez Prada cc90b36d6f Remove "bs_" prefix from settings names and modify only those needed
In a previous commit we added a "bs_" (standing for "Brave Shields")
to all the settings' names for consistency, even if only "ads", cookies"
and "javascript" needed to be changed to prevent collissions with other
types from upstream when registering the types.

However this is problematic and confusing, so let's only modify the
ones strictly needed, that is, "cookies" and "ads". For "javascript"
we can simply stop registering our own ContentSettingsType for that
since the one that's actually being used is upstream's.
2021-01-05 21:27:44 -05:00
Mario Sanchez Prada e6fedc966a Migrate away from using ResourceIdentifier now that it's gone upstream
As part of upstream bug 1134547[1], the ResourceIdentifier that Brave
Shields relied on so far has been completely removed[2], so we need to
adapt our code not to rely on it anymore so that we can keep building
Brave correctly on the latest dev channel release of Chromium 88.

This patch implements the first step to adapt Brave to this new
scenario, by moving into using Brave-specific values of the
ContentSettingsType enumeration instead of using the PLUGINS
type plus a ResourceIdentifier as we did before.

Note that this patch adds a "bs_" prefix to all the BraveShields
constants, to avoid collisions with the COOKIES and JAVASCRIPT
upstream content types. Added prefix to all constants for
consistency + update TS code.

Note that the goal of this change is simply to keep Brave building,
running and passing the tests so that we can continue working on the
rebase. Further work will be still needed in follow-up patches to
fully migrate the code base to a post-Flash world by changing those
bits that don't make sense anymore, and simplifying things as much
as possible.

[1] https://crbug.com/1134547
[2] https://crrev.com/c/2500161
2021-01-05 21:27:44 -05:00
ryanml 02bf386b3a Restoring widget stack order up re enabling cards
Fixes brave/brave-browser#12863
2020-12-09 13:05:10 -07:00
ryanml c907af0048 Removing Bitcoin.com widget code, Moonpay API
Fixes brave/brave-browser#12897
2020-12-02 14:36:40 -07:00
Terry Mancey 5a585e82b4 Add statement of accounts changes for Brave Rewards NTP widget 2020-11-25 12:01:20 +00:00
Pete Miller c2360cdf14 Brave Today: update feed and sources list periodically
Feed is once per hour and sources is once per day

Removed a unit test that was not doing anything useful (copying functionality from function to test and comparing output).
2020-11-07 20:58:50 -08:00
ryanml 0b6eb9eb4f Fixes brave/brave-browser#11961 - Creating reducer for stack widgets, refactoring show/hide logic 2020-11-02 09:24:10 -07:00
NejcZdovc 98bedc5d3e Removes c++ enabled/creation flows 2020-10-22 06:32:04 +02:00
NejcZdovc 49a7794c49 Removes enabled from page 2020-10-22 06:32:04 +02:00
NejcZdovc 5523606edf Removes enabled from internals 2020-10-22 06:32:03 +02:00
NejcZdovc b4dcf58420 Update payment id on wallet restore
Resolves https://github.com/brave/brave-browser/issues/12232
2020-10-21 07:34:02 +02:00
zenparsing 31e2a47e97 Implement tip dialog redesign 2020-10-15 17:55:10 -04:00
ryanml 8026175535 Fixing CI, cleanup 2020-10-09 13:18:05 -07:00
Brian Clifton 63f812a77b Merge pull request #6584 from brave/bsc-top-sites-rework
Make top sites work like Chromium
2020-10-06 22:26:08 -07:00
Brian Clifton 4c366ad3f5 Address review feedback and lint/gn check fixes
Can't include //chrome/browser:browser (where profile is) because this
causes a circular dep. Instead, I include profile_utils which has the
include for profile.
2020-10-06 01:34:35 -07:00
Brian Clifton 4f384e0bfe Address review feedback / problems found during review:
- Updated to make the JS API calls use reducer
- Lint fixes (TypeScript)
- Check for null on service (happens in private/tor/guest tab)
  This was causing a crash when trying to access the ViewCounterServiceFactory
2020-10-05 23:47:09 -07:00
Brian Clifton 26e16307bc Removing previous top sites code and tests (no longer needed)
Misc cleanup
2020-10-05 23:47:09 -07:00
Brian Clifton 29c662c2a1 Added new InstantServiceMessageHandler for chromium style top sites on new tab page
This commit wires that up for:
- deleting a top site
- moving/re-ordering a top site
- undoing one delete action
- restoring all top sites
- handler that refreshes top sites whenever change happens

With this commit, deleting/moving/restoring is completely in sync with
chrome://new-tab-page
2020-10-05 23:47:09 -07:00
Terry Mancey f9ef2031f1 Fixes only the top navigation bar is displayed on Rewards page 2020-10-05 23:12:22 +01:00
Terry Mancey d4d139cdca Refactored UpdateAdRewards to ReconcileAdRewards and removed unused should_reconcile flag 2020-10-05 11:16:15 +01:00
ryanml f85e7064fe Adding BitcoinDotCom string resources, redux actions 2020-09-30 21:12:59 -07:00
Terry Mancey a9a4648303 Transition Brave Ads prefs from the service layer to bat-native-ads 2020-09-29 19:43:04 +01:00