Add regex support for window.location.hash handlers

This commit is contained in:
Niko 2022-02-17 02:23:31 +01:00
parent a0b7b85e8f
commit 6c39b41722
1 changed files with 3 additions and 0 deletions

View File

@ -152,6 +152,9 @@ window.onhashchange = function(e) {
if (cfg.exact !== undefined &&
cfg.exact === path)
return cfg.callback(args);
if (cfg.regex !== undefined &&
path.match(cfg.regex))
return cfg.callback(args);
}
}