惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LangChain Blog
Recent Announcements
Recent Announcements
GbyAI
GbyAI
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Microsoft Azure Blog
Microsoft Azure Blog
N
Netflix TechBlog - Medium
人人都是产品经理
人人都是产品经理
MongoDB | Blog
MongoDB | Blog
D
DataBreaches.Net
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
U
Unit 42
腾讯CDC
D
Docker
The GitHub Blog
The GitHub Blog
阮一峰的网络日志
阮一峰的网络日志
Vercel News
Vercel News
I
InfoQ
Jina AI
Jina AI
爱范儿
爱范儿
宝玉的分享
宝玉的分享
博客园 - Franky
G
Google Developers Blog
P
Proofpoint News Feed

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How I Built a Privacy-First Firefox New Tab Extension (No...
Weather Cloc · 2026-05-04 · via DEV Community

The Problem With Most Browser Extensions

Browser extensions have a reputation problem. Many popular extensions — weather apps, new tab replacements, productivity tools — quietly collect your browsing data, sell it to advertisers, or require accounts that tie activity to your identity.

When I built the Weather & Clock Dashboard for Firefox, I made a different choice: zero data collection, no accounts, no tracking. Here's exactly how that works technically.

What "Privacy-First" Actually Means

The term gets thrown around a lot. For this extension, it means:

  1. No network requests to my servers — weather data goes directly from your browser to Open-Meteo's API
  2. No analytics or telemetry — no Mixpanel, no GA4, no PostHog
  3. No account required — settings stored locally via localStorage, never synced
  4. Minimal permissions — only storage and geolocation (if you enable weather)

The Architecture

[Your Browser] → [Open-Meteo API] (weather data)
[Your Browser] → [localStorage] (your settings)

That's it. No middleman.

Enter fullscreen mode Exit fullscreen mode

Handling Weather Without a Backend

Most weather extensions route your location through their own servers. This lets them:

  • Log your IP address
  • Associate your location with an account
  • Sell the data

With Open-Meteo, I skip all of this:

// Browser requests weather directly — no proxy server
async function fetchWeather(lat, lon) {
  const url = `https://api.open-meteo.com/v1/forecast
    ?latitude=${lat}
    &longitude=${lon}
    &current_weather=true
    &daily=temperature_2m_max,temperature_2m_min,weathercode
    &forecast_days=3`;

  const response = await fetch(url);
  return response.json();
}

Enter fullscreen mode Exit fullscreen mode

Open-Meteo is a free, open-source weather API with no API key required. Your IP touches their servers (that's unavoidable for any weather service), but there's no account linking.

Geolocation: User Consent First

function requestWeatherPermission() {
  navigator.geolocation.getCurrentPosition(
    position => {
      // User approved — fetch weather
      fetchWeather(position.coords.latitude, position.coords.longitude);
    },
    error => {
      // User denied — show a default city selector
      showCitySearch();
    }
  );
}

Enter fullscreen mode Exit fullscreen mode

The browser's native geolocation permission dialog gives users full control. If denied, the extension falls back to a city search so you can still get weather without sharing your precise location.

Settings Storage: localStorage Only

All preferences — theme, chosen cities, temperature unit — live in localStorage. Nothing is sent anywhere.

const SETTINGS_KEY = 'wcd_settings';

function saveSettings(settings) {
  localStorage.setItem(SETTINGS_KEY, JSON.stringify(settings));
}

function loadSettings() {
  const raw = localStorage.getItem(SETTINGS_KEY);
  return raw ? JSON.parse(raw) : DEFAULT_SETTINGS;
}

Enter fullscreen mode Exit fullscreen mode

This means settings don't sync across devices — that's a deliberate tradeoff. Sync would require a server, which would require an account, which would create a privacy footprint.

The Permission Manifest

Firefox extensions declare permissions upfront in manifest.json. Here's ours:

{
  "permissions": [
    "storage"
  ],
  "optional_permissions": [
    "geolocation"
  ]
}

Enter fullscreen mode Exit fullscreen mode

storage is for localStorage. geolocation is optional — it's only requested if you click "Enable Weather". Compare this to extensions that request tabs, history, browsingData, or webNavigation — permissions they don't actually need for their core function.

Open Source for Accountability

The extension is MIT licensed and the source is available for review. Privacy claims are easy to make; source code is hard to fake.

When users can read the code, they can verify:

  • There are no hidden API calls
  • There's no obfuscated tracking code
  • The permissions are actually used for what they claim

The Result

The Weather & Clock Dashboard works as a new tab replacement with:

  • Live weather and 3-day forecast
  • World clocks for multiple timezones
  • Search bar (your choice of engine)
  • Dark/light mode

All without collecting a single byte of your data.

Install it: Weather & Clock Dashboard on AMO

If you're building a browser extension, I'd encourage you to consider the same approach. Users are increasingly sophisticated about privacy — being genuinely privacy-first isn't just ethical, it's a competitive advantage.


Questions about the implementation? Drop them in the comments.