- // location.hash is not encoded in firefox
- const encodedhash = (window.location.href.split('#'))[1] || '';
- return decodeURIComponent(encodedhash).split('#');
+ const encodedhash = window.location.href.split('#').slice(1) || '';
+ if (encodedhash.length == 1) {
+ // location.hash is not encoded in firefox
+ return decodeURIComponent(encodedhash).split('#');
+ }
+ return encodedhash;