The actual problem is that your approach for the split is incorrect.
With your example window.location.hash return #!/https://example.com/. What you#re doing is splitting that element by / and using the second element of the result.
The result of the split would be 4 elements ([ "#!", "https:", "", "example.com" ]) and the second element would be just he https:. What you need to do, do fix it is either find an another delimiter or find another way to extract the URL.
With your current example you could !/ for the split to get two elements back ([ "#", "https://example.com" ]) where the second one would be the whole URL, as long as it doesn't contain the string !/. Another appraoch would be to find the first occurrence of http from the left and take a substring from what position until the end of it.
Other answers show some different solution.
#!/like sowindow.location.hash.replace('#!/','')