Skip to content

Instantly share code, notes, and snippets.

View sp2013hem's full-sized avatar

Hemanth Anumolu sp2013hem

View GitHub Profile
@sp2013hem
sp2013hem / override-addEventListener.html
Created October 2, 2019 07:11 — forked from pmuellr/override-addEventListener.html
test to see what we can do when we override addEventListener
<!--
======================================================================
Example trying to show hooking addEventListener to see if we can
capture error state for errors that occur in the handler.
Basically, we can capture that an error occurred, and get the
error message, and the event and object that was fired that
caused code to run that caused the error. But no stack trace
or line information.

ServiceWorker for github pages

This is a ServiceWorker template to turn small github pages into offline ready app.

Why ?

Whenever I make small tools & toys, I create github repo and make a demo page using github pages (like this one).
Often these "apps" are just an index.html file with all the nessesary CSS and JavaScript in it (or maybe 2-3 html/css/js files). I wanted to cache these files so that I can access my tools offline as well.

Notes

Make sure your github pages have HTTPS enforced, you can check Settings > GitHub Pages > Enforce HTTPS of your repository.