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

Add built-in support for the wayback machine #3561

Merged
merged 21 commits into from
Dec 18, 2019
Merged

Add built-in support for the wayback machine #3561

merged 21 commits into from
Dec 18, 2019

Conversation

cezaraugusto
Copy link
Contributor

@cezaraugusto cezaraugusto commented Sep 27, 2019

close brave/brave-browser#6144

This change adds support for the Wayback Machine by archive.org.

Spec can be found at https://docs.google.com/document/d/1ioGkGUVmLE0ndfvLRBjDN1d9QtOKeyPOM-33lK0L78k/edit#heading=h.n61l82sr1zxg. For convenience I'm attaching the original infobar below.

There are two cases for the infobar:

  1. When a header response we expect is received:

Screen Shot 2019-10-30 at 5 37 44 PM

1.1 If accepted and Wayback machine has records, redirect the user, close the infobar
1.2 If accepted and Wayback machine has no records, update the infobar, as below:

Screen Shot 2019-10-30 at 5 37 33 PM

  1. If not accepted, close the infobar.

More snapshots

Screen Shot 2019-12-10 at 10 50 20 AM

Screen Shot 2019-12-10 at 10 50 34 AM

Screen Shot 2019-12-10 at 10 50 43 AM

Screen Shot 2019-12-10 at 10 52 00 AM

Screen Shot 2019-12-10 at 10 52 12 AM

Submitter Checklist:

Test Plan

npm run test brave_browser_tests -- --filter=BraveWaybackMachineTest.InfobarAddTest

  1. Check wayback option is enabled by default
  2. Go to https://brave.com/bo
  3. Check wayback infobar is shown
    4-1. Click the check button and throbber animation is started
    4-1.1 Check an archived version is loaded
    4-2. Click x button and infobar is just hidden
  4. Go to https://brave.com/abcdef
  5. Check wayback infobar is shown
  6. Click the check button and infobar is updated with not available message
  7. Turn off the wayback option
  8. Go to https://brave.com/bo and check wayback infobar is not displayed

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Request a design review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@simonhong
Copy link
Member

simonhong commented Dec 3, 2019

image
Basic implementation is almost finished except missing images.
@karenkliu Please attach image files for left side. And I used default sad icon. If we want to use different one, please also attach it.
@rebron

@simonhong simonhong force-pushed the ca-6144 branch 2 times, most recently from 49beeb6 to a0f9c77 Compare December 4, 2019 12:12
@simonhong
Copy link
Member

simonhong commented Dec 5, 2019

Hmm, I found infinite Layout loop when I repeatedly pushed reload. Investigating now.. Fixed.

@simonhong simonhong force-pushed the ca-6144 branch 2 times, most recently from e88561f to b0a24b1 Compare December 5, 2019 05:53
@karenkliu
Copy link

@simonhong Here you go!
assets.zip

@simonhong simonhong marked this pull request as ready for review December 6, 2019 07:46
@simonhong simonhong requested a review from bridiver as a code owner December 6, 2019 07:46
@simonhong simonhong requested a review from petemill December 6, 2019 07:47
@simonhong simonhong added CI/skip-android Do not run CI builds for Android CI/skip-ios Do not run CI builds for iOS CI/skip-macos-x64 Do not run CI builds for macOS x64 CI/skip-windows labels Dec 18, 2019
cezaraugusto and others added 21 commits December 19, 2019 05:53
This change adds the minimal files for built-in support
address brave/brave-browser#6144
This adds the ability to turn the Wayback Machine off.
Setting can be located under "extension" sidebar item.

Address brave/brave-browser#6144
* Assert true that extension is bundled
* Assert true that extension is enabled in default windows
* Assert false that extension is disabled in Tor windows
This creates a new section to host the Wayback Machine toggle option.
Option is located under Additional settings  panel as per spec.

For further info, see
https://docs.google.com/document/d/1ioGkGUVmLE0ndfvLRBjDN1d9QtOKeyPOM-33lK0L78k
fix deps dependency.
Using TabHelper is more efficient than using additional extension.
Wayback machine info bar is attached when WaybackMachineTabHelper
detects 404(or similar) error.
With this, other modules can get wayback url easily.
Maybe 404 error webui can re-use this in the future.
Implement wayback contents view in separate source file.
Fix infinite loop when when reload is requested repeatedly.
Don't block navigation for adding infobar.
To do that, custom throbber class is introduced instead of using
views::Throbber because it doesn't allow circle color for subclass.
and brave_wayback_machine communicates with brave layer with
BraveWaybackMachineDelegate.
Infobar view is created via delegate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/skip-android Do not run CI builds for Android CI/skip-ios Do not run CI builds for iOS CI/skip-macos-x64 Do not run CI builds for macOS x64 feature/wayback machine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

404 service - archived page recommendation
7 participants