title: Chrome console: snippet command can't open dialog
body: <p>I have a simple oneline snippet to "click" on a «load file» button on a visible page to call a dialog-popup (to load an image, for example).</p>
  
  <pre><code>this.document.getElementsByName("image")[0].click()  // snippet code 
  </code></pre>
  
  <p>While <strong>manual</strong> paste and run this line in console is successful (it opens the dialog), the above snippet can't do that. Seems like Chrome doesn't allow to open dialog not by user call. So, I set browser to allow all popups but there is no result.</p>
  
  <p>Tested on different pages where file load button presents.</p>
  
  <p>Thanks for any ideas.</p>
  
  <p><a href="https://stackoverflow.com/questions/45331065/javascript-window-open-works-in-chrome-console-but-not-as-a-snippet">A similar but different issue, solved</a></p>