This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable no-restricted-globals */ | |
// This service worker can be customized! | |
// See https://developers.google.com/web/tools/workbox/modules | |
// for the list of available Workbox modules, or add any other | |
// code you'd like. | |
// You can also remove this file if you'd prefer not to use a | |
// service worker, and the Workbox build step will be skipped. | |
import { clientsClaim } from "workbox-core"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import getLocation from "./preloadImages/locationApi"; | |
const LOCAL_STORAGE_PREFIX = "imageQueue"; | |
// This queue holds information about images we want to load, it will be the location object from the location API. | |
// It does not hold the image itself. It is mutated. | |
let queue = []; | |
// Default export. | |
// Fills the image queue with data, and calls utility functions to load their sources. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
navigator.serviceWorker.getRegistrations().then(function (registrations) { | |
if (!registrations.length) { | |
console.log('No serviceWorker registrations found.') | |
return | |
} | |
for(let registration of registrations) { | |
registration.unregister().then(function (boolean) { | |
console.log( | |
(boolean ? 'Successfully unregistered' : 'Failed to unregister'), 'ServiceWorkerRegistration\n' + | |
(registration.installing ? ' .installing.scriptURL = ' + registration.installing.scriptURL + '\n' : '') + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<link rel="icon" href="/favicon.ico" /> | |
<meta name="viewport" content="width=device-width,initial-scale=1" /> | |
<meta name="theme-color" content="#000000" /> | |
<meta name="description" content="A window to anywhere in the world, just a tab away." /> | |
<meta http-equiv="Content-Security-Policy" content="script-src * 'unsafe-eval' 'unsafe-inline';" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Passport - see the world on your new tab page", | |
"description": "A window to anywhere in the world, just a tab away.", | |
"version": "1.0.2", | |
"manifest_version": 2, | |
"chrome_url_overrides": { | |
"newtab": "./index.html" | |
}, | |
"browser_action": { | |
"default_icon": "./favicon-32x32.png" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const yourContentfulSpace = "" | |
// Retrieve an image at 50% quality | |
yourContentfulSpace/mycat.jpg?&q=50 | |
// Retrieve an image as WebP format at 50% quality | |
yourContentfulSpace/mycat.jpg?&fm=webp&q=50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2019-10-20T21:59:12.006Z","extensionVersion":"v3.4.3"} |