<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Robin Drexler's Blog</title>
    <link>https://www.robin-drexler.com/blog</link>
    <description>Blog posts from Robin Drexler</description>
    <language>en-us</language>
  
    
      <item>
        <title>Retrieve canonical URL on GitHub</title>
        <link>https://www.robin-drexler.com/2020/09/21/github-expand-urls</link>
        <description>
        <![CDATA[<p>When sharing a link to a file on Github, you can press &quot;<code>y</code>&quot; before copying the URL.</p>
<p>This will expand URL to its canonical form and never outdate even if somebody pushes changes to that file and line later.</p>
<p>Before:</p>
<p><img src="/img/posts/github-expand-before.jpg" alt="screenshot github url before expanding"></p>
<p>After:</p>
<p><img src="/img/posts/github-expand-after.jpg" alt="screenshot github url after expanding"></p>
]]>
        <guid>https://www.robin-drexler.com/2020/09/21/github-expand-urls</guid>
        <pubDate>Mon, 21 Sep 2020 00:00:00 GMT</pubDate>
        </description>
      </item> 
      
      <item>
        <title>git cherry-pick ranges</title>
        <link>https://www.robin-drexler.com/2020/09/04/git-cherry-pick-ranges</link>
        <description>
        <![CDATA[<p><a href="https://git-scm.com/docs/git-cherry-pick"><code>git cherry-pick</code></a> accepts ranges which for example allows to cherry pick entire branches into another branch.</p>
<p>That&#39;s noteworthy because <code>git cherry-pick your-branch</code> actually only picks the last commit of <code>your-branch</code> instead of the entire branch.</p>
<h2>Example</h2>
<pre><code class="language-shell">git cherry-pick HEAD..your-branch
</code></pre>
]]>
        <guid>https://www.robin-drexler.com/2020/09/04/git-cherry-pick-ranges</guid>
        <pubDate>Fri, 04 Sep 2020 00:00:00 GMT</pubDate>
        </description>
      </item> 
      
      <item>
        <title>git worktree</title>
        <link>https://www.robin-drexler.com/2020/08/06/git-worktree</link>
        <description>
        <![CDATA[<p><a href="https://git-scm.com/docs/git-worktree"><code>git worktree</code></a> allows to checkout multiple branches of the same repository while leaving your (dirty) worktree intact. No stashing or cloning a second repo necessary.</p>
<p>Imagine you&#39;re in the middle of a refactoring and a co-worker asks you to quickly try something in your code base on the latest <code>main</code> branch. Or you need to quickly put up a bugfix.</p>
<p>You have multiple options here. Stash everything or create (and push) a WIP commit are two of them.</p>
<p>However, you can also leverage <code>git worktree</code>.</p>
<pre><code class="language-bash"># this creates a `../test-me` folder which includes a worktree copy of the current repo
git worktree ../test-me
cd ../test-me
# make changes and commit them
</code></pre>
<p>You can use <code>git worktree list</code> to view all your current worktrees and <code>git worktree remove</code> to remove them.</p>
<p>This can also come in handy if you have to maintain older versions of your code base. You can quickly check it out and apply changes in another folder without disrupting your main worktree.</p>
]]>
        <guid>https://www.robin-drexler.com/2020/08/06/git-worktree</guid>
        <pubDate>Thu, 06 Aug 2020 00:00:00 GMT</pubDate>
        </description>
      </item> 
      
      <item>
        <title>console.timeLog</title>
        <link>https://www.robin-drexler.com/2019/09/11/console-time-log</link>
        <description>
        <![CDATA[<blockquote>
<p>Logs the current value of a timer that was previously started by calling console.time</p>
</blockquote>
<p><a href="https://developer.mozilla.org/en-US/docs/Web/API/console/timeLog">https://developer.mozilla.org/en-US/docs/Web/API/console/timeLog</a></p>
<p>I always had trouble coming up with unique labels when logging inside loops because I didn&#39;t know this existed and relied on <a href="https://developer.mozilla.org/en-US/docs/Web/API/console/time"><code>console.time</code></a> and <a href="https://developer.mozilla.org/en-US/docs/Web/API/console/timeEnd"><code>console.timeEnd</code></a>.</p>
<h2>Example</h2>
<pre><code class="language-js">console.time(&#39;test&#39;);

setInterval(() =&gt; {
    console.timeLog(&#39;test&#39;);
}, 500);
</code></pre>
<p>Logs something like:</p>
<pre><code class="language-log">test: 500.716064453125 ms
test: 1000.72509765625 ms
test: 1500.756103515625 ms
test: 2000.7880859375 ms
#...
</code></pre>
<p><a href="https://jsfiddle.net/robindrexler/9vyb3c5f/1/">https://jsfiddle.net/robindrexler/9vyb3c5f/1/</a></p>
]]>
        <guid>https://www.robin-drexler.com/2019/09/11/console-time-log</guid>
        <pubDate>Wed, 11 Sep 2019 00:00:00 GMT</pubDate>
        </description>
      </item> 
      
      <item>
        <title>Firefox RCWN (race cache with network)</title>
        <link>https://www.robin-drexler.com/2019/09/03/firefox-race-cache-with-network</link>
        <description>
        <![CDATA[<p>Sometimes in the Firefox devtools network tab you might find a request that is flagges as &quot;raced&quot;.</p>
<p>That is because Firefox has implemented a &quot;RCWN&quot; (race cache with network) strategy where it&#39;ll try to fetch assets that are already cached from the network when IO is slow on the device and re-issuing the network request will actually be faster than reading the file from disk.</p>
<p>You can see stats at: <code>about:networking#rcwn</code></p>
]]>
        <guid>https://www.robin-drexler.com/2019/09/03/firefox-race-cache-with-network</guid>
        <pubDate>Tue, 03 Sep 2019 00:00:00 GMT</pubDate>
        </description>
      </item> 
      
      <item>
        <title>JavaScript destructure directly into return statement</title>
        <link>https://www.robin-drexler.com/2019/07/09-destructure-return</link>
        <description>
        <![CDATA[<p>You can destructure an object directly into a return statement. No need to assign to a <code>const</code> first. Never tried this before and just assumed it does not work. 😅</p>
<pre><code class="language-js">const obj = { hello: &#39;world&#39; };

function greet() {
    return ({ hello } = obj);
}

// logs {hello: &#39;world&#39;}
console.log(greet());
</code></pre>
]]>
        <guid>https://www.robin-drexler.com/2019/07/09-destructure-return</guid>
        <pubDate>Tue, 09 Jul 2019 00:00:00 GMT</pubDate>
        </description>
      </item> 
      
      <item>
        <title>Access the natural height of an image</title>
        <link>https://www.robin-drexler.com/2019/07/02-image-natural-height</link>
        <description>
        <![CDATA[<p><a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/naturalHeight"><code>HTMLImageElement.naturalHeight</code></a> (and <code>width</code>) returns the original dimensions for an image, regardless of how it is displayed.</p>
<h2>Example</h2>
<p>Imagine a page that has an image:</p>
<pre><code class="language-html">&lt;img src=&quot;https://imgur.com/RrupgUW.jpg&quot; width=&quot;250&quot; /&gt;
</code></pre>
<pre><code class="language-js">const img = document.querySelector(&#39;img&#39;);

// image needs to be loaded before we can get its natural dimensions
img.onload = () =&gt; {
    const { width, height, naturalWidth, naturalHeight } = img;

    console.log({
        width,
        height,
        naturalWidth,
        naturalHeight,
    });
};
</code></pre>
<p><a href="https://jsfiddle.net/robindrexler/dxo28e7n/3/">https://jsfiddle.net/robindrexler/dxo28e7n/3/</a></p>
]]>
        <guid>https://www.robin-drexler.com/2019/07/02-image-natural-height</guid>
        <pubDate>Tue, 02 Jul 2019 01:00:00 GMT</pubDate>
        </description>
      </item> 
      
      <item>
        <title>Focus input field inside keydown event handler</title>
        <link>https://www.robin-drexler.com/2019/07/02-keydown-focus</link>
        <description>
        <![CDATA[<p>If you focus an input field <strong>inside</strong> a <code>keydown</code> event handler, the value will actually end up inside the focused input field. It makes sense, I just never thought about it.</p>
<h2>Example</h2>
<pre><code class="language-js">window.addEventListener(&#39;keypress&#39;, (event) =&gt; {
    document.querySelector(&#39;input&#39;).focus();
});
</code></pre>
<p>You can try it here: <a href="https://jsfiddle.net/vq38uhne/1/">https://jsfiddle.net/vq38uhne/1/</a></p>
<p>Press any key while the input field is <strong>not</strong> focused.<br>The value will still end up inside the input field because it&#39;s being focussed in the <code>keydown</code> event handler.</p>
]]>
        <guid>https://www.robin-drexler.com/2019/07/02-keydown-focus</guid>
        <pubDate>Tue, 02 Jul 2019 00:00:00 GMT</pubDate>
        </description>
      </item> 
      
      <item>
        <title>Search network responses in Chrome devtools</title>
        <link>https://www.robin-drexler.com/2019/04/29-chrome-devtools-search-network-responses</link>
        <description>
        <![CDATA[<p>You can search the content of <strong>all</strong> network requests in the Chrome devtools.<br>Go to the Network panel and hit <kbd>command</kbd> + <kbd>F</kbd> (or ctrl+F) if you&#39;re on windows or linux) and search for what you&#39;re looking for.</p>
<p>It&#39;s brilliant.</p>
<p><a href="/img/posts/chrome-network-tab-search.jpg"><img src="/img/posts/chrome-network-tab-search.jpg" alt="screenshot of chrome devtools network tab with search"></a></p>
]]>
        <guid>https://www.robin-drexler.com/2019/04/29-chrome-devtools-search-network-responses</guid>
        <pubDate>Mon, 29 Apr 2019 00:00:00 GMT</pubDate>
        </description>
      </item> 
      
      <item>
        <title>Block the event loop for a specific amount of time</title>
        <link>https://www.robin-drexler.com/2019-02-26-block-event-loop</link>
        <description>
        <![CDATA[<p>If you want to block / slow down the event loop for a specific amount of time you can utilize a while loop that checks if a certain amount of time has passed in each iteration and will only finish once that has happened.</p>
<p>I used to create astronomically large arrays to slow down execution, but this is much better and much more precise and predictable.</p>
<h2>Example</h2>
<p>This will block the event loop for 500 milliseconds before continuing.</p>
<pre><code class="language-js">const endDate = new Date().getTime() + 500;

console.time();

// this blocks the event loop
while (new Date().getTime() &lt;= endDate) {}

// logs something like default: 500.878173828125 ms
console.timeEnd();
</code></pre>
<p><a href="https://jsfiddle.net/robindrexler/ybuafxsw/2/">https://jsfiddle.net/robindrexler/ybuafxsw/2/</a></p>
]]>
        <guid>https://www.robin-drexler.com/2019-02-26-block-event-loop</guid>
        <pubDate>Tue, 26 Feb 2019 00:00:00 GMT</pubDate>
        </description>
      </item> 
      
      <item>
        <title>Disable JavaScript with Chrome DevTools command</title>
        <link>https://www.robin-drexler.com/2019-02-22-disable-javscript-chrome-devtools-command</link>
        <description>
        <![CDATA[<p>The Chrome developer tools ship with an <a href="https://developer.chrome.com/docs/devtools/command-menu/">interface to run commands</a> (similar to what&#39;s available in vscode).</p>
<p>That&#39;s useful to do common tasks like disabling or enabling JavaScript. Which otherwise needs to be done by going through the DevTools settings.</p>
<p>The command interface can be opened with <kbd>command</kbd> + <kbd>shift</kbd> + <kbd>P</kbd> (or Ctrl on Windows or Linux).</p>
<p><img src="/img/posts/chrome-devtools-action.png" alt="screenshot chrome command menu"></p>
]]>
        <guid>https://www.robin-drexler.com/2019-02-22-disable-javscript-chrome-devtools-command</guid>
        <pubDate>Fri, 22 Feb 2019 00:00:00 GMT</pubDate>
        </description>
      </item> 
      
      <item>
        <title>How labeled statements make arrow functions a bit harder</title>
        <link>https://www.robin-drexler.com/2017/05/23/How-labeled-statements-make-arrow-functions-a-bit-harder</link>
        <description>
        <![CDATA[<p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions">Arrow functions</a> are awesome. They bind <code>this</code> lexically, and even allow implied <code>return</code> when they only contain one expression.</p>
<pre><code class="language-js">const add = (a, b) =&gt; a + b;
add(1, 3); // 4
</code></pre>
<p>Unfortunately, it&#39;s easy to get it wrong.<br>Imagine we wanted to return a result object instead of only the integer.<br>Something I often see in code (and write too often myself) is:</p>
<pre><code class="language-js">const add = (a, b) =&gt; {
    result: a + b;
};
add(1, 2); // undefined
</code></pre>
<p>The expected result probably is:</p>
<pre><code class="language-js">{
    result: 3;
}
</code></pre>
<p>However, it will be <code>undefined</code> instead. This is because the curly braces, we intended to use to create an object literal, open a new block and therefore we&#39;d need to add an explicit return or parenthesis around the implicit return statement to get it to work.<br>That&#39;s pretty nasty and often hard to spot.</p>
<p>Here&#39;s two versions that would fix the error:</p>
<pre><code class="language-js">const add = (a, b) =&gt; ({ result: a + b });
const add = (a, b) =&gt; {
    return { result: a + b };
};
</code></pre>
<p>After making this error a couple of times and simply accepting the way to fix it, I began to ask why doesn&#39;t it throw an error, which would make my life a lot easier.<br>Since enclosing the statement in curly braces does not create an object literal, but opens a new block, there&#39;s only the following function body left:</p>
<pre><code class="language-js">result: a + b;
</code></pre>
<p>To showcase it a little bit better, here&#39;s how the entire function would look like in es5.</p>
<pre><code class="language-js">function add(a, b) {
    result: a + b;
}
</code></pre>
<p>How is that valid javascript, I wondered. I&#39;ve never seen anything like this, yet neither browsers nor node complained about it.<br>It turns out there&#39;s <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label">labeled statements</a> in javascript, which coincidentally follow such syntax. They&#39;re usually used to label loops to be able to break out of them later.</p>
<p>Example by <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label">mdn</a>:</p>
<pre><code class="language-js">var i, j;

loop1: for (i = 0; i &lt; 3; i++) {
    //The first for statement is labeled &quot;loop1&quot;
    loop2: for (j = 0; j &lt; 3; j++) {
        //The second for statement is labeled &quot;loop2&quot;
        if (i === 1 &amp;&amp; j === 1) {
            continue loop1;
        }
        console.log(&#39;i = &#39; + i + &#39;, j = &#39; + j);
    }
}
</code></pre>
]]>
        <guid>https://www.robin-drexler.com/2017/05/23/How-labeled-statements-make-arrow-functions-a-bit-harder</guid>
        <pubDate>Tue, 23 May 2017 00:00:00 GMT</pubDate>
        </description>
      </item> 
      
      <item>
        <title>Making Google PageSpeed comparable</title>
        <link>https://www.robin-drexler.com/2017/01/31/making-google-pagespeed-comparable</link>
        <description>
        <![CDATA[<p>For years now, I&#39;ve used Google&#39;s <a href="https://developers.google.com/speed/pagespeed/insights/">&quot;PageSpeed Insights&quot;</a> service to measure the performance of websites.</p>
<p>For those that have never heard of it, PageSpeed works like this: You enter an URL and the service calculates a score from 0 to 100 and also gives some additional advice on how to improve performance.</p>
<p><img
width="2082"
height="1722"
src="/img/posts/pagespeed-insights.png"
alt="Screenshot pagespeed insights" /></p>
<p>While receiving such score is valuable on its own and for example you can safely assume that a score of 95 is great, I somehow missed a way to compare with others. Is a score of 60 good as well or bad? How about 75? I was never sure.</p>
<p>Enter <a href="https://webperfchallenge.com/">https://webperfchallenge.com/</a>. What webperfchallenge.com does is rather simple. You enter your URL and just like PageSpeed Insights it will tell you the site&#39;s Google PageSpeed score. However, it will additionally show you how your site performs compared to the top 50 most popular websites in the world.</p>
<p>Take my site for example. As of writing, its score is <strong>89</strong> which is better than or equal to <strong>97%</strong> of top 50 most popular websites. That&#39;s useful information, at least for me, because it tells me that my site is good enough™ to hang with the most visited websites when it comes to performance.</p>
<p><img
width="2082"
height="1722"
src="/img/posts/webperf-challenge.png"
alt="Screenshot webperfchallenge.com" /></p>
]]>
        <guid>https://www.robin-drexler.com/2017/01/31/making-google-pagespeed-comparable</guid>
        <pubDate>Tue, 31 Jan 2017 00:00:00 GMT</pubDate>
        </description>
      </item> 
      
      <item>
        <title>[GERMAN] Tod durch Automation</title>
        <link>https://www.robin-drexler.com/2017/01/21/tod-durch-automation</link>
        <description>
        <![CDATA[<p>Maschinen nehmen uns die Arbeitsplätze weg. Das ist schon seit Jahrzehnten der Fall und diese Entwicklung wird unaufhaltsam und immer rasanter vorangehen. Es gibt Schätzungen, nach denen in weniger als zehn Jahren ein drittel aller zur Zeit von Menschen erledigten Jobs von Maschinen übernommen sein wird.[1]</p>
<p>Und wer weiß, vielleicht werden es sogar noch mehr sein. In zwanzig Jahren sowieso. Die Frage ist nicht mehr, ob sondern wann ein Großteil der Jobs von Maschinen erledigt wird.<br>Wann immer die Arbeit von Maschinen für ein Unternehmen günstiger ist, als die eines Menschen, wird es sich für die Maschine entscheiden. Und das ist auch ok so, finde ich.<br>Arbeit an sich ist kein Selbstzweck. Jeden Menschen, den wir davon befreien können arbeiten zu <em>müssen</em>, empfinde ich als Glücksfall.</p>
<p>So haben die Menschen mehr Zeit sich mit den Dingen zu beschäftigen, die sie wirklich interessieren und erfüllen.<br>Einfach wird das wohl leider nicht. Wenn man mal drüber nachdenkt, ist unser gesamtes System darauf aufgebaut, dass Menschen durch ihre eigene Arbeitsleistung Werte und Einkommen schaffen. Für sich selbst und für die Gesellschaft als Ganzes. Sind weniger Menschen in der Lage zu arbeiten, weil es einfach keine Jobs mehr auszufüllen gibt, könnte das System zu Taumeln beginnen.<br>Schauen wir uns mal ein paar Zahlen an (aus dem Jahr 2012)[2]:</p>
<p>tl;dr für die Faulen:<br>Ein Großteil des Bundeshaushalts entsteht durch Einnahmen, die entweder direkt oder indirekt von der menschlichen Arbeit Einzelner abhängen.</p>
<p>Von den 1.171 Milliarden Euro Bundeshaushalt (Geld, welches durchaus auch sinnvoll für Daseinsvorsorge genutzt wird) kamen 51,2% (600 Millionen Euro) aus Steuereinnahmen.<br>Ganze 24,8% davon wiederum entfallen auf die Lohnsteuer. Noch abhängiger von menschlicher Arbeit geht es kaum. Weitere 23,7% sind Umsatzsteuer. Wenn weniger Menschen ein gutes Einkommen erzielen können, kaufen sie auch weniger, was zu Mindereinnahmen bei der Umsatzsteuer führt.</p>
<p>Gute 420 Milliarden Euro (35,87% des Gesamthaushalts) entstehen durch Sozialabgaben, wie Arbeitslosenversicherung, Rentenversicherung, Krankenversicherung etc. Auch diese Einnahmen sind direkt abhängig von menschlichen Beschäftigungsverhältnissen.<br>Heutige Arbeitslose (und andere Bedürftige) können Leistungen nur erhalten, weil Andere sie durch ihre Arbeit erwirtschaften.</p>
<p>Wenn immer mehr Leute durch die fortschreitende Automation arbeitslos werden, geht die aktuelle Rechnung irgendwann nicht mehr auf. Mehr Geld wird benötigt werden, während gleichzeitig weniger Finanzen in den Haushalt strömen.<br>Konkrete Lösungsvorschläge habe ich leider auch nicht parat, aber mir scheint eine Entkopplung der Bundeshaushaltseinnahmen von menschlicher Arbeit unausweichlich.<br>Geschaffen werden Werte und Produkte ja immer noch. Ein Kuchen zum Verteilen ist also weiterhin vorhanden. :)</p>
<p>Nur um die Art und Weise sollten wir uns langsam mal streiten, denke ich.<br>Und wer jetzt noch fünfzehn Minuten Zeit hat, dem lege ich dieses ganz fantastische Video zum Thema fortschreitender Automation ans Herz: <a href="https://www.youtube.com/watch?v=7Pq-S557XQU">https://www.youtube.com/watch?v=7Pq-S557XQU</a><br>[1]<a href="http://www.businessinsider.com/experts-predict-that-one-third-of-jobs-will-be-replaced-by-robots-2015-5?IR=T">http://www.businessinsider.com/experts-predict-that-one-third-of-jobs-will-be-replaced-by-robots-2015-5?ir=t</a><br>[2]<a href="http://www.bpb.de/wissen/TQ0PLW,0,0,Steuereinnahmen_nach_Steuerarten.html">http://www.bpb.de/wissen/tq0plw,0,0,steuereinnahmen_nach_steuerarten.html</a></p>
<p><a href="https://www.facebook.com/notes/robin-drexler/tod-durch-automation/460178620841350">Original veröffentlicht auf Facebook am 21.02.2016</a></p>
]]>
        <guid>https://www.robin-drexler.com/2017/01/21/tod-durch-automation</guid>
        <pubDate>Sat, 21 Jan 2017 00:00:00 GMT</pubDate>
        </description>
      </item> 
      
      <item>
        <title>Hallway testing works</title>
        <link>https://www.robin-drexler.com/2016/11/08/hallway-testing-works</link>
        <description>
        <![CDATA[<p>During this year&#39;s Firebase Dev Summit in Berlin, <a href="https://twitter.com/tobiasbales" title="https://twitter.com/tobiasbales">Tobias</a> and I built a little web app, called <a href="https://webperfchallenge.com/" title="https://webperfchallenge.com/">webperfchallenge</a>, which allows to compare your website&#39;s mobile performance with the top 50 most popular websites in the world.</p>
<p>During development we simply used Chrome&#39;s autocompletion to insert test urls.<br><img src="https://image.jimcdn.com/app/cms/image/transf/dimension=462x1024:format=png/path/se42d1516dcb4082b/image/i62270ef81557ac8e/version/1478626142/image.png"
height="467"
width="462"
alt="screenshot of page" /></p>
<p>Later that day, I showed the app to two people so they&#39;d test it. Since we were at the party already, they used their phones to do so.</p>
<p>Naturally they just typed their domain name (e.g. &quot;google.com&quot;) and pressed &quot;analyze&quot;.<br>The app failed and displayed an error. The typed URL needed to be valid and contain a protocol (http or https). However, nobody wants to type an entire URL, especially on a phone.</p>
<p>The fix itself was rather easy. When the entered URL doesn&#39;t contain a protocol, &quot;http&quot; is prepended before it is submitted.</p>
<p>We didn&#39;t catch that UX-bug during development, because of how we worked.</p>
<p>Conclusion: Get your apps tested on the hallway. You&#39;ll generate great insights even with a low number of testers. :)</p>
]]>
        <guid>https://www.robin-drexler.com/2016/11/08/hallway-testing-works</guid>
        <pubDate>Tue, 08 Nov 2016 00:00:00 GMT</pubDate>
        </description>
      </item> 
      
      <item>
        <title>Consequences of serving websites over http</title>
        <link>https://www.robin-drexler.com/2015/09/09/consequences-of-serving-websites-over-http</link>
        <description>
        <![CDATA[<p>This blog post briefly outlines the risks of continuing to deliver websites over http instead of https in the next years. Obvious security benefits are put aside for now. Everything discussed in this post is probably 1-3 years away, so there is no need to panic. Still it&#39;s good to know the direction we&#39;re heading.</p>
<h2>Browsers will mark non-secure origins as non-secure</h2>
<p>Normally, when you visit a site that is served over https, in most browsers, a green lock symbol appears in the address bar, indicating that the page is served securely. This is going to be inverted, at least in Chrome. In the future, sites that are served over http instead of https, will be flagged as insecure. Eventually, once https is the norm, the green lock indicator will completely vanish.<br><a href="https://www.chromium.org/Home/chromium-security/marking-http-as-non-secure" title="https://www.chromium.org/Home/chromium-security/marking-http-as-non-secure">https://www.chromium.org/Home/chromium-security/marking-http-as-non-secure</a></p>
<h3>non-secure</h3>
<p><img
  src="https://image.jimcdn.com/app/cms/image/transf/dimension=990x10000:format=png/path/se42d1516dcb4082b/image/i8dca61e20dcc3cdc/version/1441827326/image.png"
  width="990"
  height="221"
/></p>
<h3>Secure</h3>
<p><img
  src="https://image.jimcdn.com/app/cms/image/transf/dimension=990x10000:format=png/path/se42d1516dcb4082b/image/i5a9f1df6ab2393f9/version/1441827407/image.png"
  width="990"
  height="171"
  /></p>
<p><strong>UPDATE 22.10.2015</strong><br>Beginning with (nightly) version 44, Firefox flags websites as non-secure, when they contain a password input field. A measure taken to prevent users from submitting login data, because it might be compromised<br><img
  src="https://image.jimcdn.com/app/cms/image/transf/dimension=990x10000:format=jpg/path/se42d1516dcb4082b/image/ife201cbca6328cde/version/1445542006/image.jpg"
  width="990"
  height="687"
 /></p>
<h2>New web apis are going to be https only</h2>
<p>Some of the new web apis, especially those that are considered powerful (e.g. have access to sensitive data), are going to only be available on pages served over https.<br>For example:</p>
<ul>
<li><a href="http://www.w3.org/TR/service-workers/#security-considerations" title="http://www.w3.org/TR/service-workers/#security-considerations">Service Workers</a></li>
<li><ul>
<li>background tasks</li>
<li>geofencing</li>
<li>push notifications</li>
<li>new cache abilities</li>
</ul>
</li>
<li><a href="https://developers.google.com/web/updates/2015/03/increasing-engagement-with-app-install-banners-in-chrome-for-android?hl=en" title="https://developers.google.com/web/updates/2015/03/increasing-engagement-with-app-install-banners-in-chrome-for-android?hl=en">App install banners</a> (due to service worker being needed)</li>
</ul>
<p><strong>UPDATE 21.01.2016</strong></p>
<p>The new compression algorithm <a href="https://github.com/google/brotli" title="https://github.com/google/brotli">brotli</a>, which is said to have a better compression results than gzip, will only work on HTTPS connections in Chrome and Firefox.</p>
<p><a href="https://www.chromestatus.com/feature/5420797577396224" title="https://www.chromestatus.com/feature/5420797577396224">https://www.chromestatus.com/feature/5420797577396224</a></p>
<h2>Existing web apis will stop working non secure</h2>
<p>Not only will new features be available for secure origins only, there are also discussions in place about removing currently available apis as well. Those include:</p>
<ul>
<li>geolocation</li>
<li>access to microphone / camera</li>
<li>full screen</li>
<li>(session) storage</li>
</ul>
<p><a href="https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins">https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins</a> <a href="https://sites.google.com/a/chromium.org/dev/Home/chromium-security/prefer-secure-origins-for-powerful-new-features">https://sites.google.com/a/chromium.org/dev/Home/chromium-security/prefer-secure-origins-for-powerful-new-features</a> <a href="http://www.w3.org/TR/powerful-features/#feature-requires-privilege">http://www.w3.org/TR/powerful-features/#feature-requires-privilege</a> <a href="https://blog.mozilla.org/security/2015/04/30/deprecating-non-secure-http/">https://blog.mozilla.org/security/2015/04/30/deprecating-non-secure-http/</a></p>
<h3>Deprecation is already in process</h3>
<p>Using the geolocation api on a non-secure origin already utters a deprecation warning in recent Chrome versions.<br><img
  src="https://image.jimcdn.com/app/cms/image/transf/dimension=990x10000:format=png/path/se42d1516dcb4082b/image/ibcbe510d4cc3ce0e/version/1441827913/image.png"
  width="990"
  height="41"
 /></p>
]]>
        <guid>https://www.robin-drexler.com/2015/09/09/consequences-of-serving-websites-over-http</guid>
        <pubDate>Wed, 09 Sep 2015 00:00:00 GMT</pubDate>
        </description>
      </item> 
      
      <item>
        <title>Improving "/search" UX with a small change</title>
        <link>https://www.robin-drexler.com/2015/09/07/improving-search-ux-with-a-small-change</link>
        <description>
        <![CDATA[<p>A while ago, I created  a Chrome extension called <a href="/projects/chrome-extensions/#search" title="/search">/search</a>.<br>It focuses the first search field on any page by pressing &quot;/&quot;, which allows for instant searching on pages like amazon.com.</p>
<p>What always bothered me was that it only worked after the document is ready. On amazon.com that can actually take a couple of seconds. As of today, their index page consists of over 9000 lines, including tons of scripts. That just takes a while to be completely processed by browsers. (To be fair, the first bits of the page are visible pretty fast)</p>
<p>However, I really never took the time address this issue. At least not until today. The &quot;fix&quot; turned out to be rather small and straight forward. Chrome allows to control <a href="https://developer.chrome.com/extensions/content_scripts" title="https://developer.chrome.com/extensions/content_scripts">when a content script is executed</a> in the manifest file.</p>
<p>The options are:</p>
<ul>
<li>document_start</li>
<li>document_end</li>
<li>document_idle (default)</li>
</ul>
<p>I only had to set it to &quot;document_start&quot; and now the script is executed before any DOM is constructed, instead of afterwards. As soon as a user presses &quot;/&quot; the script can react to it and has access to all elements that are already rendered on the page.<br>If a user can see the first search input on the page, they can now focus it by hitting the &quot;/&quot; key. No more waiting until the page is ready.</p>
]]>
        <guid>https://www.robin-drexler.com/2015/09/07/improving-search-ux-with-a-small-change</guid>
        <pubDate>Mon, 07 Sep 2015 00:00:00 GMT</pubDate>
        </description>
      </item> 
      
      <item>
        <title>"Don't save" vs. "delete" </title>
        <link>https://www.robin-drexler.com/2015/08/27/don-t-save-vs-delete</link>
        <description>
        <![CDATA[<p>When attempting to close Apple&#39;s TextEdit, while still editing an unsaved file, the button that discards the file is labeled <strong>&quot;delete&quot;</strong> instead of the more commonly used <strong>&quot;don&#39;t save&quot;</strong> or <strong>&quot;discard&quot;</strong>.<br>I&#39;m not entirely sure why, but this seemingly small difference makes me think twice before closing the editor, even when I originally intended to discard the file.</p>
]]>
        <guid>https://www.robin-drexler.com/2015/08/27/don-t-save-vs-delete</guid>
        <pubDate>Thu, 27 Aug 2015 00:00:00 GMT</pubDate>
        </description>
      </item> 
      
      <item>
        <title>getter and setter in JavaScript</title>
        <link>https://www.robin-drexler.com/2015/08/16/til-getter-and-setter-in-javascript</link>
        <description>
        <![CDATA[<p>You can define getter and setter functions in JS, which from the outside just look like normal objects properties, but since they&#39;re functions can do additional work when accessed.<br>Could for example be useful to log access to properties when you&#39;re not sure if they&#39;re still used somewhere.<br><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get" title="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get</a><br><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get" title="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"> </a></p>
<p>Kind of reminds me of Ruby&#39;s <a href="http://ruby-doc.com/docs/ProgrammingRuby/html/tut_classes.html#UC" title="http://ruby-doc.com/docs/ProgrammingRuby/html/tut_classes.html#UC">Virtual Attributes</a>.</p>
<h2>Example getter and setter</h2>
<pre><code class="language-js">var dog = {
    get age() {
        console.log(&#39;accessed age&#39;);
        return this._age;
    },
    set age(age) {
        console.log(&#39;set age&#39;);
        this._age = age;
    }
};

dog.age = 8;
console.log(dog.age);
</code></pre>
]]>
        <guid>https://www.robin-drexler.com/2015/08/16/til-getter-and-setter-in-javascript</guid>
        <pubDate>Sun, 16 Aug 2015 00:00:00 GMT</pubDate>
        </description>
      </item> 
      
      <item>
        <title>Chrome warn before quitting</title>
        <link>https://www.robin-drexler.com/2015/08/06/ux-snippet-chrome-warn-before-quitting</link>
        <description>
        <![CDATA[<p>I&#39;m a heavy user of keyboard shortcuts, especially while browsing the web. The shortcut to close an open tab in Chrome  is <strong>CMD + W</strong>. That&#39;s fine until you think about the fact that there&#39;s a global shortcut in OSX to closes any focused app: <strong>CMD+Q</strong>. Unfortunately the W key and the Q key happen to be pretty close to one another, which sometimes results in an accidental browser quit.</p>
<p>That&#39;s why Chrome on OSX offers to warn when <strong>CMD+Q</strong> is pressed, instead of closing. If you actually intended to close the browser, you can either hold <strong>CMD+Q</strong> or hit the shortcut again. Chrome will then close.<br><img
  src="https://image.jimcdn.com/app/cms/image/transf/none/path/se42d1516dcb4082b/image/i19974188c2b20e6a/version/1438890201/image.jpg"
  width="934"
  height="1024"
 /></p>
]]>
        <guid>https://www.robin-drexler.com/2015/08/06/ux-snippet-chrome-warn-before-quitting</guid>
        <pubDate>Thu, 06 Aug 2015 00:00:00 GMT</pubDate>
        </description>
      </item> 
      
    
  </channel>
</rss>
  