Going offline at Indie Web Camp Düsseldorf

I’ve just come back from a ten-day trip to Germany. The trip kicked off with Indie Web Camp Düsseldorf over the course of a weekend.

IndieWebCamp Düsseldorf 2017
IndieWebCamp Düsseldorf 2017
IndieWebCamp Düsseldorf 2017
IndieWebCamp Düsseldorf 2017
IndieWebCamp Düsseldorf 2017
IndieWebCamp Düsseldorf 2017
IndieWebCamp Düsseldorf 2017
IndieWebCamp Düsseldorf 2017
IndieWebCamp Düsseldorf 2017
if (navigator.serviceWorker && navigator.serviceWorker.controller) {
window.addEventListener('load', function() {
var data = {
"title": "A minority report on artificial intelligence",
"description": "Revisiting Spielberg’s films after a decade and a half.",
"published": "May 7th, 2017",
"timestamp": "1494171049"
};
localStorage.setItem(
window.location.href,
JSON.stringify(data)
);
});
}
var data = {
"title": document.querySelector("title").innerText,
"description": document.querySelector("meta[name='description']").getAttribute("contents")
}
const browsingHistory = [];
caches.open('pages')
.then( cache => {
cache.keys()
.then(keys => {
keys.forEach( request => {
let data = JSON.parse(localStorage.getItem(request.url));
if (data) {
data['url'] = request.url;
browsingHistory.push(data);
}
});
browsingHistory.sort( (a,b) => {
return b.timestamp - a.timestamp;
});
let markup = '';
browsingHistory.forEach( data => {
markup += `
<h2><a href="${ data.url }">${ data.title }</a></h2>
<p>${ data.description }</p>
<p class="meta">${ data.published }</p>
`;
});
let container = document.getElementById('history');
container.insertAdjacentHTML('beforeend', markup);

A web developer and author living and working in Brighton, England. Everything I post on Medium is a copy — the originals are on my own website, adactio.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store