<commit_before>selectionchange-polyfill
========================

A polyfill that fires selectionchange events for Firefox.

Why
---

Firefox has a `select` event for when the selection changes within
an input or textarea element, but doesn't yet support `selectionchange`
like the other major browsers. This polyfill fires it very close to how
Google Chrome does.

How to Use
----------

Call `selectionchange.start()` to enable the polyfill and `selectionchange.stop()`
to disable it. Both functions take an optional `DOMDocument` argument, defaulting
to `window.document`.

Handlers for the `selectionchange` event should be registered on the
document element. The event is not cancellable carries no information
about the previous or current selection.

```HTML
<script src="selectionchange.js"></script>
<script>
selectionchange.start();

document.addEventListener('selectionchange', function (event) {
  var sel = this.getSelection();
  console.log('Selected text:', sel.rangeCount ? sel.getRangeAt(0).toString() : null);
});
</script><commit_msg>fixing typo<commit_after>selectionchange-polyfill
========================

A polyfill that fires selectionchange events for Firefox.

Why
---

Firefox has a `select` event for when the selection changes within an `input`
or `textarea` element, but doesn't yet support the general `selectionchange`
event like the other major browsers. This polyfill fires it very close to how
Google Chrome does.

How to Use
----------

Call `selectionchange.start()` to enable the polyfill and `selectionchange.stop()`
to disable it. Both functions take an optional `DOMDocument` argument, defaulting
to `window.document`.

Handlers for the `selectionchange` event should be registered on the document.
The event is not cancellable and carries no information about the previous or
current selection.

```HTML
<script src="selectionchange.js"></script>
<script>
selectionchange.start();

document.addEventListener('selectionchange', function (event) {
  var sel = this.getSelection();
  console.log('Selected text:', sel.rangeCount ? sel.getRangeAt(0).toString() : null);
});
</script>
{'fraction_non_alphanumeric': 0.12064090480678605, 'fraction_numerical': 0.000942507068803016, 'mean_word_length': 5.262536873156342, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2663558', 'n_tokens_mistral': 546, 'n_tokens_neox': 530, 'n_words': 231}