Comments (3)
Thanks for the report @ibdafna. pyodide.http.open_url
relies on XMLHttpRequest
and AFAIK XMLHttpRequest
is not supported in the service worker.
from pyodide.
Hi @ryanking13, thanks for taking a look. Whilst you're technically correct about XHR not being supported in Service Workers, there is a polyfill called xhr-shim
(I mention that in the initial post), and the official Pyodide documentation advises installing that polyfill as a precondition for using Pyodide in a Service Worker. The polyfill does seem to work outside the context of Pyodide, so I'm inclined to believe there's an issue somewhere else.
from pyodide.
Oh, sorry I didn't read your post closely enough.
Could you try using XMLHttpRequest
directly instead of using open_url
and compare the response (content, status code, headers) when running it in main thread without xhr-shim and in the service worker?
You can see the implementation of open_url
here:
pyodide/src/py/pyodide/http.py
Lines 27 to 46 in 3bf1075
from pyodide.
Related Issues (20)
- Stuck on downloading... HOT 1
- Add `igraph` package HOT 4
- Requesting the module "Requests" to be part of pyodide HOT 2
- Add PyRepl to Related Projects
- WebpackIgnore comments disappear when using esbuild instead of rollup HOT 5
- Better performing event loop HOT 4
- Add FFI benchmarks
- RangeError: Array buffer allocation failed HOT 9
- Add check for WASM magic number in .so files
- Pyodide fatal eror when extension module uses a separate shared library. HOT 2
- [email protected] does not work properly in webpack HOT 2
- un/registerJsModule fails various expectations HOT 2
- Provide a loadPyodide({defaultDictConverter: Object.fromEntries}) field. HOT 32
- Package request for pydeseq2 HOT 1
- PyProxy.type may cause conflicts when attempting to get the type attribute of an object during proxying from Python into JavaScript HOT 1
- Add support for dunder methods to call their JS equivalent consistently HOT 8
- Question: Should `toString` use `__repr__` or `__str__`? HOT 5
- Pymongo module for MongoDB database
- Pymongo for MongoDB database
- Pymongo for MongoDB database
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyodide.