function disableScrollbars() {
  // In the past, we had applied fixed offsets to the width on Safari to account
  // for scrollbars and correct the scaling factor, but this was a hack and
  // inconsistent.  The best thing to do is completely disable scrollbars
  // through CSS.  This ensures that neither the inner iframe nor the top-level
  // window have scrollbars, which makes screenshots on Safari consistent across
  // versions.

  // Disable scrolling on the inner document, the execution context.
  const innerStyle = document.createElement('style');
  innerStyle.innerText = '::-webkit-scrollbar { display: none; }\n';
  innerStyle.innerText += 'body { overflow: hidden }\n';
  document.head.appendChild(innerStyle);

  try {
    // Disable scrolling on the outer document, the host context.
    const outerStyle = document.createElement('style');
    outerStyle.innerText = innerStyle.innerText;
    top.document.head.appendChild(outerStyle);

    // eslint-disable-next-line no-restricted-syntax
  } catch (error) {
    // On some platforms (Tizen), we are prevented from accessing the host
    // context, even though it should be in the same origin.  Ignore errors
    // here, so that the rest of the critical boot sequence can complete.
  }
}
Scrollbars ruin our screenshots, in particular on Safari.  Disable all
scrollbars in CSS to ensure consistent screenshots.