Unable to use in service workers in manifest v3
Author: 0xturboblitzCreated Mar 24, 2022Updated May 25, 2025
LabelsbugExtension Issues
Hi, First of all, thanks for your work.
With manifest v3, chrome replaced background scripts with service workers, which cannot access the DOM. I am building a web extension that parses the dom and then analyses the image in the background, quite like nsfw-filter.
I am able to load nsfwjs in the service worker, but any attempt to feed it an image fails because the service worker cannot manipulate anything like images. For instance, any image that I send to the service worker will appear as empty in it.
Is there anything obvious that I am doing wrong, or has someone encountered the same issue ?
Source: infinitered/nsfwjs