title: open websql database in browser from an existing file
body: <p>I'm developing reactjs app and I'm trying to open webSQL database from an existing file in browser but without success. I would like to use database for testing purposes in browser until my app will be published using cordova. Then I will switch to cordova's SQLite plugin.</p>
  
  <p>My db file is stored inside <code>public</code> folder and the code looks like: </p>
  
  <pre><code>db = window.openDatabase('/db.sqlite', "0.1", "mydb description", 200000);
  </code></pre>
  
  <p>However it seems like browser (Google Chrome) is always opening a new database named <code>/db.sqlite</code> instead of opening an existing database.</p>
  
  <p>Any suggestions?</p>
  
  <p>EDIT 1:</p>
  
  <p>After opening db i added first transactions but it ended with <code>"could not prepare statement (1 no such table: users)"</code>, but users table has many rows inside my db file.</p>
  
  <p>I tried also change <code>/db.sqlite</code> to <code>db.sqlite</code> but nothing works. Is there any way to copy db file to chrome storage before i open db?</p>
  
  <p>EDIT 2:</p>
  
  <p>Opening webSQL db file is just a hack for development mode so any "dirty" solution to achieve opening db from custom file would help a lot.</p>
  
  <p>EDIT 3:</p>
  
  <p>I found a lib called sql.js <a href="https://github.com/kripken/sql.js" rel="nofollow noreferrer">https://github.com/kripken/sql.js</a>. Do you think it is possible to wrap this lib with and functions which will decide whether the app is running in cordova (then exetuces plugin.sqlite) or browser (then execute commands from sql.js lib)?</p>