Crawlers not getting type="crawler" #786
Answered
by
faisalman
stevenvachon
asked this question in
Q&A
|
Am I doing something wrong? I've tried all these: import { UAParser } from 'ua-parser-js';
console.log(
UAParser(
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36 (compatible; Google-Read-Aloud; +https://support.google.com/webmasters/answer/1061943)'
).browser.type
); //-> undefinedimport { Crawlers, UAParser } from 'ua-parser-js';
console.log(
UAParser(
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36 (compatible; Google-Read-Aloud; +https://support.google.com/webmasters/answer/1061943)',
[Crawlers]
).browser.type
); //-> undefinedimport { Crawlers, UAParser } from 'ua-parser-js';
console.log(
UAParser(
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36 (compatible; Google-Read-Aloud; +https://support.google.com/webmasters/answer/1061943)',
Crawlers
).browser.type
); //-> undefined |
Answered by
faisalman
Jun 16, 2025
Replies: 4 comments 2 replies
|
Hi, you must import it from the 'extensions' submodule: import { Crawlers } from 'ua-parser-js/extensions';https://docs.uaparser.dev/api/submodules/extensions/crawlers.html#code-example |
0 replies
|
@faisalman same result, even when using the alternative syntax on that page ( |
0 replies
|
Hello? |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, sorry for the delay, please try this: