<commit_before>#MetaphorJs stateless pushState wrapper/polyfill

3kb minified

without MetaphorJs:

`history.initPushState()`

`history.onchange(function(location){})`

`history.pushState(state, title, url)` -- state and title are ignored

`history.replaceState(state, title, url)` -- state and title are ignored


with MetaphorJs:

`history.initPushState()`

`MetaphorJs.on("locationchange", function(location){})`

`MetaphorJs.pushUrl(url)`

`MetaphorJs.replaceUrl(url)`

`MetaphorJs.currentUrl()`

==============

IE6+, Chrome, Firefox, Safari, Opera

If browser does not support pushState, #! will be used.

All links with valid url in href will be subject to pushState handler.

If you want to bypass handler, add target="_self" attribute (or any other target value).<commit_msg>beforeLocationChange<commit_after>#MetaphorJs stateless pushState wrapper/polyfill

3kb minified

without MetaphorJs:

`history.initPushState()`

`history.onChange(function(location){})`

`history.onBeforeChange(function(location){})`

`history.pushState(state, title, url)` -- state and title are ignored

`history.replaceState(state, title, url)` -- state and title are ignored


with MetaphorJs:

`history.initPushState()`

`MetaphorJs.on("beforeLocationChange", function(location){})`

`MetaphorJs.on("locationChange", function(location){})`

`MetaphorJs.pushUrl(url)`

`MetaphorJs.replaceUrl(url)`

`MetaphorJs.currentUrl()`

==============

IE6+, Chrome, Firefox, Safari, Opera

If browser does not support pushState, #! will be used.

All links with valid url in href will be subject to pushState handler.

If you want to bypass handler, add target="_self" attribute (or any other target value).
{'fraction_non_alphanumeric': 0.13345195729537365, 'fraction_numerical': 0.002372479240806643, 'mean_word_length': 6.2094017094017095, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2291574', 'n_tokens_mistral': 529, 'n_tokens_neox': 527, 'n_words': 152}