Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

191
Vistas
Cannot write to clipboard from service worker in a MV3 chrome extension

I have an existing Chrome Extension with Manifest Version V2. I'm trying to copy page url when user clicks on the extensions icon. I was relying on execCommand('copy') function to copy links before. With Manifest V3, as windows object is no longer accessible from service worker. I'm trying to migrate and use navigator.clipboard.writeText(url). When I trigger the event to copy using clipboard, I hit navigator.clipboard undefined exception.

I'm triggering the events on "https" links, which is considered a secure context.

Does anyone know why clipboard is undefined from service worker even in context of https?

7 months ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos