title: Treat insecure origin as secure
body: <p>The domain <strong>localhost</strong> is treated as a <a href="https://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features" rel="nofollow noreferrer">secure origin by default</a>, which is very handy when testing webapps locally.</p>
  
  <p>It let's you use features like <strong>getUserMedia</strong> without having to use the https protocol.</p>
  
  <p>Because crostini uses the domain <strong>linuxhost</strong> instead of <strong>localhost</strong>, it isn't treated as a secure origin.</p>
  
  <p>There is a chrome flag, <strong>chrome://flags/#unsafely-treat-insecure-origin-as-secure</strong>, that lets you set new domains to be treated as secure, but I've tried all of the following, and everytime, when I restart chrome, the input is empty again.</p>
  
  <ul>
  <li>linuxhost</li>
  <li><a href="http://linuxhost" rel="nofollow noreferrer">http://linuxhost</a></li>
  <li><a href="http://linuxhost:3000" rel="nofollow noreferrer">http://linuxhost:3000</a></li>
  <li><a href="http://linuxhost:3000/" rel="nofollow noreferrer">http://linuxhost:3000/</a></li>
  </ul>
  
  <p>plus all the other combinations of <em>http://</em>, <em>linuxhost</em>, <em>:3000</em>, and <em>/</em>.</p>
  
  <p>There are some threads about <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=849134" rel="nofollow noreferrer">treating linux.test as secure</a> and <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=825010" rel="nofollow noreferrer">changing linuxhost to linux.test</a> but those are pretty recent and don't work yet.</p>
  
  <p>Has anyone managed to get that flag to work on chrome os.</p>
  
  <p>I've seen <a href="https://stackoverflow.com/questions/40032182/chrome-doesnt-treat-insecure-origin-as-secure-despite-flag">other answers</a> that show how to set this flag, but only via the command line, not through the chrome UI.</p>
  
  <p>I'm on the dev channel with crostini working, on version 69.0.3473.0</p>