return this;
};
+function hashparams() {
+ 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;
+}
+
class Words {
constructor(data, root = undefined) {
this.data = data;
return selection;
}
- configure(params = window.location.hash.split('#')) {
+ configure(params = hashparams()) {
const opts = new Map(params.map(arg => arg.split(/[:=](.*)/)));
for (let [query, val] of opts) {
if (query.match(/^\d+$/)) {