Commit Graph
57 Commits
Author SHA1 Message Date
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
Anthony Tseng 81567f0e2f Showing tor status on NTP 2020-09-17 15:07:43 -07:00
Anthony Tseng 247a37c0ac remove sync code logging and remove sync v1 ui test 2020-06-09 12:45:48 -07:00
Anton Lazarev c8493d47c4 fix unit tests broken by #5481 2020-05-26 11:17:25 -04:00
Anton Lazarev 466d6834ff enable support for overriding 1p check on cosmetic filtering 2020-05-22 13:34:58 -04:00
AndriusA ba063e1e5a swaps NTP HTTPS upgrades stat for bandwidth saved 2020-05-12 11:44:20 +01:00
Cezar Augusto 4d2f1f60c0 Revert "Merge pull request #4996 from brave/bsc-revert-dnd"
This reverts commit b131048341, reversing
changes made to 5682caee9d.
2020-03-30 11:32:48 -03:00
Brian Clifton c974be57e1 Revert "Merge pull request #4325 from brave/ca-2971"
This reverts commit 320369320b, reversing
changes made to 80efc08d8f.
2020-03-20 09:24:43 -07:00
Cezar Augusto 2e60795cc9 NTP: Update existing tests after topSites refactoring 2020-03-19 13:01:21 -03:00
AndriusA e0f844629e lints 2020-03-10 09:32:54 +00:00
AndriusA fa2c8dc05c removes andwidth savings estimate from NTP 2020-03-10 09:32:54 +00:00
Cezar Augusto a692ec930f Shields: Add setting to hide activity count
fix https://github.com/brave/brave-browser/issues/3121
2020-03-04 20:12:14 -03:00
Andrius Aucinas 7b0582b712 bandwidth savings predictor wired up 2020-02-11 21:44:56 +00:00
Anton Lazarev ee3d741616 Implement cosmetic filtering of DOM elements via rules provided by ad block component.
Reverts the revert of the oringal implementation: "Merge pull request #4255 from brave/bsc-revert-cosmetic-filtering"

This reverts commit fcfe38a549, reversing
changes made to 950778a7a1.

Fixes some conflicts as a result of master getting flag features and uses updated adblock-rust-ffi version which provides a slightly different API than for the original implementation.
2020-02-03 16:40:48 -08:00
Brian Clifton 756285ccb0 Revert "Merge pull request #3303 from brave/cosmetic-filtering-frontend"
This reverts commit fe9f891260, reversing
changes made to 4e6ba95fbb.

Was causing problems specifically on Linux because of the Rust dependency.
This should fix https://github.com/brave/brave-browser/issues/7055
This will un-fix https://github.com/brave/brave-browser/issues/5381
2019-12-18 09:33:13 -07:00
Anton Lazarev 3aca80f9dc add browser tests for cosmetic filtering 2019-12-13 13:57:41 -08:00
Brian Clifton 1c8cafdb3f Remove unneeded reducers/filters/types/etc
Code was changed at some point (in the API) to directly use chrome storage APIs (not using redux / store)
2019-10-10 15:17:29 -07:00
NejcZdovc 25db8f9cf3 Renames rewards ui folder to page 2019-09-18 21:11:42 +02:00
Cezar Augusto 2b9340b9cc Merge pull request #2973 from brave/ca-4784
set shields interface views as a global default in settings
2019-08-02 11:12:44 -03:00
Pete Miller f5395dbd71 Shields uses chrome.settingsPrivate API instead of custom chrome.braveShields.{get,set}ViewPreferences API 2019-08-01 14:51:03 -07:00
Cezar Augusto 7e860d56e6 set shields interface views as a global default in settings
close https://github.com/brave/brave-browser/issues/4784
2019-07-31 21:21:15 -07:00
bridiver 8fc8af1b82 add callbacks for extension set* methods
change brave shields method names for clarity
fix https://github.com/brave/brave-browser/issues/5470
2019-07-30 17:16:29 -07:00
bridiver 7b75ff99c5 consolidate shields logic
fix https://github.com/brave/brave-browser/issues/5416
2019-07-26 20:59:31 -07:00
Peter Xu 5fad25110f Welcome page: Add feature to do inline theme selction 2019-07-26 11:13:04 -07:00
Pete Miller 06e594844f New Tab Page: Serve data via JS -> C++ get APIs
Fix https://github.com/brave/brave-browser/issues/5249

The previous method of wvh->SetWebUIProperty has issues in that the rvh does not always fire the 'ready' event, especially when navigating 'back'. Using DataSource is a more consistent chromium method for sending properties to the JS context. However, this is usually used for non-changing data. Whilst an UpdateDataSource function does exist, that kind of data is usually pulled from the JS via an explicit call to the C++ WebUI, so we may have to go down that route. The issue with the implementation in this commit is that a page may miss the 'updated' events that fire, for example due to have being navigated away and then back to the page.

- Creates JS -> C++ functions to get data for: Preferences, Stats and PrivateProperties (alternativeSearchEngine). loadTimeData is also not a great place for data which can change. Although a DataSource (i.e. strings.js and loadTimeData.data) can be updated, it is complicated and is not normal chromium pattern. Since this data is not required exactly at page creation (since it is not read via static HTML but via React in JS), then we can afford the time it takes to request this data via JS.
- Converting to a JS API required refactoring some of the app store / reducer initialization, including creating the concept of 'initial data' which is any data required to render the page. Since we need Preferences to know what to show, and we need Stats since they are shown on the initial page load, then those are contained within.

Includes some minor cleanup with regard to 'API' separation and definition.
- Fixes storage being loaded multiple times during redux init (the function is called with an empty state param 3 times, so the state was being loaded from storage 3 times).
- Only saves to local storage the state which we will be re-used.
2019-07-25 23:38:01 -07:00
Brian R. Bondy c82b1dba34 Remove redundant obsolete brave/tracking-protection
It's been moved inside of the rust ad-block lib
2019-07-25 11:25:51 -04:00
Peter Xu 05e8e5e8ba New Tab Page: remove persistant menu state and ensure configuration menu is keyboard accessible; closes brave/brave-browser#5041; closes /brave/brave-browser/issues/5199 2019-07-19 15:28:11 -07:00
Brian R. Bondy a61bbbf5f6 Add test for braveWallet API only available in Brave Shields extension 2019-07-17 09:55:35 -04:00
Cezar Augusto 51b2a37b09 Merge pull request #2874 from brave/ca-1196
Add support for multiple views on Shields
2019-07-10 17:51:06 -03:00
Cezar Augusto bc8b76b1b8 add support for shields simple view
address https://github.com/brave/brave-browser/issues/1196
2019-07-09 19:19:39 -03:00
Cezar Augusto c6a0d12501 Add persistent state state for Shields
close https://github.com/brave/brave-browser/issues/4953

Shields state needed across windows/tabs is not stored in localStorage API.
This follows the webUI convention for persistent state.

Goal is to provide a way to handle upcoming changes such as onboarding screen
and simple/advanced view setting.

Other state such as stats, resources blocked, and blocking preferences are still
handled by the back-end and are left untouched.
2019-07-09 19:08:38 -03:00
Peter Xu 6cb1a92ccf Add unit tests; close brave/brave-browser#1530 2019-07-09 11:43:07 -07:00
Peter Xu 76bc024d0b Add unit tests; closes https://github.com/brave/brave-browser/issues/4523 2019-06-18 14:08:54 -07:00
Peter Xu 91dde786b2 👌 Address comments and clean up code: Closes brave/brave-browser#1548 2019-06-14 13:57:49 -07:00
Peter Xu 076d764430 Add unit tests 2019-06-14 13:46:03 -07:00
Snuupy 6be9f9d5fe fix linting, remove unused code 2019-06-13 14:52:36 -07:00
Snuupy 38cb52df6f add mock functions 2019-06-13 14:52:35 -07:00
Cezar Augusto 6272cd3463 fix scripts number being different across screens
-
scripts now use the same method for checking scripts blocked
fix https://github.com/brave/brave-browser/issues/4228
2019-06-05 14:29:31 -07:00
Cezar Augusto 6ae6c41818 add several tests for new tab page 2019-05-17 10:51:34 -07:00
Cezar Augusto 4312911ef7 add test for ntp api 2019-03-22 14:56:53 -03:00
Cezar Augusto be4c79e0f0 remove unnecessary logging from shields tests 2019-03-08 01:57:49 -03:00
Brian R. Bondy c1d540d959 Make Brave shields tests work with npm run test-unit 2019-02-22 01:09:33 -05:00
NejcZdovc a592163930 Persist publisher info in the panel
Resolves https://github.com/brave/brave-browser/issues/2684
2018-12-21 10:22:28 +01:00
Cezar Augusto 1747078973 fix broken tests after lint fix
fix https://github.com/brave/brave-browser/issues/2667
2018-12-20 05:50:42 -02:00
Cezar Augusto ec3eac3a2f fix TypeScript linter
fix https://github.com/brave/brave-browser/issues/2666
2018-12-20 03:43:52 -02:00
Cezar Augusto 136c226c2d update tests for welcome page 2018-12-11 20:02:16 -02:00
Cezar Augusto 42c69ca1b0 set sync to be locale-ready
setup redux: minimal actions and store

redux: add support for qr code seed and sync words

add qr-image dep, remove qrcode.js

interface: setup UI handler for sync words and qr code image

deprecate api and html original drafts

fix jest warning about ts-jest transform

add sync reducers test

remove leftover qrcode import from html file

remove useless pageLoaded action

add support for sync reset

add support for toggling main device sync

add support for toggling bookmarks sync

Revert "remove useless pageLoaded action"

This reverts commit 384587931158549220392873e3b01d405068aa02.

add support for toggling saved site settings sync

add support for toggling browsing history sync

add support for devices table

add support for syncing from another device

add support for excluding devices

add sync actions test

add sync: mapStateToProps, mapDispatchToProps and dumb component tests

add sync reducers test file

setup brave-ui for the main interface

add disabled content interface

add `new to sync` modal interface

add enabled content interface

add reset sync interface

do not use arrow function for lifecycle methods

safeguard action handlers when payload is undefined

add sync a new device interface

add existing sync code interface

lint
2018-11-01 18:02:39 +02:00
NejcZdovc 5b9f67c426 Converts ms to s 2018-08-31 15:19:05 +02:00
NejcZdovc cd62adec89 Updates to brave-ui 0.20 2018-08-31 15:16:08 +02:00