title: Disable Chrome "Restore pages? Chrome didn't shut down correctly" and other browser messages
body: <p>This is the popup I'm referring to:</p>
  <p><a href="https://i.stack.imgur.com/TgB06.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TgB06.jpg" alt="enter image description here" /></a></p>
  <p>Is there a way to prevent chrome from showing these popups? I've tried using <code>--user-data-dir</code>.</p>
  <p>Here are all the flags that I use:</p>
  <pre><code>const chromeSwitches = [
        `--user-data-dir=${tasksDataDirPath+'\\'+taskName}`,
        `--remote-debugging-port=${availablePort}`,
        &quot;--arc-disable-locale-sync&quot;,
        &quot;--disable-features=IsolateOrigins,site-per-process&quot;,
        &quot;--disable-component-extensions-with-background-pages&quot;,
        &quot;--disable-background-timer-throttling&quot;,
        &quot;--disable-backgrounding-occluded-windows&quot;,
        &quot;--disable-renderer-backgrounding&quot;,
        &quot;--no-first-run&quot;,
        &quot;--password-store=basic&quot;,
        &quot;--use-mock-keychain&quot;,
        &quot;--disable-extensions&quot;,
        &quot;--disable-default-apps&quot;,
        &quot;--disable-features=Translate&quot;,
        &quot;--disable-background-networking&quot;,
        &quot;--disable-sync&quot;,
        &quot;--metrics-recording-only&quot;,
        &quot;--mute-audio&quot;,
        &quot;--no-default-browser-check&quot;,
        &quot;--enable-remote-debugging&quot;
      ];
  </code></pre>