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

Disable 1PES rule after auto-enabling it by domain blocking feature #20702

Closed
goodov opened this issue Jan 26, 2022 · 5 comments · Fixed by brave/brave-core#12089
Closed

Disable 1PES rule after auto-enabling it by domain blocking feature #20702

goodov opened this issue Jan 26, 2022 · 5 comments · Fixed by brave/brave-core#12089

Comments

@goodov
Copy link
Member

goodov commented Jan 26, 2022

When 1PES is automatically enabled during a blocked website visit, we should disable it after leaving the website.

Related: #19099

@goodov
Copy link
Member Author

goodov commented Feb 23, 2022

This issue slightly changes the logic that was initially implemented in #19099
Main differences:

  1. Automatically added rule at brave://settings/cookies is not a wildcard rule, but is a strict one with a scheme, exact domain name and port.
  2. When there is no more opened tabs with 1PES-enabled website, the automatically added URL should be removed from brave://settings/cookies.

Test cases

Prerequisites:

  1. Enable features on brave://flags: First Party Ephemeral Storage, Domain blocking using First Party Ephemeral Storage.

Case 1

  1. Open any website (that was not previously opened in a browser profile) from this list
  2. Expect the website is added in Sites that clear cookies when you close them section at brave://settings/cookies:
    image
  3. Expect no cookies or localStorage data is stored for a website.
  4. Close the tab with a website, expect the rule from brave://settings/cookies is removed.

Case 2

  1. Open any website (that was not previously opened in a browser profile) from this list
  2. Expect the website is added in Sites that clear cookies when you close them section at brave://settings/cookies:
    image
  3. Expect no cookies or localStorage data is stored for a website.
  4. Open the same website in a second tab.
  5. Close the first tab, expect the rule is still in the list.
  6. Close the second tab, expect the rule is removed.

Case 3

  1. Open any website (that was not previously opened in a browser profile) from this list
  2. Expect the website is added in Sites that clear cookies when you close them section at brave://settings/cookies:
    image
  3. Expect no cookies or localStorage data is stored for a website.
  4. Open the same website in a second tab.
  5. Navigate to another (non ad-blocked) website in the first tab, expect the rule is still in the list.
  6. Navigate to another (non ad-blocked) website in the second tab, expect the rule is removed.

Case 4

  1. Enable Aggressive blocking mode
  2. Open any website (that was not previously opened in a browser profile) from the list
  3. Expect a blocking interstitial is visible:
    image
  4. Expect the website is added in Sites that clear cookies when you close them section at brave://settings/cookies when Proceed is pressed without Don't warn me about this site again checkbox.
  5. Expect no cookies or localStorage data is stored for a website.
  6. Close the tab with a website, expect the rule is removed.
Case 5
  1. Enable Aggressive blocking mode
  2. Open any website (that was not previously opened in a browser profile) from the list
  3. Expect a blocking interstitial is visible
  4. Expect the website is not added in Sites that clear cookies when you close them section at brave://settings/cookies when Proceed is pressed with Don't warn me about this site again checkbox.
  5. Expect cookies or localStorage data is stored for a website (if a website does this).
  6. Close the tab with a website, expect the rule is removed.

@kjozwiak
Copy link
Member

kjozwiak commented Feb 24, 2022

Thanks for the STR/Cases @goodov. Super thorough and easy to follow 👍 Verified on Nightly via brave/brave-core#12089 (comment) for brave/brave-variations#224.

@MadhaviSeelam MadhaviSeelam added the QA/In-Progress Indicates that QA is currently in progress for that particular issue label Mar 7, 2022
@MadhaviSeelam
Copy link

MadhaviSeelam commented Mar 7, 2022

Verified 'Passed' using

Brave 1.37.83 Chromium: 99.0.4844.51 (Official Build) beta (64-bit)
Revision d537ec02474b5afe23684e7963d538896c63ac77-refs/branch-heads/4844@{#875}
OS Windows 11 Version 21H2 (Build 22000.493)

Prerequisites for below testcases:
Enable First Party Ephemeral Storage, Domain blocking using First Party Ephemeral Storage in Brave://flags

Example

enable in braveflags

Testcase 1

example example example
siteadded siteData localstorage

Testcase 2

`First tab` - Visited a website https://aim4media.com (Not opened previously or in above testcase 1) from the list provided in https://pgl.yoyo.org/adservers/serverlist.php?hostformat=adblockplus&mimetype=plaintext - Verified that the site was added into `Sites that clear cookies when you close them` section in `brave://settings/cookies` - Verified that there was nothing in `brave://settings/siteData` (no cookies/data belonging to the visited website) - Verified that `LocalStorage` was empty for https://aim4media.com via `DevTools`
example example example
websiteadded nolocalstoragedata siteData

Second tab

  • Opened https://aim4media.com in a second tab
  • Verified that the site is still being listed in the Sites that clear cookies when you close them section in brave://settings/cookies
  • Closed the first tab for https://aim4media.com and verified that the site is still being listed in the Sites that clear cookies when you close them section in brave://settings/cookies
  • Verified that LocalStorage was still empty for https://aim4media.com in the second tab
  • Verified that once second tab is closed, https://www.awempire.com is removed from Sites that clear cookies when you close them section in brave://settings/cookies
example example example
secondtab site_still_listed secondtabclosed

Testcase 3

ex ex ex
testcase3-sitedisplayed siteData localstorage
  • Navigate to https://videocardz.com (non ad-blocked website) in the first tab
  • Verified that the site (https://www.awempire.com) was still displayed in the Sites that clear cookies when you close them section in brave://settings/cookies
  • Navigate to https://brave.com (another non ad-blocked website) in the second tab
  • https://www.awempire.com is no longer displayed in there Sites that clear cookies when you close them section in brave://settings/cookies
ex ex
nonad-blockedsiteinfirsttab rulewasremovedwhennonadblockedsitesloadedinbothtabs

Testcase 4

  • Set Trackers & ads blocking as Aggressive in brave://settings/shields
  • Visited https://axonix.com from the list provided in https://pgl.yoyo.org/adservers/serverlist.php?hostformat=adblockplus&mimetype=plaintext
  • Verified that the interstitial page was being displayed without any issues
  • Verified that https://axonix.com is not displayed under Sites that clear cookies when you close them via brave://settings/cookies as Proceed wasn't clicked and user still sees the interstitial warning regarding Domain Blocked
  • Verified when clicked on Proceed in the interstitial page, https://axonix.com page is loaded
  • An entry for https://axonix.com should be added under Sites that clear cookies when you close them via brave://settings/cookies
  • Verified that there was nothing in brave://settings/siteData (no cookies/data belonging to the visited website)
  • Verified that LocalStorage has no data for https://axonix.com via DevTools
  • Verified that closing https://axonix.com removed the entry under 'Sites that clear cookies when you close them in brave://settings/cookies
ex ex ex ex ex ex
agressiveshields siteisnotlisted proceedclicked localstorage siteData site was removed

Testcase 5

ex ex ex ex
Proceedwasnotclicked sitewasnotadded localstorage siteData

Testcase 6

- Set Trackers & ads blocking as Aggressive in `brave://settings/shields` - Visited https://mathtag.com from the list provided in https://pgl.yoyo.org/adservers/serverlist.php?hostformat=adblockplus&mimetype=plaintext - Verified that the interstitial page was being displayed without any issues - Verified that https://mathtag.com is not displayed under `Sites that clear cookies when you close them` in `brave://settings/cookies` as Proceed wasn't clicked and user still sees the interstitial warning regarding Domain Blocked - Verified when `Don't warn me about this site again` checkbox is checked and clicked on Proceed in the interstitial page, https://mathtag.com page is loaded - An entry for https://mathtag.com should not be added under `Sites that clear cookies when you close them` via `brave://settings/cookies` - Verified that cookie and site data available in `brave://settings/siteData` (No data available for this website) - Verified that LocalStorage has no data for https://axonix.com via DevTools ((No data stored for this website)
ex ex ex ex ex ex ex
Screenshot 2022-03-08 090914 Screenshot 2022-03-08 090842 Screenshot 2022-03-08 090930 Screenshot 2022-03-08 091032 Screenshot 2022-03-08 091051 Screenshot 2022-03-08 091302 Screenshot 2022-03-08 091708

@MadhaviSeelam MadhaviSeelam added QA Pass-Win64 and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Mar 7, 2022
@stephendonner
Copy link

stephendonner commented Mar 18, 2022

Verified 'PASSED' using

Brave 1.37.92 Chromium: 99.0.4844.51 (Official Build) beta (x86_64)
Revision d537ec02474b5afe23684e7963d538896c63ac77-refs/branch-heads/4844@{#875}
OS macOS Version 11.6.3 (Build 20G415)

Prerequisites for below testcases:
Enable First Party Ephemeral Storage, Domain blocking using First Party Ephemeral Storage in Brave://flags

Example

Screen Shot 2022-03-17 at 6 09 09 PM

Testcase 1

- Install `1.37.x ` - Launch `brave` - Visited https://adnium.com website from the list provided in https://pgl.yoyo.org/adservers/serverlist.php?hostformat=adblockplus&mimetype=plaintext - Verified that the site was added into `Sites that clear cookies when you close them` section in `brave://settings/cookies` - Verified that there was nothing in `brave://settings/siteData` (no cookies/data belonging to the visited website) - Verified that `localStorage` was empty for https://adnium.com via `DevTools` - Verified that once the website was closed, https://adnium.com is removed from `Sites that clear cookies when you close them` section in `brave://settings/cookies`
example example example
Screen Shot 2022-03-17 at 6 11 25 PM Screen Shot 2022-03-17 at 6 11 40 PM Screen Shot 2022-03-17 at 6 12 16 PM

Testcase 2

First tab

example example example
Screen Shot 2022-03-17 at 6 20 37 PM Screen Shot 2022-03-17 at 6 20 42 PM Screen Shot 2022-03-17 at 6 21 10 PM

Second tab

  • Opened https://aim4media.com in a second tab
  • Verified that the site is still being listed in the Sites that clear cookies when you close them section in brave://settings/cookies
  • Closed the first tab for https://aim4media.com and verified that the site is still being listed in the Sites that clear cookies when you close them section in brave://settings/cookies
  • Verified that LocalStorage was still empty for https://aim4media.com in the second tab
  • Verified that once second tab is closed, https://www.awempire.com is removed from Sites that clear cookies when you close them section in brave://settings/cookies
example example example
Screen Shot 2022-03-17 at 6 23 10 PM Screen Shot 2022-03-17 at 6 23 32 PM Screen Shot 2022-03-17 at 6 24 07 PM

Testcase 3

ex ex ex ex
Screen Shot 2022-03-17 at 6 34 05 PM Screen Shot 2022-03-17 at 6 34 30 PM Screen Shot 2022-03-17 at 6 36 28 PM Screen Shot 2022-03-17 at 6 38 11 PM
  • Navigate to https://videocardz.com (non ad-blocked website) in the first tab
  • Verified that the site (https://www.awempire.com) was still displayed in the Sites that clear cookies when you close them section in brave://settings/cookies
  • Navigate to https://brave.com (another non ad-blocked website) in the second tab
  • https://www.awempire.com is no longer displayed in there Sites that clear cookies when you close them section in brave://settings/cookies
ex ex
Screen Shot 2022-03-17 at 6 40 16 PM Screen Shot 2022-03-17 at 6 40 31 PM

Testcase 4

  • Set Trackers & ads blocking as Aggressive in brave://settings/shields
  • Visited https://axonix.com from the list provided in https://pgl.yoyo.org/adservers/serverlist.php?hostformat=adblockplus&mimetype=plaintext
  • Verified that the interstitial page was being displayed without any issues
  • Verified that https://axonix.com is not displayed under Sites that clear cookies when you close them via brave://settings/cookies as Proceed wasn't clicked and user still sees the interstitial warning regarding Domain Blocked
  • Verified when clicked on Proceed in the interstitial page, https://axonix.com page is loaded
  • An entry for https://axonix.com should be added under Sites that clear cookies when you close them via brave://settings/cookies
  • Verified that there was nothing in brave://settings/siteData (no cookies/data belonging to the visited website)
  • Verified that LocalStorage has no data for https://axonix.com via DevTools
  • Verified that closing https://axonix.com removed the entry under 'Sites that clear cookies when you close them in brave://settings/cookies
ex ex ex ex ex ex ex ex
Screen Shot 2022-03-17 at 7 54 34 PM Screen Shot 2022-03-17 at 7 54 45 PM Screen Shot 2022-03-17 at 7 55 03 PM Screen Shot 2022-03-17 at 7 55 25 PM Screen Shot 2022-03-17 at 7 55 31 PM Screen Shot 2022-03-17 at 7 56 41 PM Screen Shot 2022-03-17 at 7 58 42 PM Screen Shot 2022-03-17 at 7 58 46 PM

Testcase 5

ex ex ex ex ex ex
Screen Shot 2022-03-17 at 8 01 09 PM Screen Shot 2022-03-17 at 8 03 27 PM Screen Shot 2022-03-17 at 8 04 02 PM Screen Shot 2022-03-17 at 8 04 22 PM Screen Shot 2022-03-17 at 8 04 38 PM Screen Shot 2022-03-17 at 8 05 12 PM

Testcase 6

  • Set Trackers & ads blocking as Aggressive in brave://settings/shields
  • Visited https://mathtag.com from the list provided in https://pgl.yoyo.org/adservers/serverlist.php?hostformat=adblockplus&mimetype=plaintext
  • Verified that the interstitial page was being displayed without any issues
  • Verified that https://mathtag.com is not displayed under Sites that clear cookies when you close them in brave://settings/cookies as Proceed wasn't clicked and user still sees the interstitial warning regarding Domain Blocked
  • Verified when Don't warn me about this site again checkbox is checked and clicked on Proceed in the interstitial page,
    https://mathtag.com page is loaded
  • An entry for https://mathtag.com should not be added under Sites that clear cookies when you close them via brave://settings/cookies
  • Verified that cookie and site data available in brave://settings/siteData (No data available for this website)
  • Verified that LocalStorage has no data for https://axonix.com via DevTools ((No data stored for this website)
ex ex ex ex ex ex ex ex
Screen Shot 2022-03-17 at 7 54 34 PM Screen Shot 2022-03-17 at 8 08 41 PM Screen Shot 2022-03-17 at 8 08 53 PM Screen Shot 2022-03-17 at 8 12 15 PM Screen Shot 2022-03-17 at 8 12 33 PM Screen Shot 2022-03-17 at 8 12 49 PM Screen Shot 2022-03-17 at 8 13 10 PM Screen Shot 2022-03-17 at 8 13 36 PM

@btlechowski
Copy link

Verification passed on

Brave 1.37.101 Chromium: 99.0.4844.83 (Official Build) beta (64-bit)
Revision b11086e62d7c1a44b0942ac5568d22a425c7ae35-refs/branch-heads/4844_74@{#5}
OS Ubuntu 20 LTS

Prerequisites for below testcases:
Enable First Party Ephemeral Storage, Domain blocking using First Party Ephemeral Storage in Brave://flags

Example

image

Testcase 1

image
image
image
image
image

Testcase 2

First tab

image
image
image

Second tab

  • Opened https://aim4media.com in a second tab
  • Verified that the site is still being listed in the Sites that clear cookies when you close them section in brave://settings/cookies
  • Closed the first tab for https://aim4media.com and verified that the site is still being listed in the Sites that clear cookies when you close them section in brave://settings/cookies
  • Verified that LocalStorage was still empty for https://aim4media.com in the second tab
  • Verified that once second tab is closed, https://aim4media.com is removed from Sites that clear cookies when you close them section in brave://settings/cookies

image
image
image

Testcase 3

image

  • Navigate to https://videocardz.com (non ad-blocked website) in the first tab

  • Verified that the site (https://aim4media.com) was still displayed in the Sites that clear cookies when you close them section in brave://settings/cookies
    image

  • Navigate to https://brave.com (another non ad-blocked website) in the second tab

  • https://aim4media.com is no longer displayed in there Sites that clear cookies when you close them section in brave://settings/cookies

image

Testcase 4

  • Set Trackers & ads blocking as Aggressive in brave://settings/shields
  • Visited https://axonix.com from the list provided in https://pgl.yoyo.org/adservers/serverlist.php?hostformat=adblockplus&mimetype=plaintext
  • Verified that the interstitial page was being displayed without any issues
  • Verified that https://axonix.com is not displayed under Sites that clear cookies when you close them via brave://settings/cookies as Proceed wasn't clicked and user still sees the interstitial warning regarding Domain Blocked
  • Verified when clicked on Proceed in the interstitial page, https://axonix.com page is loaded
  • An entry for https://axonix.com should be added under Sites that clear cookies when you close them via brave://settings/cookies
  • Verified that there was nothing in brave://settings/siteData (no cookies/data belonging to the visited website)
  • Verified that LocalStorage has no data for https://axonix.com via DevTools

image
image

image
image
image
image
image

Testcase 5

image
image
image
image
image

Testcase 6

image
image
image
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment