2 ms·
The only browser detection possible on the server-side is with the user-agent and other headers, which you already have access to within Workers. You can parse
by manigandham 8y ago
The only browser detection possible on the server-side is with the user-agent and other headers, which you already have access to within Workers. You can parse that string reliably for modern browsers, and have a fallback for the rest.
No big dataset needed, just some regex and if/then statements. If you still want a library then you can try https://github.com/faisalman/ua-parser-js https://github.com/faisalman/ua-parser-js