function rewriteChromeInternalUrl(url) {
  if (!url || !url.startsWith('chrome://')) return url;
  // Chrome adds a trailing slash to `chrome://` URLs, but the spec does not.
  //   https://github.com/GoogleChrome/lighthouse/pull/3941#discussion_r154026009
  if (url.endsWith('/')) url = url.replace(/\/$/, '');
  return url.replace(/^chrome:\/\/chrome\//, 'chrome://');
}
There is fancy URL rewriting logic for the chrome://settings page that we need to work around.
Why? Special handling was added by Chrome team to allow a pushState transition between chrome:// pages.
As a result, the network URL (chrome://chrome/settings/) doesn't match the final document URL (chrome://settings/).
@param {string} url
@return {string}