Closed Bug 1842215 Opened 2 years ago Closed 2 years ago

Handle top-level pushState navigation

Categories

(Firefox Graveyard :: Shopping, defect, P2)

Desktop
All

Tracking

(firefox117 fixed)

RESOLVED FIXED
117 Branch
Tracking Status
firefox117 --- fixed

People

(Reporter: jhirsch, Assigned: Gijs)

References

Details

(Whiteboard: [fidefe-shopping])

Attachments

(1 file)

It turns out some shopping websites, like walmart.com, actually use pushState to navigate within same-site links. The onLocationChange listener we're using in browser/base/content/browser.js filters out these navigations, so we aren't accurately detecting whether the user has navigated to/from product pages once they arrive on the site (unless they hard refresh the page).

We'll need to change how we detect navigation to ensure the product page check always fires on pushState-supported sites.

Blocks: shopping2023
Severity: -- → S3
Priority: -- → P2
Whiteboard: [fidefe-shopping]

This will be due to the LOCATION_CHANGE_SAME_DOCUMENT flag, fwiw. Just picking up onLocationChange without checking for that flag would work.

This will be due to the LOCATION_CHANGE_SAME_DOCUMENT flag, fwiw. Just picking up onLocationChange without checking for that flag would work.

Thanks, at Mossop's suggestion we're detecting navigations using TabsProgressListener.onLocationChange.

Is there a different spot we can insert into (not sure I see one), should I tack an update call into the spot where ReaderMode gets same-page navigation updates (https://searchfox.org/mozilla-central/source/browser/base/content/browser.js#5972), or should I create a webProgressListener just for the sidebar?

Flags: needinfo?(gijskruitbosch+bugs)

(In reply to Jared Hirsch [:jhirsch] (he/him) (Needinfo please) from comment #2)

This will be due to the LOCATION_CHANGE_SAME_DOCUMENT flag, fwiw. Just picking up onLocationChange without checking for that flag would work.

Thanks, at Mossop's suggestion we're detecting navigations using TabsProgressListener.onLocationChange.

Is there a different spot we can insert into (not sure I see one), should I tack an update call into the spot where ReaderMode gets same-page navigation updates (https://searchfox.org/mozilla-central/source/browser/base/content/browser.js#5972), or should I create a webProgressListener just for the sidebar?

I think moving the call from this location to the reader mode block should work. Does that help or am I misunderstanding the question?

Flags: needinfo?(gijskruitbosch+bugs) → needinfo?(jhirsch)

Yup, that helps, thanks

Flags: needinfo?(jhirsch)
Assignee: nobody → jhirsch

Stealing per discussion with Jared.

Assignee: jhirsch → gijskruitbosch+bugs
OS: Unspecified → All
Hardware: Unspecified → Desktop
Version: unspecified → Trunk
Pushed by gijskruitbosch@gmail.com: https://hg.mozilla.org/integration/autoland/rev/df651cb43d5e handle pushState navigations between shopping pages, r=shopping-reviewers,jhirsch
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: