ua-parser-js icon indicating copy to clipboard operation
ua-parser-js copied to clipboard

Can getResult() use withClientHints() ?

Open drewid opened this issue 8 months ago • 1 comments

Can getResult() use withClientHints() ?

Trying to avoid a duplicate call. Doing a getResult(), and then overlaying the result with the browser information from GetBrowser().withClientHints() seems like it should/could be simpler?

Thanks

drewid avatar Mar 17 '25 00:03 drewid

Hi, there's actually no need to overlay the result as you can directly chain getResult() with withClientHints():

const uap = new UAParser();
const res = await uap.getResult().withClientHints();

faisalman avatar May 02 '25 02:05 faisalman