I have a Chrome Extension which I've recently migrated from V2 to V3. I faced numerous challenges because I relied on background pages and had to split the code between an off screen document and a service worker through event-driven communication.
After I figured that out, I published my extension to the store. Mind you that I had no problems during development mode.
Once my Extension was published, whenever I opened the Application that consumed the extension, it got corrupted.
I identified why it was getting corrupted, and it was because inside the extension directory I have a folder called "data", which is used as a point of communication between the external application and the extension.
This folder contains files, and each file contains a websocket port. These files are watched by the extension, and whenever they change, my extension reconnects its web sockets to the appropriate port. This is necessary because ports may change during runtime of the external application. Essentially, the external application knows the directory of the extension and modifies the files inside the "data" folder.
My question is, before I change my whole architecture, is there a way or workaround to allow external applications to modify the extension's directory files? This was possible in V2.