Open steddyman opened 5 months ago
It might not be what you need and be aware that I'm complete Svelte noob, but I'm using synced storage through Svelte writable store.
You can check my synced writable implementation, initialization and using it in Svelte component (for selectedColor
).
Using browser / .chrome in .svelte files not working
I am trying to user the chrome.storage api within my .svelte files. I have tried using vite-plugin-web-extension along with the polyfill support described here: https://vite-plugin-web-extension.aklinker1.io/guide/supporting-multiple-browsers.html
In my +page.svelte, I am trying to import this library
But when I do, even though all the configuration has been setup correctly, the above code fails with the following error:
This is an existing svelte project, I had written my own webpack configuration for to package and build the extension, and I am now switching to using vite-plugin-web-extension because of the need to access chrome.storage.