Closed Bug 1571088 Opened 5 years ago Closed 5 years ago

Add LOAD_FLAGS_REPLACE_HISTORY to GeckoSession LoadFlags

Categories

(GeckoView :: General, enhancement)

Unspecified
All
enhancement
Not set
normal

Tracking

(firefox69 wontfix, firefox70 fixed)

RESOLVED FIXED
mozilla70
Tracking Status
firefox69 --- wontfix
firefox70 --- fixed

People

(Reporter: rbarker, Assigned: rbarker)

References

Details

Attachments

(1 file)

In Fennec, LOAD_FLAGS_BYPASS_CACHE and LOAD_FLAGS_REPLACE_HISTORY are used when switching to and from desktop mode as seen in the code snippet:

    // We need LOAD_FLAGS_BYPASS_CACHE here since we're changing the User-Agent
    // string, and servers typically don't use the Vary: User-Agent header, so
    // not doing this means that we'd get some of the previously cached content.
    let loadFlags =
      Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE |
      Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY;

From https://searchfox.org/mozilla-central/rev/b38e3beb658b80e1ed03e0fdf64d225bd4a40327/mobile/android/chrome/content/browser.js#4609

In order for applications embedding GeckoView to provide this same functionality, the two flags need to be added to GeckoSession LoadFlags.

LOAD_FLAGS_BYPASS_CACHE is also required for force-refreshing a page (long press the refresh button in Fennec).

Summary: Add LOAD_FLAGS_BYPASS_CACHE and LOAD_FLAGS_REPLACE_HISTORY to GeckoSession LoadFlags → Add LOAD_FLAGS_REPLACE_HISTORY to GeckoSession LoadFlags

Found that LOAD_FLAGS_BYPASS_CACHE was already supported by GV. Changed the title to reflect that.

Might it be also worth adding a convenience overload of GeckoSession.reload() that also accepts some load flags?

Bug 1571088 - Add LOAD_FLAGS_REPLACE_HISTORY to GeckoSession LoadFlags

Assignee: nobody → rbarker
Pushed by rbarker@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0c2607dd7f5b
Add LOAD_FLAGS_REPLACE_HISTORY to GeckoSession LoadFlags r=geckoview-reviewers,snorp,droeh
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70

Fenix will need this flag to make desktop UA work in https://github.com/mozilla-mobile/fenix/issues/3903. The Fenix bug is a P3 so we don't need to bother uplifting this fix to GV 69 Beta. It can ride in GV 70.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: