Comments (3)
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.
@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.
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)
- WinHTTP user agent HOT 1
- Go-http-client wrong device detect HOT 5
- Universal support? HOT 1
- Externalize list of useragents HOT 1
- getting empty response for get_model()! HOT 1
- AdsBot from Google is detected as "phone" HOT 3
- Bug Fix Reporting and QA Guides? HOT 1
- Error: Cannot find module "../package" HOT 2
- [Bug] Build issues with Angular project (webpack) HOT 5
- Desktop user agent without spaces reported as phone HOT 1
- CloudFront headers HOT 1
- TrendsmapResolver is not detected as a bot
- No iPhone rule HOT 1
- Does Not Declare Dependency `yamlparser` or `request`
- Lack of bingbot detection HOT 1
- Return desktop for Ipad Simulator from XCode HOT 1
- Upgrade minimist
- Googlebot on smartphone classified as "phone" instead of "bot" HOT 4
- wget shows up as a phone
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from device.