<commit_before>Service Workers Algorithms
===
> **NOTE:**
>
> - **Register** and **_Update** honor HTTP caching rule.
> - Underscored function and attribute are UA-internal properties.

--
**Register**(_script_, _scope_)

1. Let _promise_ be a newly-created Promise.
1. Return _promise_.
1. Run the following steps asynchronously.
  1. Let _scope_ be _scope_ resolved against the document url.
  1. Let _script_ be _script_ resolved against the document url.
  1. If the origin of _script_ does not match the document's origin, then
    1. Reject _promise_ with a new SecurityError.<commit_msg>Prevent http installs<commit_after>Service Workers Algorithms
===
> **NOTE:**
>
> - **Register** and **_Update** honor HTTP caching rule.
> - Underscored function and attribute are UA-internal properties.

--
**Register**(_script_, _scope_)

1. Let _promise_ be a newly-created Promise.
1. Return _promise_.
1. Run the following steps asynchronously.
  1. Let _scope_ be _scope_ resolved against the document url.
  1. Let _script_ be _script_ resolved against the document url.
  1. If the protocol of the document's url is not https, then
    1. SHOULD reject _promise_ with a new SecurityError. Browsers may provide an option to ignore this rule, for development purposes only.
  1. If the origin of _script_ does not match the document's origin, then
    1. Reject _promise_ with a new SecurityError.
{'fraction_non_alphanumeric': 0.08082975679542204, 'fraction_numerical': 0.011444921316165951, 'mean_word_length': 4.032374100719425, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7466353', 'n_tokens_mistral': 412, 'n_tokens_neox': 398, 'n_words': 186}