CloudCannon / pagefind

Static low-bandwidth search at scale
https://pagefind.app
MIT License
3.22k stars 97 forks source link

Support search api in webworker #605

Open doompadee opened 2 months ago

doompadee commented 2 months ago

I'm trying to use the search api in a webworker, but this currently fails due to a dependency on the window object.

Would it be feasible to add a way to provide the necessary location origin by other means? I haven't checked the whole code base. Maybe an optional parameter for the init() function would already be sufficient if setting the basePath is a one time operation.