<commit_before>{#-
https://github.com/oauth-io/oauthd/blob/bdf690138999bf228807045f03a4c91525800ad6/src/presentationLayer/auth/index.coffee#L110-L159
-#}
<!DOCTYPE html>
<html><head><script>(function() {
    "use strict";
    var msg={{ body | tojson | tojson}};
{% if redirect_uri %}
  {% if '#' in redirect_uri %}
    document.location.href = "{{ redirect_uri }}&oauthio=" + encodeURIComponent(msg);
  {% else %}
    document.location.href = "{{ redirect_uri }}#oauthio=" + encodeURIComponent(msg);
  {% endif %}
{% else %}
  {% if user_agent.startswith('IE') %}
    function createCookie(name, value) {
      var date = new Date();
      date.setTime(date.getTime() + 1200 * 1000);
      var expires = "; expires="+date.toGMTString();
      document.cookie = name+"="+value+expires+"; path=/";
    }
    createCookie("oauthio_last",encodeURIComponent(msg));
  {% elif chrome_ext %}
    chrome.runtime.sendMessage("{{ chrome_ext }}", {data:msg});
    window.close();
  {% else %}
    var opener = window.opener || window.parent.window.opener;

    if (opener){
      console.log('Posting message:', msg, "{{ origin }}");
      opener.postMessage(msg, "{{ origin }}");
    }
    window.close();
  {% endif %}
{% endif %}
})();</script></head>
<body style="text-align:center">
  <div style="display:inline-block; padding: 4px; border: 1px solid black">
    Your browser does not support popup. Please open this site with your default browser.
    <br>
    <a href="{{ origin }}">{{ origin }}</a>
  </div>
</body>
</html><commit_msg>Use is_ie in template<commit_after>{#-
https://github.com/oauth-io/oauthd/blob/bdf690138999bf228807045f03a4c91525800ad6/src/presentationLayer/auth/index.coffee#L110-L159
-#}
<!DOCTYPE html>
<html><head><script>(function() {
    "use strict";
    var msg={{ body | tojson | tojson}};
{% if redirect_uri %}
  {% if '#' in redirect_uri %}
    document.location.href = "{{ redirect_uri }}&oauthio=" + encodeURIComponent(msg);
  {% else %}
    document.location.href = "{{ redirect_uri }}#oauthio=" + encodeURIComponent(msg);
  {% endif %}
{% else %}
  {% if is_ie %}
    function createCookie(name, value) {
      var date = new Date();
      date.setTime(date.getTime() + 1200 * 1000);
      var expires = "; expires="+date.toGMTString();
      document.cookie = name+"="+value+expires+"; path=/";
    }
    createCookie("oauthio_last",encodeURIComponent(msg));
  {% elif chrome_ext %}
    chrome.runtime.sendMessage("{{ chrome_ext }}", {data:msg});
    window.close();
  {% else %}
    var opener = window.opener || window.parent.window.opener;

    if (opener){
      opener.postMessage(msg, "{{ origin }}");
    }
    window.close();
  {% endif %}
{% endif %}
})();</script></head>
<body style="text-align:center">
  <div style="display:inline-block; padding: 4px; border: 1px solid black">
    Your browser does not support popup. Please open this site with your default browser.
    <br>
    <a href="{{ origin }}">{{ origin }}</a>
  </div>
</body>
</html>
{'fraction_non_alphanumeric': 0.1919732441471572, 'fraction_numerical': 0.03076923076923077, 'mean_word_length': 3.824193548387097, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 2, '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': '4416131', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1007, 'n_words': 204}