Git Product home page Git Product logo

Comments (2)

etienne-martin avatar etienne-martin commented on May 26, 2024

Hi there, I would first check the documentation or ask people over on StackOverflow for help.

Let me know if the documentation could be improved.

from device-detector-js.

yCodeTech avatar yCodeTech commented on May 26, 2024

I vote to reopen this issue. The documentation is a little bit sparse. With only 1 example, albeit a poor example for the user agent detection:

import DeviceDetector from "device-detector-js";

const deviceDetector = new DeviceDetector();
const userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36";
const device = deviceDetector.parse(userAgent);

console.log(device);

Typically, nobody would manually type in a userAgent string like that, it would be done via window.navigator.userAgent or other means (I'm not sure if there are other ways). Also, we shouldn't technically have to feed in the useragent ourselves, this should be detected and handled automatically by the library. However, that's by the by. What the documentation really needs is specifying whether it has any methods or ways to tell us what type of device it is. Like isMobile or isDesktop, or isTablet, just like there is in the php library. There is no reasonable way to deduce that the methods are exactly the same as in the php library.

from device-detector-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.