Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Calculator

0

187
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2023 PeakU Inc. All Rights Reserved.