Skip to content

Instantly share code, notes, and snippets.


jakub-g jakub-g

View GitHub Profile
jakub-g /
Last active Jul 14, 2020
Will it double-fetch? Browser behavior with `module` / `nomodule` scripts

Testing double-fetching of module/nomodule JS code (including the Safari hack)

<script type="module" src="module.js"></script>
<script nomodule src="nomodule.js"></script>

TL;DR: as of April 2020 life's almost good. It should be perfect by the end of 2020 when Safari 14.0 ships and Chromium-Edge 80+ rollout finishes and Edge-Spartan dies.

Test page:

jakub-g /
Last active Jul 9, 2020
async scripts, defer scripts, module scripts: explainer, comparison, and gotchas

<script> async, defer, async defer, module, nomodule, src, inline - the cheat sheet

With the addition of ES modules, there's now no fewer than 24 ways to load your JS code: (inline|not inline) x (defer|no defer) x (async|no async) x (type=text/javascript | type=module | nomodule) -- and each of them is subtly different.

This document is a comparison of various ways the <script> tags in HTML are processed depending on the attributes set.

If you ever wondered when to use inline <script async type="module"> and when <script nomodule defer src="...">, you're in the good place!

Note that this article is about <script>s inserted in the HTML; the behavior of <script>s inserted at runtime is slightly different - see Deep dive into the murky waters of script loading by Jake Archibald (2013)

jakub-g /
Last active Jun 30, 2020
Unicode-aware JavaScript regex cheat sheet

Unicode-aware JavaScript regex (Unicode property escapes /\p{..}\P{..}/u) cheat sheet

Browser support MDN

jakub-g / _1_"script async defer" blocks "load"
Last active Jun 12, 2020
Beware of "script async defer" blocking HTML "load" event
View _1_"script async defer" blocks "load"

Beware of <script async defer> blocking HTML "load" event

2015.10.07 t

On the importance of simulated latency testing, and bulletproofing your page from the third-party JS load failures


jakub-g /
Last active Jun 5, 2020
Hacker News Links

Hacker News "hidden" URLs

Many of HN URLs are not easily discoverable as there are no links to them in a prominent part on the page, or sometimes even nowhere. The following is a list of links to standard and "special" HN pages. The ones is bold are the less discoverable ones.

See also:


jakub-g /
Last active Jun 2, 2020
Deprecation Dailymotion postMessage API


If you landed on this page, you probably found a message like this in your logs:

This page is using deprecated Dailymotion postMessage API communication format that will be soon removed.
Please update your code. See for details.

Two possibilities

jakub-g / loggers.txt
Created May 29, 2020
Filter out annoying loggers Chrome DevTools
View loggers.txt
-cookie -sourcemap -corb -cors
jakub-g /
Last active May 16, 2020
Trójka LP3 1998 Kazik
jakub-g /
Last active May 14, 2020
UC browser vs Chromium: Kangax ES2016+ tests
You can’t perform that action at this time.