When developing my application, I have a process in place where I load CSS files on the back-end using Express.JS and then transmit them to the front-end. However, before sending the CSS code to the front-end, I need to:
- Identify the user's browser;
- Make necessary edits to the CSS code based on the browser.
For instance, if a user is using Chrome (User A), I should remove any lines that begin with -webkit-
.
What is the best way for me to detect the user's browser and optimize the editing of the CSS code?
Note: The CSS code I am working with is beautified and not minified.