catchpoint / WebPageTest

Official repository for WebPageTest
Other
3.06k stars 713 forks source link

Microsoft Edge API requests at Startup #2396

Open paulcalvano opened 1 year ago

paulcalvano commented 1 year ago

Hello! I noticed that when running a WPT measurement with the Microsoft Edge browser, there is a large API request to https://www.bing.com/api/shopping/v1/getsupporteddomains. This appears regardless of which site I test, as it is an API request that Edge triggers at startup to support its coupon feature. The API request occurs at browser startup, and every 24 hours.

You can see an example in request 27 of this measurement - https://www.webpagetest.org/result/220930_AiDc32_9HN/1/details

image

Since the browser is started for the test, this API request will appear in the waterfall for most measurements even though it's not actually part of the page. This may result in misleading or confusing performance results when testing from the Edge browser.

This feature can be disabled with an Edge command line switch, although adding it to the Chromium command line options in Advanced->Chromium does not appear to work.

msedge.exe --disable-features=kAutofillEdgeCoupons

It might be worth having WPT agents configured to use this command switch automatically.

sammeboy635 commented 1 year ago

Hello @paulcalvano, Thanks for bringing this issue up, but I could not find anything on "kAutofillEdgeCoupons" researching it. I did try the command with edge v106, and the API request persists. Do you have any documents on it, or know where I can find some documentation?

paulcalvano commented 1 year ago

Hi @sammeboy635 . Apologies for not responding sooner. I don't believe the feature flag is documented publicly. I learned about it from someone on the MS Edge team. Did you test via the advanced options via WPT, or via the command line locally?

pmeenan commented 1 year ago

Trying AutofillEdgeCoupons didn't work to disable it either (Chromium convention usually prefixes the feature name with a k for the variable but the string for the feature name omits it).

pmeenan commented 1 year ago

FWIW, WPT also supports prefs and policy settings but neither looks like it works to disable the bing shopping api call.

pmeenan commented 1 year ago

I tried turning off a bunch of things in the settings UI and grabbing the prefs from my profile but the network requests still go out. It's possible that the feature flag turns off using the data but doesn't stop the network request from happening.

Unfortunately, without access to the code it's hard to know for sure what will turn it off and blanket-blocking bing.com would break test use cases.

Here are the prefs I tried:

{
  "alternate_error_pages":{
    "enabled":false
  },
  "autofill": {
    "enabled": false
  },
  "edge_rewards":{
    "enabled": false
  },
  "edge_shopping_assistant_enabled":false,
  "edge_underside_triggering_enabled":false,
  "enhanced_tracking_prevention":{
    "enabled":false
  },
  "resolve_navigation_errors_use_web_service":{
    "enabled":false
  },
  "user_experience_metrics":{
    "personalization_data_consent_enabled_last_known_value":false
  }
}