eustasy/here-miss

View on GitHub
index.html

Summary

Maintainability
Test Coverage
<!DocType html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta http-equiv="cleartype" content="on">
        <meta name="HandheldFriendly" content="True">
        <meta name="MobileOptimized" content="320">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
        <meta name="keywords" content="here miss tiny javascript php dnt tracking plugin eustasy Labs">
        <meta name="description" content="Here, Miss is a set of tiny drop-ins to detect DNT headers and determine whether or not to track the user.">
        <title>Here, Miss &nbsp;&middot;&nbsp; eustasy Labs</title>
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/combine/gh/eustasy/Colors.css@1/colors.min.css,gh/necolas/normalize.css@8.0.0/normalize.min.css">
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400|Lusitana|Source+Code+Pro" data-noprefix>
        <link rel="stylesheet" href="/assets/css/grid.min.css">
        <link rel="stylesheet" href="/assets/css/labs.css">
        <script>
            (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
            m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
            })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
            ga('create', 'UA-45667989-11', 'eustasy.org');
            ga('send', 'pageview');
        </script>
        <script src="here-miss.min.js"></script>
    </head>
    <body>
        <a href="https://github.com/eustasy/here-miss" class="github-corner" aria-label="View source on Github">
            <svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true">
                <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
                <path class="octo-arm" fill="currentColor" style="transform-origin: 130px 106px;" d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"></path>
                <path class="octo-body" fill="currentColor" d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"></path>
            </svg>
        </a>
        <section class="whole grid">
            <h1>Here, Miss</h1>
            <p class="sub-title">by <a href="https://labs.eustasy.org/">eustasy Labs</a></p>
            <div class="whole smablet-quarter"></div>
            <div class="whole smablet-half">
                <p class="text-left">Here, Miss is a set of tiny drop-ins to detect DNT headers and determine whether or not to track the user. It allows you to over-ride manufacturer default settings within Internet Explorer. You might want to take a look at the <a href="here-miss.js">unminified version</a> if you want to understand what it is doing, or just implement it like this:</p>
                <textarea class="code rounded" rows="3">&lt;script src="https://cdn.jsdelivr.net/g/here-miss"&gt;&lt;/script&gt;
&lt;script&gt;
    if ( trackme ) {
        // Tracking Code
    }
&lt;/script&gt;</textarea>
                <p>
                    <a class="button rounded display-inline-block background-white color-belize-hole" href="http://www.jsdelivr.com/?query=here-miss">CDN Delivery</a>
                    <a class="button rounded display-inline-block background-white color-belize-hole" href="https://github.com/eustasy/here-miss">GitHub</a>
                </p>
            </div>
            <div class="whole smablet-quarter"></div>
        </section>

        <hr class="section-breaker">

        <section class="whole grid">

            <h2>Inputs</h2>

            <h3><code class="display-inline-block code light rounded">respectIE = bool(false)</code></h3>
            <p>A boolean value on whether to respect later IE versions that turn on DoNotTrack by default.</p>
            <p>Defaults to <code class="display-inline-block code light rounded">false</code></p>

        </section>

        <hr class="section-breaker">

        <section class="whole grid">

            <h2>Outputs</h2>

            <h3><code class="display-inline-block code light rounded">trackme = bool(true)</code></h3>
            <p>A boolean value that states whether the user allows tracking.</p>

            <h3><code class="display-inline-block code light rounded">dnt = bool(false)</code></h3>
            <p>A boolean value that states whether the DoNotTrack header was set.</p>

            <h3><code class="display-inline-block code light rounded">isie = bool(true)</code></h3>
            <p>A boolean value to check if this is Internet Explorer.</p>

            <h3><code class="display-inline-block code light rounded">iev = int(11)</code></h3>
            <p>The Internet Explorer version. An integer if Internet Explorer, false if not.</p>

            <table>
                <thead>
                    <tr>
                        <th class="text-left">Browser</th>
                        <th class="code">isie</th>
                        <th class="code">iev</th>
                        <th class="code">dnt</th>
                        <th class="code">trackme</th>
                    <tr>
                </thead>
                <tbody>
                    <tr class="color-belize-hole">
                        <td class="text-left">Yours</td>
                        <td><script>document.write(isie);</script></td>
                        <td><script>document.write(iev);</script></td>
                        <td><script>document.write(dnt);</script></td>
                        <td><script>document.write(trackme);</script></td>
                    </tr>
                    <tr>
                        <td class="text-left">Chrome 57</td>
                        <td>false</td>
                        <td>false</td>
                        <td>false</td>
                        <td>true</td>
                    </tr>
                    <tr>
                        <td class="text-left">Firefox 52</td>
                        <td>false</td>
                        <td>false</td>
                        <td>true</td>
                        <td>false</td>
                    </tr>
                    <tr>
                        <td class="text-left">Internet Explorer 9</td>
                        <td>true</td>
                        <td>9</td>
                        <td>false</td>
                        <td>true</td>
                    </tr>
                    <tr>
                        <td class="text-left">Internet Explorer 11</td>
                        <td>true</td>
                        <td>11</td>
                        <td>true</td>
                        <td>true*</td>
                    </tr>
                </tbody>
            </table>
            <p class="small">* When <code class="display-inline-block code light rounded">respectIE</code> is disabled (the default setting).</p>
        </section>

        <hr class="section-breaker">

        <footer>
            <p>
                <a href="https://github.com/eustasy/here-miss/blob/master/LICENSE.md">MIT License</a> &nbsp;·&nbsp;
                <a href="https://github.com/eustasy/here-miss">GitHub</a> &nbsp;·&nbsp;
                <a href="https://github.com/eustasy/here-miss/releases">Releases</a>
            </p>
        </footer>

        <script src="https://cdn.jsdelivr.net/gh/jquery/jquery@3/dist/jquery.min.js"></script>

        <script src="https://cdn.jsdelivr.net/gh/jackmoore/autosize@4/dist/autosize.min.js"></script>
        <script>$(function(){autosize($('textarea'));});</script>

        <script>$('textarea').one('click',function(){$(this).select();});</script>
        <script>$('textarea').dblclick(function(){$(this).select();});</script>

        <script src="https://cdn.jsdelivr.net/gh/eustasy/jQuery.downBoy@1/jquery.downboy.auto.min.js"></script>

    </body>
</html>