Make it possible to set browsertime.chrome.mobileEmulation.* options
Currently it's not possible to overwrite the hardcoded deviceName='iPhone 6' (reason is that in analyzeUrl() in plugins/browsertime/analyzer.js chromeIphoneEmulationOptions containing the defaults comes after btOptions.chrome).
Additionally, it's also not possible to unset the default deviceName, and use other possibly conflicting mobileEmulation options like userAgent (if deviceName and userAgent are both set, then the error 'deviceName' must be used alone appears).
If this was possible, then the current limitation of setting --mobile overriding --browsertime.userAgent could be workarounded.
Hi @eserte thanks for reporting! Any change you can do a PR? I was planning on pushing a new release of sitespeed.io tomorrow (with updated browsers) and we can probably just fix this first then.
Best Peter
@eserte I've pushed a fix so we at least can change device name.
Workaround for the other is at the moment to not set --mobile, instead use viewport and user agent.
Best Peter
@eserte if you try latest 7.4.0 then at least you should be able to choose name.
Workaround for the other is at the moment to not set --mobile, instead use viewport and user agent.
If I do so, then the sitespeed result pages show the "... runs with desktop profile ..." text instead of "mobile profile" --- which is at least confusing. It's also not clear if --mobile enables some other mobile emulation features in the browser.
Yeah I see your point. I think the only way to get it right at the moment is to use Firefox.
Hello @soulgalore, good morning!
We are experiencing the above issue for our current project: we want to use Chrome emulated devices, but we also want to specify a UserAgent, in order to add a string given to us by our security team.
Having taken a look at the commit made in by @eserte to a private fork, referencing this issue - it appears that this change would allow us to optionally specify the User Agent.
If I am understanding this correctly, would you accept this as a PR?
Hi @barryperez in https://github.com/sitespeedio/browsertime/pull/1688 I'm adding so you can append what you want to the user agent, let me do a follow up in browsertime and also fix so that if you set the --userAgent its automatically set for mobile emulation, then I can fix it in sitespeed.io. Hope to fix it the coming weekend.
I released 21.3.0 earlier today that fixes so that --userAgent also will be used for emulated devices.
Tested successfully - thank you very much for fixing this @soulgalore!