function onGenerateReportButtonClick(backend, url, settings) {
  let apiUrl;
  if (backend === 'psi') {
    apiUrl = new URL('https://pagespeed.web.dev/analysis');
    apiUrl.searchParams.append('url', url);
    apiUrl.searchParams.append('form_factor', settings.device);
    for (const category of settings.selectedCategories) {
      apiUrl.searchParams.append('category', category);
    }
    apiUrl.searchParams.append('hl', settings.locale);
  } else {
    apiUrl = new URL('https://googlechrome.github.io/lighthouse/viewer/');
    apiUrl.searchParams.append('psiurl', url);
    apiUrl.searchParams.append('strategy', settings.device);
    for (const category of settings.selectedCategories) {
      apiUrl.searchParams.append('category', category);
    }
    apiUrl.searchParams.append('locale', settings.locale);
  }
  apiUrl.searchParams.append('utm_source', 'lh-chrome-ext');
  window.open(apiUrl.href);
}
Click event handler for Generate Report button.
@param {string} backend
@param {string} url
@param {SettingsController.Settings} settings