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

De-AMPing Feature: Redirect an AMP page to its canonical non-AMP version #20458

Closed
ShivanKaul opened this issue Jan 11, 2022 · 11 comments · Fixed by brave/brave-core#11750
Closed

Comments

@ShivanKaul
Copy link
Collaborator

ShivanKaul commented Jan 11, 2022

We’d like to redirect Brave users from AMP pages to the canonical/non-AMP version of the page.

This issue captures only the first part of a complete De-AMP solution i.e. if the user tries to clicks on a link/tries to load a page that has AMP markup and contains a canonical link, then load the canonical link instead.

The plan is for this to be opt-out with a new setting in Security & Privacy section in brave://settings, controlled by Griffin.

@anthonypkeane
Copy link

Linked to #18321

@anthonypkeane
Copy link

Text for this setting

Header: Auto-redirect AMP pages
Body: Always visit original (non-AMP) page URLs, instead of Google's Accelerated Mobile Page versions.

On Android, please this setting under

Brave Shields & privacy

Default = On

@ShivanKaul ShivanKaul removed the OS/Android Fixes related to Android browser functionality label Mar 15, 2022
@ShivanKaul
Copy link
Collaborator Author

ShivanKaul commented Mar 16, 2022

@anthonypkeane I created #21643 for the Android-specific parts left for this feature. Will work on those next, once I get an Android device. Until then, the feature is default off (and there's no UI to switch it on).

@ShivanKaul ShivanKaul added this to the 1.38.x - Nightly milestone Mar 17, 2022
@LaurenWags
Copy link
Member

@ShivanKaul could you provide a bit more detail for the test plan from brave/brave-core#11750 (comment)? Particularly examples, etc. I'm not familiar with all of the items listed, so more information, steps, example sites, etc would be welcomed. Thanks!

@ShivanKaul
Copy link
Collaborator Author

ShivanKaul commented Apr 4, 2022

@LaurenWags I'll try to spin up a couple of test pages to address those test cases. But for a simple example, here's an AMP page: https://www.buzzfeed.com/ryanschocket2/snl-spoofs-will-smith-chris-rock-slap

(updated PR with QA notes brave/brave-core#11750 (comment))

@LaurenWags
Copy link
Member

Removed QA/Blocked per #20458 (comment) as brave/brave-core#11750 (comment) has been updated with more details. Thanks @ShivanKaul!

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

MadhaviSeelam commented Apr 5, 2022

Verified Passed using

Brave 1.38.83 Chromium: 100.0.4896.79 (Official Build) beta (64-bit)
Revision 8fb749dcab8700c24213791969e59deb72fee36f-refs/branch-heads/4896@{#1015}
OS Windows 11 Version 21H2 (Build 22000.593)
  1. Install 1.38.83
  2. Launch brave
Testcases 1:Inspected the element for following AMP pages
  1. Disable Auto-redirect AMP pagesinbrave://settings/privacy
  2. Disable Enable De-AMP flag - brave://flags/#brave-de-amp
  3. Relaunch Brave
  4. Visit AMP page https://shivankaul.com/brave/de-amp/test-small-amp.html.
    • Inspected element -amp attribute is shown in the top level <html amp> tag for the AMP page and has canonical link that redirects to html
  5. Close the tab and visit another AMP page https://shivankaul.com/brave/de-amp/test-small-amp-with-lightning.html
    • Inspected element and it contains lightning symbol in the top-level <html ⚡> tag for the AMP page and has canonical link that redirects to html
  6. Close the tab and visit https://shivankaul.com/brave/de-amp/test-no-canonical-link.html
    • Inspected element and it doesn't contain any canonical links or top-level tags
  7. Close the tab and visit https://shivankaul.com/brave/de-amp/test-wrong-scheme.html
    • Inspected element for canonical link that is non-HTTP(s) - <link rel="canonical" href="ipfs://QmcniBv7UQ4gGPQQW2BwbD4ZZHzN3o3tPuNLZCbBchd1zh">
  8. Close the tab and visit https://shivankaul.com/brave/de-amp/test-small-amp-same-canonical.html
    • Inspected the element and it has canonical link that is pointed to original/same URL
  9. Close the tab and visit https://www.buzzfeed.com/amphtml/ryanschocket2/snl-spoofs-will-smith-chris-rock-slap
    • Inspected the element and it has canonical link that is pointed to https://www.buzzfeed.com/ryanschocket2/snl-spoofs-will-smith-chris-rock-slap
s1 s2 s4 s5 s6 s7 s8 s9
step1 step2 step4 step5 step6 step 7 step8 image
Testcase 2: Verified AMP page will not be redirected, if `De-AMP` flag and `Auto-redirect AMP page` pref are disabled
  1. Disable Auto-redirect AMP pages inbrave://settings/privacy
  2. Disable #brave-de-amp flag in brave://flags
  3. Relaunch the browser
  4. Visit https://shivankaul.com/brave/de-amp/test-small-amp.html
  5. Inspect the page and it showed amp as attributte
  6. Contains canonical in the tag
  7. AMP Page is not redirected to brave.com
ex1 ex2 ex3
Pref turn off flag off amp

Pre-requisites for following testcases

  1. Verified brave://settings/privacy: Auto-redirect AMP pages enabled by default
  2. Verified Enable De-AMP enabled by default in brave://flags/#brave-de-amp
Testcase 3:Verified De-AMPing works as expected i.e redirects to `brave.com` with default settings
  1. Visit https://shivankaul.com/brave/de-amp/test-small-amp.html
  2. De-AMPing worked i.e AMP page is redirected to brave.com as it contained the markup for top-level <html amp>
  3. The markup was verified in Testcase 1 for the above AMP page and amp attribute is shown in the top level <html amp> tag for the AMP page and has canonical link that redirects to html
ex1 ex2 ex3
flag on autodirect on amp
Testcase 4:Verified `De-amping` works if the AMP page contains emoji `lightning symbol` instead of "amp" as attribute
  1. Visit https://shivankaul.com/brave/de-amp/test-small-amp-with-lightning.html
  2. De-AMPing worked i.e AMP page is redirected to brave.com as it contained markup for top-level <html ⚡> tag
  3. The markup was verified in Testcase 1 for the above AMP page has lightning tag and contains canonical in the tag for redirect
lightening
Testcase 5: Verified De-amping will not work for AMP page with no canonical link
  1. Visit https://shivankaul.com/brave/de-amp/test-no-canonical-link.html
  2. De-AMPing did not work i.e AMP page is not redirected since there is no canonical link tag
  3. The markup was verified in Testcase 1, for the above AMP page has no canonial link tag hence no redirect available
scenario 4- no canonical link
Testcase 6:Verified De-amping will not work for AMP page that includes canonical link with scheme != HTTP(S)
  1. Visit https://shivankaul.com/brave/de-amp/test-wrong-scheme.html
  2. "De-AMPing did not work i.e AMP page is not redirected since the AMP page has canonical link with scheme non HTTP(S)
  3. Verified in Testcase 1, that the above AMP page has canonical link with scheme non HTTP(S)
Testcase6-non
Testcase 7:Verified De-amping will not work for AMP page with canonical link same as original URL
  1. Visit https://shivankaul.com/brave/de-amp/test-wrong-scheme.html
  2. "De-AMPing did not work i.e AMP page is not redirected since the AMP page has canonical link same as original URL
  3. Verified in Testcase 1, that the above AMP page has canonical link same as original URL
testcase7-canonicallinksameasurl
Testcase 8: Verified navigating backward and forward ignores the AMP page in history
  1. Visited example.com
  2. Visited AMP page in the same tab- https://shivankaul.com/brave/de-amp/test-small-amp.html
  3. Page is redirected to brave.com
  4. Visited https://basicattentiontoken.org in the same tab
  5. clicked back in the browser
  6. Returned to brave.com
  7. Clicked back again
  8. AMP page https://shivankaul.com/brave/de-amp/test-small-amp.html is ignored and is not listed in history
  9. Clicked forward
  10. User is taken brave.com
  11. Clicked forward again
  12. Returned to https://basicattentiontoken.org
  13. AMP page https://shivankaul.com/brave/de-amp/test-small-amp.html is ignored and is not listed in history
  14. Verified the history lists- example.com, brave.com and basicattentiontoken.org
ss1 ss2 ss3 ss4 ss5 ss6 ss7 ss8 ss9
screenshot1 screenshot2 screenshot3 screenshot4 screenshot5 screenshot6 screenshot7 screenshot8 history
Testcase 9: Verified Restore De-Amped page

1.Visit https://shivankaul.com/brave/de-amp/test-small-amp.html
2.Page should be redirected to brave.com
3.Enable few tabs
4.Close brave.com tab
5.Restore the tab (ctrl+shift+t in windows)
6. De-Amped page loaded i.e. brave.com

ex1 ex2 ex3
restore restore resetore3
Testcase 10: Verified De-AMP works well with small pages < 64 K works expected
  1. Visit https://shivankaul.com/brave/de-amp/test-small-amp.html
  2. De-AMPing worked i.e AMP page is redirected to brave.com
amp
Testcase 11: Verified Large AMP page (> 64K) works as expected
  1. Visit https://www.buzzfeed.com/amphtml/ryanschocket2/snl-spoofs-will-smith-chris-rock-slap
  2. De-AMP ing worked i.e AMP page is redirected to https://www.buzzfeed.com/ryanschocket2/snl-spoofs-will-smith-chris-rock-slap
  3. The markup was verified in Testcase 1 for the above AMP page that has canonical link to https://www.buzzfeed.com/ryanschocket2/snl-spoofs-will-smith-chris-rock-slap
ex1 ex2
image bz
Testcase 12: Verified De-AMPing will not work with `Auto-redirect AMP pages` `OFF` and De-AMP feature flag `ON` (default)
  1. Disable Auto-redirect AMP pagesinbrave://settings/privacy
  2. Leave Enable De-AMP flag as a default in brave://flags/#brave-de-amp
  3. Visit AMP page https://shivankaul.com/brave/de-amp/test-small-amp.html
  4. Page is not redirected not to brave.com.
ex1 ex2 ex3
auto direct off flag on testcase12
Testcase 13: Verified De-AMPing will not work with `Auto-redirect AMP pages` `ON` and De-AMP feature flag `OFF`
  1. EnableAuto-redirect AMP pagesinbrave://settings/privacy
  2. Disable Enable De-AMP flag in brave://flags/#brave-de-amp
  3. Visit AMP page https://shivankaul.com/brave/de-amp/test-small-amp.html
  4. Page is not redirected not to brave.com.
ex1 ex2 ex3
autodirect on AMP flag off
testcase13

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

stephendonner commented Apr 8, 2022

Verified PASSED using

Brave 1.38.83 Chromium: 100.0.4896.79 (Official Build) beta (x86_64)
Revision 8fb749dcab8700c24213791969e59deb72fee36f-refs/branch-heads/4896@{#1015}
OS macOS Version 11.6.5 (Build 20G527)

Shared steps:

  1. install 1.38.83
  2. launch Brave
Testcase 1: Inspected the element AMP pages
  1. Disable Auto-redirect AMP pagesinbrave://settings/privacy
  2. Disable Enable De-AMP flag - brave://flags/#brave-de-amp
  3. Relaunch Brave
  4. Visit AMP page https://shivankaul.com/brave/de-amp/test-small-amp.html.
    • Inspected element and amp attribute will be shown in the top level <html amp> tag for the AMP page and has canonical link that redirects to html
  5. Close the tab and visit another AMP page https://shivankaul.com/brave/de-amp/test-small-amp-with-lightning.html
    • Inspected element and it contains lightning symbol in the top-level <html ⚡> tag for the AMP page and has canonical link that redirects to html
  6. Close the tab and visit https://shivankaul.com/brave/de-amp/test-no-canonical-link.html
    • Inspected element and it doesn't contain any canonical links or top-level tags
  7. Close the tab and visit https://shivankaul.com/brave/de-amp/test-wrong-scheme.html
    • Inspected element for canonical link that is non-HTTP(s) - <link rel="canonical" href="ipfs://QmcniBv7UQ4gGPQQW2BwbD4ZZHzN3o3tPuNLZCbBchd1zh">
  8. Close the tab and visit https://shivankaul.com/brave/de-amp/test-small-amp-same-canonical.html
    • Inspected the element and it has canonical link that is pointed to original/same URL
  9. Close the tab and visit https://www.buzzfeed.com/amphtml/ryanschocket2/snl-spoofs-will-smith-chris-rock-slap
    • Inspected the element and it has canonical link that is pointed https://www.buzzfeed.com/ryanschocket2/snl-spoofs-will-smith-chris-rock-slap
s1 s2 s4 s5 s6 s7 s8 s9
Screen Shot 2022-04-07 at 6 46 24 PM Screen Shot 2022-04-07 at 6 47 13 PM Screen Shot 2022-04-07 at 6 48 31 PM Screen Shot 2022-04-07 at 6 49 06 PM Screen Shot 2022-04-07 at 6 49 28 PM Screen Shot 2022-04-07 at 7 02 24 PM Screen Shot 2022-04-07 at 6 49 55 PM Screen Shot 2022-04-07 at 6 52 19 PM
Testcase 2: Verified AMP page will not be redirected, if `De-AMP` flag and `Auto-redirect AMP page` pref are disabled
  1. Disable Auto-redirect AMP pagesinbrave://settings/privacy
  2. Disable #brave-de-amp flag in brave://flags/
  3. Relaunch the browser
  4. Visit https://shivankaul.com/brave/de-amp/test-small-amp.html
  5. Inspect the page and it showedamp as attribute
  6. Contains canonical in the tag
  7. AMP Page is not redirected to brave.com
ex1 ex2 ex3
Screen Shot 2022-04-07 at 7 17 26 PM Screen Shot 2022-04-07 at 7 19 12 PM Screen Shot 2022-04-07 at 7 19 54 PM

Prerequisites for the following testcases:

  1. Verified brave://settings/privacy: Auto-redirect AMP pages is enabled by default
  2. Verified Enable De-AMP is enabled by default in brave://flags/#brave-de-amp
Testcase 3: Verified de-AMPing works as expected i.e redirects to brave.com with default settings
  1. Visit https://shivankaul.com/brave/de-amp/test-small-amp.html
  2. De-AMPing worked i.e AMP page is redirected to brave.com, as it contained the markup for top-level <html amp>
  3. The markup was verified in Testcase 1 for the above AMP page and amp attribute will be shown in the top level <html amp> tag for the AMP page and has canonical link that redirects to html
ex1 ex2 ex3
Screen Shot 2022-04-07 at 7 23 42 PM Screen Shot 2022-04-07 at 7 24 37 PM Screen Shot 2022-04-07 at 7 19 54 PM
Testcase 4: Verified de-AMPing works if the AMP page contains emoji `lightning symbol` instead of "amp" as attribute
  1. Visit https://shivankaul.com/brave/de-amp/test-small-amp-with-lightning.html
  2. De-AMPing worked i.e AMP page is redirected to brave.com as it contained markup for top-level <html ⚡> tag
  3. The markup was verified in Testcase 1 for the above AMP page has lightning <html ⚡> tag and contains canonical in the tag for redirect
Screen Shot 2022-04-07 at 6 49 06 PM
Testcase 5: Verified de-AMPing will not work for AMP page with no canonical link
  1. Visit https://shivankaul.com/brave/de-amp/test-no-canonical-link.html
  2. De-AMPing did not work i.e AMP page is not redirected since there is no canonical link tag
  3. The markup was verified in Testcase 1, for the above AMP page has no canonical link tag hence no redirect available
Screen Shot 2022-04-07 at 8 49 23 PM
Testcase 6: Verified de-AMPing will not work for AMP page that includes canonical link with scheme != HTTP(S)
  1. Visit https://shivankaul.com/brave/de-amp/test-wrong-scheme.html
  2. De-AMPing did not work i.e AMP page is not redirected since the AMP page has canonical link with scheme non HTTP(S)
  3. Verified in Testcase 1, Step 8, that the above AMP page has canonical link with scheme non HTTP(S)
Screen Shot 2022-04-07 at 8 43 08 PM
Testcase 7: Verified de-AMPing will not work for AMP page with canonical link same as original URL
  1. Visit https://shivankaul.com/brave/de-amp/test-small-amp-same-canonical.html
  2. "De-AMPing did not work i.e AMP page is not redirected since the AMP page has canonical link same as original URL
  3. Verified in Testcase 1, Step 9, that the above AMP page has canonical link same as original URL
Screen Shot 2022-04-07 at 8 50 31 PM
Testcase 8: Verified navigating backward and forward ignores the AMP page in history
  1. Visited example.com
  2. Visited AMP page in the same tab- https://shivankaul.com/brave/de-amp/test-small-amp.html
  3. Page is redirected to brave.com
  4. Visited https://basicattentiontoken.org in the same tab
  5. clicked back in the browser
  6. Returned to brave.com
  7. Clicked back again
  8. AMP page https://shivankaul.com/brave/de-amp/test-small-amp.html is ignored and is not listed in history
  9. Clicked forward
  10. User is taken brave.com
  11. Clicked forward again
  12. Returned to https://basicattentiontoken.org
  13. AMP page https://shivankaul.com/brave/de-amp/test-small-amp.html is ignored and is not listed in history
  14. Verified the history lists example.com, brave.com, and basicattentiontoken.org
example example example example example example example example
Screen Shot 2022-04-07 at 8 57 15 PM Screen Shot 2022-04-07 at 8 58 06 PM Screen Shot 2022-04-07 at 8 58 33 PM Screen Shot 2022-04-07 at 8 58 53 PM Screen Shot 2022-04-07 at 8 59 00 PM Screen Shot 2022-04-07 at 8 59 03 PM Screen Shot 2022-04-07 at 8 59 06 PM Screen Shot 2022-04-07 at 8 59 17 PM
Testcase 9: Verified restore de-AMPed page
  1. Visit https://shivankaul.com/brave/de-amp/test-small-amp.html
  2. Page should be redirected to brave.com
  3. Opened a few tabs
  4. Close brave.com tab
  5. Restore the tab
  6. De-AMPed page loaded
ex1 ex2 ex3
Screen Shot 2022-04-07 at 8 01 31 PM Screen Shot 2022-04-07 at 8 03 08 PM Screen Shot 2022-04-07 at 8 04 13 PM
Testcase 10: Verified de-AMPing works well with small pages < 64 K works expected
  1. Visit https://shivankaul.com/brave/de-amp/test-small-amp.html
  2. De-AMPing worked i.e AMP page is redirected to brave.com
Screen Shot 2022-04-07 at 7 59 03 PM
Testcase 11: Verified large AMP page (> 64K) works as expected
  1. Visit https://www.buzzfeed.com/amphtml/ryanschocket2/snl-spoofs-will-smith-chris-rock-slap
  2. De-AMP ing worked i.e AMP page is redirected to https://www.buzzfeed.com/ryanschocket2/snl-spoofs-will-smith-chris-rock-slap
  3. The markup was verified in Testcase 1 for the above AMP page has canonical link to https://www.buzzfeed.com/ryanschocket2/snl-spoofs-will-smith-chris-rock-slap
Screen Shot 2022-04-07 at 8 27 00 PM
Testcase 12: Verified de-AMPing will not work with Auto-redirect AMP pages ON and de-AMPing feature flag ON (default)
  1. Disable Auto-redirect AMP pagesinbrave://settings/privacy
  2. Keep Enable De-AMP flag as a default in brave://flags/#brave-de-amp
  3. Visit AMP page https://shivankaul.com/brave/de-amp/test-small-amp.html
  4. Page is not redirected to brave.com
ex1 ex2 ex3
Screen Shot 2022-04-07 at 7 49 24 PM Screen Shot 2022-04-07 at 7 50 04 PM Screen Shot 2022-04-07 at 7 50 13 PM
Testcase 13: Verified de-AMPing will not work with Auto-redirect AMP pages ON and de-AMPing feature flag OFF
  1. EnableAuto-redirect AMP pagesinbrave://settings/privacy
  2. Disable Enable De-AMP flag in brave://flags/#brave-de-amp
  3. Visit AMP page https://shivankaul.com/brave/de-amp/test-small-amp.html
  4. Page is not redirected to brave.com
ex1 ex2 ex3
Screen Shot 2022-04-07 at 7 46 26 PM Screen Shot 2022-04-07 at 7 46 46 PM Screen Shot 2022-04-07 at 7 46 58 PM

@stephendonner stephendonner added QA/In-Progress Indicates that QA is currently in progress for that particular issue QA Pass-macOS labels Apr 8, 2022
@stephendonner stephendonner removed the QA/In-Progress Indicates that QA is currently in progress for that particular issue label Apr 8, 2022
@LaurenWags LaurenWags added the OS/Android Fixes related to Android browser functionality label Apr 22, 2022
@LaurenWags
Copy link
Member

LaurenWags commented Apr 22, 2022

Added OS/Android based on issues uplifted to 1.38.x. If this does not need to be tested on Android please remove.

See discussion here: https://bravesoftware.slack.com/archives/CHGKGMHDJ/p1650626855897409?thread_ts=1650384586.357469&cid=CHGKGMHDJ.

@kjozwiak kjozwiak removed the OS/Android Fixes related to Android browser functionality label Apr 22, 2022
@kjozwiak
Copy link
Member

Added OS/Android based on issues uplifted to 1.38.x. If this does not need to be tested on Android please remove.

See discussion here: https://bravesoftware.slack.com/archives/CHGKGMHDJ/p1650626855897409?thread_ts=1650384586.357469&cid=CHGKGMHDJ.

@LaurenWags Android we'll be checked via #21643 👍

@btlechowski
Copy link

Verified PASSED using

Brave 1.38.83 Chromium: 100.0.4896.79 (Official Build) beta (x86_64)
Revision 8fb749dcab8700c24213791969e59deb72fee36f-refs/branch-heads/4896@{#1015}
OS Ubuntu 18.04 LTS

Shared steps:

  1. install 1.38.x
  2. launch Brave
Testcase 1: Inspected the element AMP pages
  1. Disable Auto-redirect AMP pagesinbrave://settings/privacy
  2. Disable Enable De-AMP flag - brave://flags/#brave-de-amp
  3. Relaunch Brave
  4. Visit AMP page https://shivankaul.com/brave/de-amp/test-small-amp.html.
    • Inspected element and amp attribute will be shown in the top level <html amp> tag for the AMP page and has canonical link that redirects to html
  5. Close the tab and visit another AMP page https://shivankaul.com/brave/de-amp/test-small-amp-with-lightning.html
    • Inspected element and it contains lightning symbol in the top-level <html ⚡> tag for the AMP page and has canonical link that redirects to html
  6. Close the tab and visit https://shivankaul.com/brave/de-amp/test-no-canonical-link.html
    • Inspected element and it doesn't contain any canonical links or top-level tags
  7. Close the tab and visit https://shivankaul.com/brave/de-amp/test-wrong-scheme.html
    • Inspected element for canonical link that is non-HTTP(s) - <link rel="canonical" href="ipfs://QmcniBv7UQ4gGPQQW2BwbD4ZZHzN3o3tPuNLZCbBchd1zh">
  8. Close the tab and visit https://shivankaul.com/brave/de-amp/test-small-amp-same-canonical.html
    • Inspected the element and it has canonical link that is pointed to original/same URL
  9. Close the tab and visit https://www.buzzfeed.com/amphtml/ryanschocket2/snl-spoofs-will-smith-chris-rock-slap
    • Inspected the element and it has canonical link that is pointed https://www.buzzfeed.com/ryanschocket2/snl-spoofs-will-smith-chris-rock-slap

image
image
image
image
image
image
image
image

Testcase 2: Verified AMP page will not be redirected, if `De-AMP` flag and `Auto-redirect AMP page` pref are disabled
  1. Disable Auto-redirect AMP pagesinbrave://settings/privacy
  2. Disable #brave-de-amp flag in brave://flags/
  3. Relaunch the browser
  4. Visit https://shivankaul.com/brave/de-amp/test-small-amp.html
  5. Inspect the page and it showedamp as attribute
  6. Contains canonical in the tag
  7. AMP Page is not redirected to brave.com

image
image
image

Prerequisites for the following testcases:

  1. Verified brave://settings/privacy: Auto-redirect AMP pages is enabled by default
  2. Verified Enable De-AMP is enabled by default in brave://flags/#brave-de-amp
Testcase 3: Verified de-AMPing works as expected i.e redirects to brave.com with default settings
  1. Visit https://shivankaul.com/brave/de-amp/test-small-amp.html
  2. De-AMPing worked i.e AMP page is redirected to brave.com, as it contained the markup for top-level <html amp>
  3. The markup was verified in Testcase 1 for the above AMP page and amp attribute will be shown in the top level <html amp> tag for the AMP page and has canonical link that redirects to html

image
image
image

Testcase 4: Verified de-AMPing works if the AMP page contains emoji `lightning symbol` instead of "amp" as attribute
  1. Visit https://shivankaul.com/brave/de-amp/test-small-amp-with-lightning.html
  2. De-AMPing worked i.e AMP page is redirected to brave.com as it contained markup for top-level <html ⚡> tag
  3. The markup was verified in Testcase 1 for the above AMP page has lightning <html ⚡> tag and contains canonical in the tag for redirect

image

Testcase 5: Verified de-AMPing will not work for AMP page with no canonical link
  1. Visit https://shivankaul.com/brave/de-amp/test-no-canonical-link.html
  2. De-AMPing did not work i.e AMP page is not redirected since there is no canonical link tag
  3. The markup was verified in Testcase 1, for the above AMP page has no canonical link tag hence no redirect available

image

Testcase 6: Verified de-AMPing will not work for AMP page that includes canonical link with scheme != HTTP(S)
  1. Visit https://shivankaul.com/brave/de-amp/test-wrong-scheme.html
  2. De-AMPing did not work i.e AMP page is not redirected since the AMP page has canonical link with scheme non HTTP(S)
  3. Verified in Testcase 1, Step 8, that the above AMP page has canonical link with scheme non HTTP(S)

image

Testcase 7: Verified de-AMPing will not work for AMP page with canonical link same as original URL
  1. Visit https://shivankaul.com/brave/de-amp/test-small-amp-same-canonical.html
  2. "De-AMPing did not work i.e AMP page is not redirected since the AMP page has canonical link same as original URL
  3. Verified in Testcase 1, Step 9, that the above AMP page has canonical link same as original URL

image

Testcase 8: Verified navigating backward and forward ignores the AMP page in history
  1. Visited example.com
  2. Visited AMP page in the same tab- https://shivankaul.com/brave/de-amp/test-small-amp.html
  3. Page is redirected to brave.com
  4. Visited https://basicattentiontoken.org in the same tab
  5. clicked back in the browser
  6. Returned to brave.com
  7. Clicked back again
  8. AMP page https://shivankaul.com/brave/de-amp/test-small-amp.html is ignored and is not listed in history
  9. Clicked forward
  10. User is taken brave.com
  11. Clicked forward again
  12. Returned to https://basicattentiontoken.org
  13. AMP page https://shivankaul.com/brave/de-amp/test-small-amp.html is ignored and is not listed in history
  14. Verified the history lists example.com, brave.com, and basicattentiontoken.org

image
image
image
image
image
image
image
image

Testcase 9: Verified restore de-AMPed page
  1. Visit https://shivankaul.com/brave/de-amp/test-small-amp.html
  2. Page should be redirected to brave.com
  3. Opened a few tabs
  4. Close brave.com tab
  5. Restore the tab
  6. De-AMPed page loaded

image
image
image
image

Testcase 10: Verified de-AMPing works well with small pages < 64 K works expected
  1. Visit https://shivankaul.com/brave/de-amp/test-small-amp.html
  2. De-AMPing worked i.e AMP page is redirected to brave.com

image

Testcase 11: Verified large AMP page (> 64K) works as expected
  1. Visit https://www.buzzfeed.com/amphtml/ryanschocket2/snl-spoofs-will-smith-chris-rock-slap
  2. De-AMP ing worked i.e AMP page is redirected to https://www.buzzfeed.com/ryanschocket2/snl-spoofs-will-smith-chris-rock-slap
  3. The markup was verified in Testcase 1 for the above AMP page has canonical link to https://www.buzzfeed.com/ryanschocket2/snl-spoofs-will-smith-chris-rock-slap

image

Testcase 12: Verified de-AMPing will not work with Auto-redirect AMP pages ON and de-AMPing feature flag ON (default)
  1. Disable Auto-redirect AMP pagesinbrave://settings/privacy
  2. Keep Enable De-AMP flag as a default in brave://flags/#brave-de-amp
  3. Visit AMP page https://shivankaul.com/brave/de-amp/test-small-amp.html
  4. Page is not redirected to brave.com

image
image

Testcase 13: Verified de-AMPing will not work with Auto-redirect AMP pages ON and de-AMPing feature flag OFF
  1. EnableAuto-redirect AMP pagesinbrave://settings/privacy
  2. Disable Enable De-AMP flag in brave://flags/#brave-de-amp
  3. Visit AMP page https://shivankaul.com/brave/de-amp/test-small-amp.html
  4. Page is not redirected to brave.com

image
image
image

avinassh pushed a commit to avinassh/brave-browser-hardening that referenced this issue May 29, 2022
 - Added the ability to redirect an AMP page to its canonical non-AMP version. ([#20458](brave/brave-browser#20458))
 - Added "Select network" field in the Brave Wallet "Add custom asset" modal. ([#21656](brave/brave-browser#21656))
 - Added isBraveWallet property to window.ethereum. ([#21949](brave/brave-browser#21949))
 - Added the ability to copy Brave Wallet transaction hash from "Transactions" on the "Portfolio" page. ([#19886](brave/brave-browser#19886))
 - Added confirmation screen after transaction is approved for Brave Wallet. ([#21733](brave/brave-browser#21733))
 - Added bottom padding to the Brave Wallet swap container. ([#21340](brave/brave-browser#21340))
 - Added loading skeletons for various areas within Brave Wallet. ([#21339](brave/brave-browser#21339))
 - Implemented balance updater interval for Brave Wallet. ([#21304](brave/brave-browser#21304))
 - Updated design for Brave Shields. ([#18630](brave/brave-browser#18630))
 - Updated IPFS node to go-ipfs v0.12.0. ([#21219](brave/brave-browser#21219))
 - Updated adblocking to execute all cosmetic scriptlets even if one fails. ([#21932](brave/brave-browser#21932))
 - Updated wording on Brave Wallet backup reminder banner. ([#21312](brave/brave-browser#21312))
 - Updated Brave Wallet swap capability to prevent unnecessarily encountering "Too many decimal places" error. ([#21527](brave/brave-browser#21527))
 - Updated URL for Brave Wallet Ropsten Test Faucet network. ([#21240](brave/brave-browser#21240))
 - Updated Brave Wallet password field to be cleared when an incorrect password is entered. ([#21010](brave/brave-browser#21010))
 - Updated "Portfolio" page of Brave Wallet to return all EVM network tokens. ([#20854](brave/brave-browser#20854))
 - Updated UI to increase spacing between "Assets" and "Transactions" on "Accounts" subview page of Brave Wallet. ([#21532](brave/brave-browser#21532))
 - Updated link text color to blue for Brave Wallet onboarding screen. ([#20302](brave/brave-browser#20302))
 - Updated alignment of options available from the Brave Wallet "More" menu. ([#19680](brave/brave-browser#19680))
 - Renamed "Monthly Contributions" to "Monthly Tips" for Brave Rewards. ([#20564](brave/brave-browser#20564))
 - Removed redirect after adding an account to Brave Wallet from the portfolio asset details screen. ([#19138](brave/brave-browser#19138))
 - Removed referral code from P3A reports. ([#21460](brave/brave-browser#21460))
 - Fixed unexpected storage cleanup on site close when "Clear cookies and site data when you close all windows" is enabled under brave://settings/cookies. ([#22493](brave/brave-browser#22493))
 - Fixed unblocked cookie consent dialogs on some websites when the brave://flags/#brave-adblock-cookie-list-default is enabled. ([#22032](brave/brave-browser#22032))
 - Fixed inability to solve Brave Rewards CAPTCHA in certain cases. ([#22180](brave/brave-browser#22180))
 - Fixed inability to import MetaMask wallet to Brave Wallet. ([#22492](brave/brave-browser#22492))
 - Fixed failed second sign request (eth_signTypedData_v4) for Loopring.io L2 activation when using Brave Wallet. ([#22070](brave/brave-browser#22070))
 - Fixed data on "Portfolio" page of Brave Wallet not being properly displayed due to parsing error. ([#21941](brave/brave-browser#21941))
 - Fixed broken placeholder icons for ERC721 tokens on Brave Wallet "Account" page. ([#21549](brave/brave-browser#21549))
 - Fixed "JSON data is not expected" when trying to import a crypto wallet into Brave Wallet in certain cases. ([#19526](brave/brave-browser#19526))
 - Fixed Brave Wallet network selector list being partially blurred on page load. ([#21423](brave/brave-browser#21423))
 - Fixed Brave Wallet "Add Custom Asset" modal incorrectly being populated with previously added custom token details. ([#21337](brave/brave-browser#21337))
 - Fixed EIP-1559 gas oracle incorrectly firing on non-EIP-1559 networks for Brave Wallet. ([#21107](brave/brave-browser#21107))
 - Fixed Brave Wallet percentage selector remaining selected when input value was updated. ([#20315](brave/brave-browser#20315))
 - Fixed Speedreader icon incorrectly disappearing in certain cases. ([#18243](brave/brave-browser#18243))
 - Fixed inability to exit reader mode when Speedreader is disabled. ([#18242](brave/brave-browser#18242))
 - Upgraded Chromium to 101.0.4951.41. ([#22431](brave/brave-browser#22431)) ([Changelog for 101.0.4951.41](https://chromium.googlesource.com/chromium/src/+log/100.0.4896.127..101.0.4951.41?pretty=fuller&n=1000))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment