GithubHelp home page GithubHelp logo

Defaults to phone?!? about device HOT 3 CLOSED

rguerreiro avatar rguerreiro commented on May 25, 2024
Defaults to phone?!?

from device.

Comments (3)

Econac avatar Econac commented on May 25, 2024

Well, you can change the defaults. It is no issue per say. But, I consider it annoying default setup at the moment since it seems to me that all latest Chrome, Firefox and Edge on Windows 10 Pro 64 are not being recognised properly - perhaps that is an issue. My solution for this particular problem of mine at the moment is to fork the repo and override the defaultOptions - so if you do not like the default options I recommend you doing the same (fork the repo, rewrite default options for parser and clone it to you project - just do not forget to remove the original module first ...). In my case, I consider such approach as not perspective solution. I would rather see my problem as a bug report prompting bug fix in order to recognise new versions of all major browsers at the major platform. I can only confirm that all works great on latest macOS, iOS and Android ... for some reasons the Win seems to be no win at all ... What is the correct way to submit a bug fix? Is there some QA guide or some predefined QA procedure to follow? Thanks. BTW, the module is great and I am huge fan of it.

from device.

cclerke avatar cclerke commented on May 25, 2024

@Econac You can pass in default options as an argument. For example, var testDevice = device('fgt', {unknownUserAgentDeviceType: 'unknown'});.

Which user agent strings have been causing you problems?

from device.

rguerreiro avatar rguerreiro commented on May 25, 2024

I've tested all 3 user agents from the latest Chrome, Firefox and Edge and all returned desktop.

    describe('85.Chrome 63.0.3239.132 on Win 10 Pro', function () {
        it('should get true', function () {
            var mydevice = device('User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36');
            assert.equal(mydevice.is('desktop'), true);
        });        
    });
    describe('86.Firefox 57.0.4 on Win 10 Pro', function () {
        it('should get true', function () {
            var mydevice = device('User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.48 Safari/537.36');
            assert.equal(mydevice.is('desktop'), true);
        });        
    });
    describe('87.Edge 41.16299.15.0 on Win 10 Pro', function () {
        it('should get true', function () {
            var mydevice = device('User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.48 Safari/537.36');
            assert.equal(mydevice.is('desktop'), true);
        });        
    });

I will be including these tests on a future maintenance release.

I'm closing this for now. Fell free to come back here in case this issue arises

from device.

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.