<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-mv3-service-workers-made-me-use-an-offscreen-document-just-to-play-a-goat-sound-vz8xbylns" -->

---
title: How MV3 Service Workers Made Me Use an Offscreen...
description: Building a Chrome extension in Manifest V3 that plays a goat sound as a notification alert reveals two key MV3 constraints: service workers have no DOM access...
canonical: https://daily.dev/posts/how-mv3-service-workers-made-me-use-an-offscreen-document-just-to-play-a-goat-sound-vz8xbylns
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How MV3 Service Workers Made Me Use an Offscreen Document Just to Play a Goat Sound | daily.dev
og:description: Building a Chrome extension in Manifest V3 that plays a goat sound as a notification alert reveals two key MV3 constraints: service workers have no DOM access...
og:url: https://daily.dev/posts/how-mv3-service-workers-made-me-use-an-offscreen-document-just-to-play-a-goat-sound-vz8xbylns
og:image: https://api.daily.dev/og/posts/vz8xbYLNS.png
og:image:alt: How MV3 Service Workers Made Me Use an Offscreen Document Just to Play a Goat Sound
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How MV3 Service Workers Made Me Use an Offscreen Document Just to Play a Goat Sound

**[Medium](https://daily.dev/sources/medium_js)** · 4 min read · 0 upvotes · 0 comments

## Summary

Building a Chrome extension in Manifest V3 that plays a goat sound as a notification alert reveals two key MV3 constraints: service workers have no DOM access (so no Audio API), and they don't persist. The solution uses the offscreen document API to create a hidden HTML page that handles audio playback, and chrome.alarms instead of setTimeout to reliably schedule future events that survive service worker termination. The post walks through the code for both patterns with practical explanations of why each workaround is necessary.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/@bilalkhan.192003/how-mv3-service-workers-made-me-use-an-offscreen-document-just-to-play-a-goat-sound-1d2e51ec0ea3>

## Similar posts on daily.dev

- [Building a Google Drive Sync Engine that Survives MV3 Service Workers](https://daily.dev/posts/building-a-google-drive-sync-engine-that-survives-mv3-service-workers-b4arr79bm) · Stack Overflow Blog · 0 upvotes · 0 comments
- [How to Use Transformers.js in a Chrome Extension](https://daily.dev/posts/how-to-use-transformers-js-in-a-chrome-extension-cljxqw6u8) · Hugging Face · 1 upvotes · 0 comments
- [Make a Chrome Extension to Digest Webpages with Manifest V3 and Groq API](https://daily.dev/posts/make-a-chrome-extension-to-digest-webpages-with-manifest-v3-and-groq-api-ve1j1mfbv) · PyImageSearch · 0 upvotes · 0 comments
- [Why are we not using Service Workers?](https://daily.dev/posts/why-are-we-not-using-service-workers--hcr91kshu) · Neciu Dan · 0 upvotes · 0 comments

---

Tags: [#javascript](https://daily.dev/tags/javascript), [#devtools](https://daily.dev/tags/devtools)

[View this post on daily.dev](https://daily.dev/posts/how-mv3-service-workers-made-me-use-an-offscreen-document-just-to-play-a-goat-sound-vz8xbylns)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How MV3 Service Workers Made Me Use an Offscreen Document Just to Play a Goat Sound","url":"https://daily.dev/posts/how-mv3-service-workers-made-me-use-an-offscreen-document-just-to-play-a-goat-sound-vz8xbylns","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-mv3-service-workers-made-me-use-an-offscreen-document-just-to-play-a-goat-sound-vz8xbylns"},"datePublished":"2026-07-24T08:08:48.244Z","dateModified":"2026-07-24T08:17:38.801Z","description":"Building a Chrome extension in Manifest V3 that plays a goat sound as a notification alert reveals two key MV3 constraints: service workers have no DOM access...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5232a5130cd8872e28cbd471415f0223?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5232a5130cd8872e28cbd471415f0223?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-mv3-service-workers-made-me-use-an-offscreen-document-just-to-play-a-goat-sound-vz8xbylns","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"javascript,devtools","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"How MV3 Service Workers Made Me Use an Offscreen Document Just to Play a Goat Sound"}]}
```

