philc / philc/vimium

Broken with backward-forward cache

Open
#4,225 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
27k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
Chrome recently introduces the bfcache (Back-forward cache) which they are beginning to enable by default, and morevoer they are blocking window.unload event handler. See

https://chromestatus.com/feature/5760325231050752

Now when you go back to a page in the bfcache, no content scripts are run again, and functionality such as link hints are broken. The root cause is that we have frameIdsForTab, so when we go to a new website the frameIds get replaced so even though the bfcache retains the scripts, from the background script side all state is erased.

To Reproduce
Steps to reproduce the behavior:

  1. Have BFCache enabled, and be in --enable-features=PermissionsPolicyUnload field trial
  2. Do a google search for some github repo. Navigate back/forward between google search results and github repo.
  3. Link hints broken

Note that the best way to verify whether BFCache was hit or not is to modify vimium_frontend to add an pageshow handler. This brokenness is only when bfcache is hit.

Browser and Vimium version

Chrome 110.0.5481.100, Custom build of Vimium.

Maybe this is also related to #4224 since I saw same behavior due to broken ability to communicate with background script. (Fwiw I feel bfcache is not a good idea, it breaks the model of the web that each page load is fresh... browsers moving further away from stateless hypertext and more towards stateful web application. Bfcache would not be needed if websites didn't use so much JS).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in Chrome 110 with BFCache enabled and the PermissionsPolicyUnload field trial, navigating between Google results and a GitHub repository. Inspect frameIdsForTab, the content scripts, and the background script; use a pageshow handler in vimium_frontend to confirm BFCache restores the page, and consider the work done when link hints function after back/forward navigation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.