brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.77k stars 2.32k forks source link

Speculation Rules disabled even when "Preload pages" is enabled #41164

Open tunetheweb opened 1 month ago

tunetheweb commented 1 month ago

Description

The Speculation Rules API allows site owners to prefetch or prerender future same-origin navigations (with some limited same-site/cross-origin and cross-site speculations).

I understand Brave turns off the Preload Pages setting that this new API needs which is fine. However, when this setting is explicitly enabled by the user, I would expect this feature to work.

Steps to reproduce

  1. Open DevTools
  2. Use Application Panel
  3. Use Background Services -> Speculative loads->Speculations side panel
  4. Navigate to https://prerender-demos.glitch.me/ (note this must be AFTER opening the above DevTools panel).
  5. Note that no speculations load in this panel, and DevTools gives a warning that this has been disabled in settings or an extension:
image

Actual result

See above screenshot

Expected result

Speculations should be allowed if the user has explicitly enabled them.

Alternatively, if Brave feels strongly this should never be enabled, then the DevTools error message should be updated to avoid confusing the user.

See also questions on Brave here:

Reproduces how often

Easily reproduced

Desktop Brave version (brave://version info)

1.69.168 Chromium: 128.0.6613.138 (Official Build) (arm64)

Android device

Channel information

Reproducibility

Miscellaneous information

I noticed here this was explicitly disabled when this was considered experimental: https://github.com/brave/brave-core/commit/fe8b2f327f258c241345c67ba7224bd34d34a6fc

But now it's a fully Chromium feature is it still necessary to have disabled?

FYI I work on the Chrome team so happy to answer any questions on this. We also did some investigation to show how various preloading works in Chromium which might be of interest: https://docs.google.com/document/d/15cJjwapwgWfXAZSeye0znv2OVb1AJGGHlFVhgEXyJc0/edit#heading=h.cah4vvlzu3rb

peterjaap commented 2 weeks ago

Same issue here! Works perfectly fine in Chrome.

WouterSteen commented 2 weeks ago

Same here!

jordyscholing commented 1 week ago

Same..

bluz71 commented 1 week ago

Noting my interest in this as well.

"speculationrules" prerendering does not work in Brave, whilst it does work with Chrome. This is a shame for MPA (multi-page-app) performance.

Hopefully this can be enabled soon if there are no privacy / security concerns; however, that really should not matter for same-origin prerendering.