I'm using jQuery 3.3.1
and I received the same error, in my case, the URL was an Object
vs a string.
What happened was, that I took URL = window.location
- which returned an object. Once I've changed it into window.location.href
- it worked w/o the e.indexOf
error.