Closed Bug 1595697 Opened 5 years ago Closed 5 years ago

Implement Emulation.setUserAgentOverride

Categories

(Remote Protocol :: CDP, task, P1)

task

Tracking

(firefox72 fixed)

RESOLVED FIXED
Firefox 72
Tracking Status
firefox72 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 2 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.

Blocks: 1595706
Blocks: 1595710

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]
No longer blocks: 1595710
Blocks: 1596101
Blocks: 1596136
Attachment #9108382 - Attachment description: Bug 1595697 - [remote] Implement basic support for Network.setUserAgentOverride. r=#remote! → Bug 1595697 - [remote] Implement basic support for Emulation.setUserAgentOverride.
Blocks: 1544417
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: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 72
Blocks: 1595710
Component: Network → Emulation
Component: CDP: Emulation → CDP
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: