title: change save dialog's default path in Electron, javascript
body: <p>With the source code of "<a href="https://jsfiddle.net/soulwire/4ooupev9/" rel="nofollow noreferrer">https://jsfiddle.net/soulwire/4ooupev9/</a>"</p>
  
  <pre><code>function encode( s ) {
      var out = [];
      for ( var i = 0; i &lt; s.length; i++ ) {
          out[i] = s.charCodeAt(i);
      }
      return new Uint8Array( out );
  }
  
  var button = document.getElementById( 'button' );
  button.addEventListener( 'click', function() {
  
      var data = encode( JSON.stringify({
          name: 'Example object',
          child: {
              name: 'Nested thing'
          }
      }, null, 4) );
  
      var blob = new Blob( [ data ], {
          type: 'application/octet-stream'
      });
  
      url = URL.createObjectURL( blob );
      var link = document.createElement( 'a' );
      link.setAttribute( 'href', url );
      link.setAttribute( 'download', 'example.json' );
  
      var event = document.createEvent( 'MouseEvents' );
      event.initMouseEvent( 'click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
      link.dispatchEvent( event );
  });
  </code></pre>
  
  <p>I was able to implement the json-save code.</p>
  
  <p>But <strong>the problem is I need to change the default download path to my project folder.</strong></p>
  
  <p>Is it possible to do so?</p>
  
  <p>I'm going to use this in Electron App.</p>
  
  <p>Thank you so much for your help.</p>