<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tom McLean on Medium]]></title>
        <description><![CDATA[Stories by Tom McLean on Medium]]></description>
        <link>https://medium.com/@tommclean?source=rss-aec479b630a4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*4L72j5hmHY3kyqXIoFE6FA.png</url>
            <title>Stories by Tom McLean on Medium</title>
            <link>https://medium.com/@tommclean?source=rss-aec479b630a4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 02:18:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tommclean/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Panic Button: a short intro to a quick exit]]></title>
            <link>https://medium.com/today-news/panic-button-a-short-intro-to-a-quick-exit-847bdf50aea0?source=rss-aec479b630a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/847bdf50aea0</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[safe-browsing]]></category>
            <dc:creator><![CDATA[Tom McLean]]></dc:creator>
            <pubDate>Fri, 08 Jul 2016 05:29:42 GMT</pubDate>
            <atom:updated>2016-07-08T06:32:27.096Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bj3htsLntKoH-orjXG1ZNw.jpeg" /></figure><p>I’m a developer at <a href="http://www.studiothick.com/">Thick</a> and for the last few months we’ve been working with <a href="http://www.wire.org.au/">WIRE</a> on a project called <a href="http://www.womentalkmoney.org.au/">Women Talk Money</a>. It’s a website aimed at increasing financial literacy among women, and part of the material deals with advice on how to identify and respond to financial abuse.</p><p>Because of the sensitive nature of that content, the site designs included a “panic button” at the top of the page that would redirect the user to an innocuous site and hide what they were looking at.</p><p>We immediately started talking about how best to implement this. There was the obvious and easy solution of just making it a plain link, but what would happen in the case of a slow or disabled internet connection? For example, if an abusive partner had disconnected the power to the wifi? Any implementation would need to be able to respond to the worst-case scenario.</p><p>The solution to that particular problem was to erase the entire DOM as soon as the panic button is hit, and <em>then</em> redirect. The redirect will still fail in the case of the disconnected internet, but at least the user will be left with a blank page instead of anything incriminating.</p><p>As we talked more about the panic button functionality, we figured it would probably be worth developing it as a separate module and releasing it as open-source. The less friction involved in putting quick-exit behaviour on a sensitive site, the better, right?</p><p>So we set about doing exactly that and, a few solved problems later, here we are: <a href="http://github.com/studiothick/panic-button">panic-button</a> is available for use today. If you’re creating a site that has vulnerable people as any proportion of its target audience, consider incorporating a quick exit — all it takes is pasting this code at the top of the page.</p><pre>&lt;!-- begin panic button --&gt;<br>&lt;div id=&quot;panic-container&quot; class=&quot;panic-button&quot;&gt;<br>    &lt;span class=&quot;panic-button__text&quot;&gt;Protect yourself online.&lt;/span&gt;<br>    &lt;a class=&quot;panic-button__link&quot;<br>        href=&quot;https://www.domesticshelters.org/safe-surfing&quot;<br>        &gt;<br>        Learn how to hide your browsing history.<br>    &lt;/a&gt;<br>    &lt;a id=&quot;panic-button&quot; class=&quot;panic-button__button&quot;<br>        href=&quot;https://www.google.com&quot; <br>        &gt;<br>        &lt;span class=&quot;panic-button__icon&quot;&gt;&amp;times;&lt;/span&gt;<br>        Quick exit (ESC)<br>    &lt;/a&gt;<br>&lt;/div&gt;<br>&lt;link rel=&quot;stylesheet&quot; property=&quot;stylesheet&quot; href=&quot;https://cdn.rawgit.com/studiothick/panic-button/v1.0.4/dist/panic.css&quot; /&gt;<br>&lt;script async src=&quot;https://cdn.rawgit.com/studiothick/panic-button/v1.0.4/dist/panic.min.js&quot;&gt;&lt;/script&gt;<br>&lt;!-- end panic button --&gt;</pre><p>If you decide to use panic-button or have any thoughts or feedback, feel free to get in touch. <a href="https://github.com/studiothick/panic-button/issues">Open an issue</a> if it’s a bug or feature request, or <a href="http://twitter.com/mcccclean">tweet at me</a> if you just want to say hi.</p><h3>Some implementation details for the curious</h3><p>Our goal with panic-button is to create a drop-in, bulletproof solution that can be incorporated into a website with as close to zero effort as possible.</p><p>My first approach was to package it all up in a single script that would create the relevant elements when a page loaded. One could include the file via NPM or Bower and it’d integrate with all kinds of latest-fashion tooling. But this came with three big downsides.</p><h4>It was a pain to configure.</h4><p>In the earliest version of panic-button, config was done by defining a global javascript object called panic_config. I was never comfortable with this, and soon switched to using data-attributes on a container element. I felt that that was better, but still a really ugly way of doing things.</p><h4>It broke entirely if there was no Javascript support</h4><p>Any computer running a pre-JS browser, or one with NoScript enabled, would just show nothing at all.</p><h4>Async loading was janky, sync was slow</h4><p>Spending too much time in Pagespeed Insights has made me permanently wary of any &lt;script&gt; tag that isn’t either inlined or async. But if the panic-button script was included asynchronously, the script would fire after the page had loaded. The creation of a new element at the top would shunt everything down a few lines, resulting in a nasty jolt. Inlining, on the other hand, would never work, because what kind of self-respecting package is distributed by getting the implementer to paste in a big old chunk of code?</p><h3>The solution</h3><p>The solution was, of course, realising that there are a <em>ton</em> of self-respecting packages that are implementable by pasting in a chunk of code. Facebook pixel tracking and Google Analytics both work that way, for example.</p><p>The pasted chunk is only a few lines longer than the global-object config version, and has the added bonus of being configurable by anyone with a passing understanding of HTML, not to mention showing up correctly in WYSIWYG editors and in NoScript situations.</p><h4>A sidenote on “Learn how to hide your browsing history”</h4><p>Currently, the “learn more” button directs to a site on DomesticShelters.org. This was just the best candidate from a quick Google search. There might be better destinations for this link, but that one seems pretty thorough. As with all elements of this project, I welcome feedback and suggestions.</p><h3>Future work</h3><p>The main limitation of panic-button is that it doesn’t erase or obfuscate any entries in the browser history. This is a technical limitation imposed by the browser — pages don’t have read or write permission to their own history entries, much less other ones — but it’s still a feature that is noticeably absent. Absent this behaviour, the banner includes a “safe browsing practices” link, but this is still a compromise. In a perfect world, a sensitive-materials site would be able to call some kind of history.ignoreMe() function that would effectively place a browser in always-private browsing mode for the page being viewed, or perhaps just a meta-tag indicating that a given page should not be stored in history. In any case, such a feature does not exist… yet.</p><p>I’ve also given some thought to detecting incognito/private mode and hiding parts of the banner based on that. I’m not sure it actually adds value to the plugin, though, and the hacks required to make that check — every browser does it differently — would doubtless make the whole thing significantly more error-prone.</p><p>Also, more generally, panic-button has only been in development for a relatively short time. We’ve caught the most obvious bugs, but as the end goal is a bulletproof solution for zero work, I’m sure there’re edge cases we haven’t thought of. As we catch them, we’ll be updating panic-button (and accepting fixes and polishes from anyone who wishes to submit them! <em>Pull requests are welcome!</em>). Those updates will percolate through the internet infrastructure, and help create a safer browsing experience for everyone.</p><p>panic-button is available at <a href="http://github.com/studiothick/panic-button">our github</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=847bdf50aea0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/today-news/panic-button-a-short-intro-to-a-quick-exit-847bdf50aea0">Panic Button: a short intro to a quick exit</a> was originally published in <a href="https://medium.com/today-news">Today</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>