pmndrs / detect-gpu

Classifies GPUs based on their 3D rendering benchmark score allowing the developer to provide sensible default settings for graphically intensive applications.
MIT License
1.05k stars 57 forks source link

Why is library making network requests? #124

Open erfanmola opened 1 month ago

erfanmola commented 1 month ago

I have noticed that library is fetching the file below: https://unpkg.com/detect-gpu@5.0.52/dist/benchmarks/m-apple-ipad.json

Is there any specific reason for this? the file contains the models and etc, I understand, but is it neccessery if I only need "Tier"? Is there any way to disable this behaviour and make it work completely offline without external requests?

wesbos commented 1 month ago

It would be too much to load all that data on every page - so it only loads the data needed.

As I understand it, the FPS values are stored in these files, so you need that get the tier: https://github.com/pmndrs/detect-gpu/blob/master/src/index.ts#L220

You can host it yourself and pass in the URL