Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Browser view refactor #1346

Merged
merged 74 commits into from Mar 5, 2019
Merged

Browser view refactor #1346

merged 74 commits into from Mar 5, 2019

Conversation

pfrazee
Copy link
Member

@pfrazee pfrazee commented Feb 25, 2019

In an effort to solve the freezing issue (#1333) I've decided to refactor Beaker to use the BrowserView API rather than <webview>. This was a planned update already, but the freezing issue forced me to prioritize it. There will be other advantages to usability; most notably, devtools will be able to dock!

Implementing this change is a pretty big undertaking. Because I can't render shell-window HTML on top of a BrowserView, I have to reimplement all modals and menus as sub-windows that float over the shell window. Given the magnitude of that change, I decided now would be a good time to reimplement basically all of the shell-window UI code (which was pretty crufty). That includes a switch from yo-yo to LitElement, which I've been getting great results from lately.

Todo list:

  • Migrate to BrowserViews
  • Shell-window UI (tabs, navbar)
  • The window menu
  • Track view load state
  • Pinned tabs
  • Tab dragging
  • Tab context menu
  • Location bar w/auto-complete
  • Location bar context menu
  • Status bar
  • Browser menu
  • Bookmark menu
  • Page menu
  • Seeding menu
  • Donate menu
  • Site-info menu
  • Sync folder menu
  • Browser update available menu
  • Watchlist indicator button
  • Downloads UI
  • In-page context menu
  • Permission prompts UI
  • Create dat modal
  • Fork dat modal
  • Select dat modals
  • Basic auth modal
  • Prompt modal
  • Live reloading
  • Zoom control
  • Inpage find
  • Retained scroll y on refresh
  • Fullscreen controls
  • Tab media paused/playing/muted
  • Dat / https alternative detection
  • Markdown renderer
  • JSON renderer
  • Swipe-to-navigate (removed)
  • Dat timeout detection
  • window.open
  • Keyboard shortcuts
  • Focus-location command
  • Focus the location bar on "new tab"
  • Location bar autocomplete results need to be clickable
  • Replace titles in history if they change soon after navigation (updateHistory())
  • Site load errors
  • On page.url change, main is notified so that it can reconstruct the window-menu. (shell-window:set-current-location)
  • Tab-state snapshots
  • Make sure "onbeforeunload" is working
  • Restore tests
  • Final QA: Overall visuals
  • Final QA: Double check all old behaviors were carried over
  • Final QA: Windows
  • Final QA: Linux
  • Final QA: Test the auto-updater with a live system

Issues:

  • There appears to be an RPC stream leak (?)
  • View background color is off sometimes
  • Keyboard shortcuts stop working after focusing browserview
  • Subwindows should never handle window-menu events or keyboard shortcut events
  • Scrollbar shows up in the statusbar UI sometimes
  • The location bar "replace selected text" doesn't always work
  • Location bar should show URL that's being loaded, but go back to the old URL if canceled

@pfrazee
Copy link
Member Author

pfrazee commented Feb 25, 2019

Frustratingly, BrowserView reduces but doesn't eliminate the freezing issue. Webviews will freeze on any site, whereas BrowserView will only freeze on custom protocols.

EDIT: No worries, got a fix in the pipeline with the Electron team.

@pfrazee
Copy link
Member Author

pfrazee commented Mar 4, 2019

Almost there! Minus the vendored LitElement code, this PR is currently +7891/-710 (!)

I'm going to merge without removing some dead code so that I can also merge into the blue branch (which has modifications to some of the dead code). After merging, I'll make another PR that removes the dead code.

@pfrazee
Copy link
Member Author

pfrazee commented Mar 5, 2019

👍 This PR is ready to go. Merging now!

This won't fix the freezing issue. That's now being addressed with electron/electron#17221. We'll wait for that fix to land in electron to release a new Beaker with this PR.

Any folks building from source, feel free to give the new master a try and let me know how this refactor works for you. Hopefully there aren't too many new bugs or regressions.

@pfrazee pfrazee merged commit b8f51b9 into master Mar 5, 2019
@pfrazee pfrazee changed the title Browser view refactor (WIP) Browser view refactor Mar 5, 2019
@pfrazee pfrazee deleted the browser-view-refactor branch April 10, 2019 20:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant