Open Bug 1791225 Opened 2 years ago Updated 1 year ago

Can't exit Reader Mode on local files after clearing history

Categories

(Toolkit :: Reader Mode, defect, P5)

Firefox 105
Desktop
All
defect

Tracking

()

Tracking Status
firefox115 --- affected
firefox116 --- affected

People

(Reporter: rajeev_v_pillai, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:105.0) Gecko/20100101 Firefox/105.0

Steps to reproduce:

  1. Open a local HTML file (running Firefox with --private)
  2. Switch to Reader Mode.
  3. Settings > Privacy & Security > Clear Data & Clear History
  4. Try to exit Reader Mode.

Actual results:

Reader Mode not exited.

Expected results:

Browser should exit Reader Mode.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Component: Widget: Gtk → Tabbed Browser
Product: Core → Firefox

Hello, thank you for the bug report!
Managed to reproduce this issue on:

  • Firefox 114.0.2;
  • Firefox 115.0;
  • Nightly 116.0a1;

Tested and reproduced on:

  • Windows 10;
  • macOS 12;
  • Ubuntu 22;

Setting as NEW so the developers can have a look.

Status: UNCONFIRMED → NEW
Ever confirmed: true

The severity field is not set for this bug.
:dao, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(dao+bmo)
Component: Tabbed Browser → Reader Mode
Flags: needinfo?(dao+bmo)
Product: Firefox → Toolkit

Loading a new page using the address bar still works, and clearing history as well as loading local files in reader mode are both niche usecases, so I can't see fixing this being high priority.

The fundamental reason here is that we end up here but don't have a history entry (because everything got cleared) and we end up in https://searchfox.org/mozilla-central/rev/ea550f0d1afaf7747ebd988325ea10cf4e3e4de4/toolkit/components/reader/ReaderMode.sys.mjs#89 which tries to use the content principal (which is the about:reader?url=... one) to load the original URL (which is file:...) which then fails for security reasons.

A fix would probably involve extracting the original file URI and using that as the triggering principal here. We don't necessarily want to do that for other URI types because it would impact whether we e.g. send same-site cookies, which we probably don't want to mess with.

Severity: -- → S4
OS: Unspecified → All
Priority: -- → P5
Hardware: Unspecified → Desktop
You need to log in before you can comment on or make changes to this bug.