Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selective blocking #1512

Merged
merged 68 commits into from
Apr 29, 2024
Merged

Selective blocking #1512

merged 68 commits into from
Apr 29, 2024

Conversation

smalluban
Copy link
Collaborator

@smalluban smalluban commented Mar 25, 2024

WIP.

Usage of the TrackerException model in the background:

import TrackerException from '/store/tracker-exception.js';

// Resolve a full list of the models
await store.resolve([TrackerException])

// Resolve model by id
// The definition always returns a model with predefined values,
// but they are not saved until there is a `store.set()` call
// Still, I think this case should be used rarely in the BG
await store.resolve(TrackerException, 'trackerId...')

@smalluban smalluban marked this pull request as draft March 25, 2024 11:09
@smalluban smalluban added the v10 Applies to Ghostery Extension v10.x label Mar 26, 2024
@smalluban smalluban changed the title Selective Blocking Selective blocking Mar 26, 2024
@smalluban smalluban force-pushed the mv3-feat-selective-blocking branch 2 times, most recently from 8493a14 to db07447 Compare March 29, 2024 17:03
@smalluban smalluban force-pushed the mv3-feat-selective-blocking branch from db07447 to 10d8a9d Compare April 4, 2024 11:43
@smalluban smalluban added the package CI: create extension packages label Apr 5, 2024
@ghostery ghostery deleted a comment from github-actions bot Apr 5, 2024
@smalluban smalluban force-pushed the mv3-feat-selective-blocking branch from e6bd589 to d88f85e Compare April 5, 2024 11:53
@smalluban smalluban force-pushed the mv3-feat-selective-blocking branch from 1f11093 to f748fe5 Compare April 9, 2024 14:30
@ghostery ghostery deleted a comment from github-actions bot Apr 10, 2024
@ghostery ghostery deleted a comment from github-actions bot Apr 10, 2024
@chrmod chrmod marked this pull request as ready for review April 29, 2024 13:12
chrmod
chrmod previously approved these changes Apr 29, 2024
Copy link
Member

@chrmod chrmod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing!

I'm all for merging it in this state as it is already too big to handle.

Few things will require to be addressed before it can be released, for example Safari support.

beforeEach(() => {
exception = {
blocked: false,
blockedDomains: ['foo.org'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit of a weird setup, having a domain trusted and blocked at the same time. Is such a case possible to reach in production?

Also, initializing it with each tests, might be easier to read, since it makes the tests stand-alone and independent of each other. If code sharing is the concern, you can use a helper function.

Copy link
Member

@chrmod chrmod Apr 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is expected to have both blockedDomains and allowedDomains at the same time. In this way we remember the opposite exceptions when users toggle the blocking mode.

@chrmod chrmod merged commit 3665ffb into main Apr 29, 2024
2 checks passed
@chrmod chrmod deleted the mv3-feat-selective-blocking branch April 29, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package CI: create extension packages v10 Applies to Ghostery Extension v10.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants