title: How to support Zoom like Safari with WKWebView on macOS
body: <p>In Safari the user can enlarge the content by using the Zoom commands, like Command +. This enlarges not only the content, including font size, but it also adjusts the content to remain between the window margins. </p>
  
  <p>I want to achieve the same feature with WKWebView on macOS, but I don't know how to do that when using the <code>loadRequest()</code> command on the web view control.</p>
  
  <p>I have tried the following, without much success:</p>
  
  <ul>
  <li>Inject javascript like <code>"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust='150%'"</code>. It seems that <code>webkitTextSizeAdjust</code> is not supported anymore on the macOS version of WKWebView, see <a href="https://trac.webkit.org/changeset/145168/webkit" rel="nofollow noreferrer">https://trac.webkit.org/changeset/145168/webkit</a>.</li>
  <li>Use the <code>magnification</code> property. This works, but this simply enlarges (or minimises) everything, without adjusting the content to remain between the control width (viewport), like Safari does.</li>
  </ul>
  
  <p>Please take note that I'm using <code>loadRequest()</code>, not <code>loadHTMLString()</code>.</p>