Closed Bug 1778320 Opened 3 years ago Closed 3 years ago

Failed to load simplified page in Print Preview

Categories

(Toolkit :: Reader Mode, defect, P3)

Firefox 103
defect

Tracking

()

VERIFIED FIXED
108 Branch
Tracking Status
firefox103 --- wontfix
firefox108 --- verified

People

(Reporter: rpopovici, Assigned: fchasen)

Details

Attachments

(2 files, 1 obsolete file)

Attached image Capture.PNG

Found in

  • Fx 103.0b5

Affected versions

  • Fx 103.0b5

Affected platforms

  • Windows 7
  • Windows 10
  • Ubuntu 16

Steps to reproduce

  1. Open Firefox
  2. Navigate to https://en.wikipedia.org/wiki/Main_Page
  3. Click on Reader view icon
  4. Press CTRL+P
  5. Select "Simplified" option from the Format section

Expected result

  • Website content on Reader view with simplified format is displayed correctly in Print Preview

Actual result

  • "Failed to load article from page" error message is displayed in Print Preview. See attachment.

Regression range

  • no regression
Has STR: --- → yes
Summary: Failed to load simplified page → Failed to load simplified page in Print Preview
Severity: -- → S3

Was able to reproduce.

Flags: needinfo?(jwatt)

Frank and I spent some time looking at this. He can reproduce, but I can't, and it was unclear why.

One observation we made is that when entering print preview from Reader Mode you're essentially printing a simplified page. Nonetheless, for Frank the Format radio buttons were enabled (visible) and, perhaps counterintuitively, the "Original" radio button is selected. For me, the Format radio buttons don't show at all.

To me, it seems like the radio buttons should not be shown since the print code doesn't have access to the original (non-Reader mode/simplified document) and so can't actually switch between Simplified/Original.

Anyway, the code in play here is really frontend code, so moving this to Toolkit. Mark, would you be able to take a look?

Component: Print Preview → Printing
Flags: needinfo?(jwatt) → needinfo?(mstriemer)
Product: Core → Toolkit

Looking at the code path we show the option if isArticle is true. We could do some other check to detect if it's in reader mode but since reader mode fails on that document it seems like a check that should probably happen in Readerable

Component: Printing → Reader Mode
Flags: needinfo?(mstriemer)
Assignee: nobody → fchasen
Status: NEW → ASSIGNED

(In reply to Mark Striemer [:mstriemer] from comment #3)

Looking at the code path we show the option if isArticle is true. We could do some other check to detect if it's in reader mode but since reader mode fails on that document it seems like a check that should probably happen in Readerable

Reader mode will fail because all the classes and IDs that are on the original document and that inform which things we think are "important" or "not important" are stripped out by reader mode, and we simplify the DOM structure so it's less likely that there's a single common ancestor that encapsulates all the content we want.

Not offering the option for pages printed from reader mode seems like a fine idea.

Priority: -- → P3

Reader pages seem to have isArticle=true when pressing the reader button on the original page, but isArticle=false when navigating to them directly.

I added a check for about:reader urls in the hide / show of the simplification option instead of just relying on isArticle.

Checks if the url for the page to be printed starts with about:reader and if so prevents showing the option for printing the simplified version (which would result in an article load failure).

Attachment #9297508 - Attachment is obsolete: true

In reader mode isArticle should always be false, as the content can not be further simplified.

This sets isArticle to false on load for reader pages and prevents calling
_isLeavingReaderableReaderMode on page hides other than when leaving reader mode.

Attachment #9297508 - Attachment is obsolete: false
Attachment #9298467 - Attachment description: Bug 1778320 - Force isArticle to be false for reader mode pages r?mstriemer → Bug 1778320 - Prevent setting isArticle on all pagehide events r?gijs
Pushed by mstriemer@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4f5a3df9b965 Hide option to simplify reader mode pages in print preview r=mstriemer https://hg.mozilla.org/integration/autoland/rev/bb3924dcc5bf Prevent setting isArticle on all pagehide events r=mstriemer,Gijs
Attachment #9298467 - Attachment is obsolete: true
Pushed by mstriemer@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3fff554b54a4 Hide option to simplify reader mode pages in print preview r=mstriemer

Removed the changes for isArticle and re-landed the change to check for reader mode when printing.

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Flags: needinfo?(fchasen)
Resolution: --- → FIXED

(In reply to Fred Chasen [:fchasen] from comment #11)

Removed the changes for isArticle and re-landed the change to check for reader mode when printing.

FWIW the bug will be closed as fixed automatically when your patch makes it to mozilla-central (and this will also set the target milestone + individual release tracking flags correctly, which helps track uplifts etc.). So going to reopen this for now. :-)

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 3 years ago3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch

Verified that now option to simplify reader mode pages in print preview is no longer displayed using Firefox 108.0b3 and latest Nightly 109.0a1 across platforms (Windows 10, Windows 7, macOS 11.6 and Ubuntu 20)

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: