When my app runs at http://example.com and I run this code
var store = new Store('mydb', {
remote: '/store/api/mydb'
})
store.sync()
Then store.sync() does not send AJAX requests to http://example.com/store/api/mydb, instead it syncs with another database in browser with the name '/store/api/mydb', which is rather confusing.
What we want is to check if the remote or remoteBaseUrl option starts with a /, and if it does, prefix it with location.origin