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

推荐订阅源

B
Blog RSS Feed
Jina AI
Jina AI
雷峰网
雷峰网
Blog — PlanetScale
Blog — PlanetScale
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
博客园 - 司徒正美
罗磊的独立博客
J
Java Code Geeks
Engineering at Meta
Engineering at Meta
WordPress大学
WordPress大学
Vercel News
Vercel News
A
About on SuperTechFans
I
InfoQ
D
DataBreaches.Net
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
aimingoo的专栏
aimingoo的专栏
宝玉的分享
宝玉的分享
P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
美团技术团队

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
Building a Firefox New Tab Extension: From Idea to AMO Pu...
Weather Cloc · 2026-05-04 · via DEV Community

Building a Firefox New Tab Extension: From Idea to AMO Publishing

Every time you open a new tab in Firefox, there's a missed opportunity. The default page is... fine. But what if it showed you the weather, your world clocks, and a search bar — all without any data leaving your device?

That's what I built with Weather & Clock Dashboard. Here's how the whole thing came together, including the surprising parts of publishing to AMO (addons.mozilla.org).

The manifest.json entry point

A new tab override is deceptively simple:

{
  "manifest_version": 2,
  "name": "Weather & Clock Dashboard",
  "version": "1.0",
  "chrome_url_overrides": {
    "newtab": "newtab.html"
  },
  "permissions": ["storage"]
}

Enter fullscreen mode Exit fullscreen mode

One file override, one permission. That's it.

Fetching weather without a backend

Most weather APIs require server-side secrets. I wanted zero backend — so I used Open-Meteo, which is:

  • Completely free
  • No API key required
  • Accurate 7-day forecasts
  • Open source

The flow: browser gets geolocation → sends lat/lon to Open-Meteo → renders weather data locally. No proxy, no tokens, no secrets.

async function fetchWeather(lat, lon) {
  const url = `https://api.open-meteo.com/v1/forecast?latitude=${lat}&longitude=${lon}&current_weather=true&daily=weathercode,temperature_2m_max,temperature_2m_min&forecast_days=4&timezone=auto`;
  const res = await fetch(url);
  return res.json();
}

Enter fullscreen mode Exit fullscreen mode

World clocks with zero libraries

The Intl API has been in browsers for years and handles everything:

function getTimeInZone(timezone) {
  return new Intl.DateTimeFormat('en-US', {
    hour: '2-digit',
    minute: '2-digit',
    second: '2-digit',
    hour12: true,
    timeZone: timezone
  }).format(new Date());
}

Enter fullscreen mode Exit fullscreen mode

No moment.js. No date-fns. 12 bytes of IANA timezone string and the native API handles DST automatically.

The AMO review process

This surprised me. Mozilla's review is genuine — not just automated scanning.

What they check:

  • All external requests must be documented
  • No eval(), no remote code execution
  • Permissions must be minimal and justified
  • Source must be readable (no obfuscated bundles)

What helped my review pass quickly:

  • Single-file architecture (no build step, no webpack)
  • Only one external domain (open-meteo.com, no auth required)
  • storage permission only — no tabs, no webRequest, no activeTab
  • Clean, commented code

If you're shipping a bundled/minified extension, you'll need to submit source code separately. Plain files skip that entirely.

Dark/light mode

I hooked into prefers-color-scheme so it respects the OS setting automatically, with a manual toggle that persists via browser.storage.local:

const stored = await browser.storage.local.get('theme');
const theme = stored.theme || 
  (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
document.body.setAttribute('data-theme', theme);

Enter fullscreen mode Exit fullscreen mode

What I'd do differently

  1. Manifest v3 from the start — Firefox now supports MV3, and it's where the ecosystem is heading
  2. i18n from day one — Adding _locales/ later is tedious
  3. Start with open-meteo — I initially tried WeatherAPI.com and had to refactor

Try it

Install from AMO: Weather & Clock Dashboard

Source code is MIT licensed. If you're building a browser extension, the "no backend, no API keys" approach is underrated — less complexity, more user trust, and nothing to secure.

Happy to answer questions about the review process or the Open-Meteo integration in the comments.