-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about accessing chrome APIs correctly #32
Comments
The best solution for this would be to add typing for the chrome api with this package. I'm looking into ways to add it for intellisense to also pick up and use it correctly |
I am also using chrome API (chrome.storage.local). Because this API can only be accessed from the client, I set But when I build the app and unpack it, then open the extension, it shows 404 not found. The console error says If i remove My question is, does this adapter doesn't work for |
HEy @ahanprojects |
Hi! I'm trying to write an extension which accesses the chrome bookmarks API, but I'm having some trouble understanding how to use it correctly in the context of sveltekit. I started from this template repository.
To start with I wanted to just display a
BookmarkTreeNode
, so I editedsrc/routes/+page.svelte
with the following:(here's the docs for chrome.bookmarks.getTree)
This works as expected, displaying this JSON:
The problem comes in when I try to actually access the node. When I edit the html with the following instead:
I get a compile error:
referring to the
bookmarks[0]
in the html. I'm a bit hazy on how sveltekit works, but my intuition says the error is to do with SSR and the bookmarks not being available when the page is being prerendered? Is that right?How do I do this correctly?
The text was updated successfully, but these errors were encountered: