27 October, 2022

Web Notes

Test

<html>
<head>
<script>
  window.addEventListener('offline', function(e) { console.log('offline'); });
  window.addEventListener('online', function(e) { console.log('online'); });
</script>
</head>
<body></body>
</html>

Local Storage

localStorage.setItem('key', 'value');

val value = localStorage.getItem('key');

localStorage.removeItem('key');

localStorage.clear();

Web Security Checklist

  • Subresource Integrity. SRI, linking to 3rd party resources.
  • Content-Security-Policy

Here are some articles to read.