Closed Bug 1595697 Opened 3 months ago Closed 3 months ago

Implement Emulation.setUserAgentOverride

Categories

(Remote Protocol :: Emulation, task, P1)

Tracking

(firefox72 fixed)

RESOLVED FIXED
Firefox 72
Tracking Status
firefox72 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 3 open bugs, )

Details

(Whiteboard: [puppeteer-alpha])

Attachments

(1 file)

Running the Puppeteer example for fullpage screenshots the device is set via page.emulate() to iPhone6. This causes the following command send to Firefox:

  puppeteer:protocol SEND ► {"sessionId":1,"method":"Network.setUserAgentOverride","params":{"userAgent":"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1"},"id":19} +1ms

What we need here is an override for the user agent so that other browsers, and platforms can be emulated. To get this done the general.useragent.override preference could be used.

This patch implements setting the user agent only. Support for
accepted language, and platform will be done in a follow-up bug.

As it turned out there are two implementations. The one from the Network domain simply redirects to the Emulation domain. Updating the bug and dependencies accordingly.

Blocks: 1596097
No longer blocks: 1549464
Summary: Implement Network.setUserAgentOverride → Implement Emulation.setUserAgentOverride
Whiteboard: [method=Network.setUserAgentOverride][puppeteer-alpha] → [puppeteer-alpha]
Attachment #9108382 - Attachment description: Bug 1595697 - [remote] Implement basic support for Network.setUserAgentOverride. r=#remote! → Bug 1595697 - [remote] Implement basic support for Emulation.setUserAgentOverride.
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/73c00aa07450
[remote] Implement basic support for Emulation.setUserAgentOverride. r=remote-protocol-reviewers,maja_zf
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 72
Component: Network → Emulation
You need to log in before you can comment on or make changes to this bug.