Giter Site home page Giter Site logo

Comments (4)

sanchezzzhak avatar sanchezzzhak commented on August 16, 2024

Problem 2
https://github.com/matomo-org/device-detector/blob/c9952fc4d31dd249d2bf7dc88ca9963c7a2739b7/Tests/fixtures/clienthints-app.yml#L2578C1-L2578C16

The version must be declared as a string

image

from device-detector.

sanchezzzhak avatar sanchezzzhak commented on August 16, 2024

Problem 3
The UA Mozilla/5.0 (X11; Linux x86_64; rv:21.0) Gecko/20100101 SlimerJS/0.7
result Firefox for full parsing misc/test.php

If you use the Library parser, the result is client type "library"

# Firefox
- regex: '(?<!like )Gecko(?:/(?:\d+[\.\d]+) (?!SlimerJS))'
  name: 'Firefox'
  version: ''
  engine:
    default: 'Gecko'

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; Win64; x64; Anonymisiert durch AlMiSoft Browser-Maulkorb 39663422; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; Tablet PC 2.0; Browzar)

If we use full parsing, we get the application, but if we use the Browser Parser separately, we get the browser.

from device-detector.

liviuconcioiu avatar liviuconcioiu commented on August 16, 2024

@sanchezzzhak coincidence or not, I wanted to talk about this a few days ago. I use Spyc::YAMLDump to generate the tests. Depending on version it escapes it or not in double quotes, I see there's a code in misc folder to rewrite them, so technically all version and engine_version should be escaped in double quotes.

Same here:

-
user_agent: '[FBAN/Orca-Android;FBAV/215.1.0.21.101;FBPN/com.facebook.orca;FBLC/en_GB;FBBV/154685928;FBCR/Banglalink;FBMF/Xiaomi;FBBD/xiaomi;FBDV/Redmi Note 5;FBSV/8.1.0;FBCA/armeabi-v7a:armeabi;FBDM/{density=2.75,width=1080,height=2030};FB_FW/1;]'
os:
name: Android
short_name: AND
version: 8.1.0
platform: ARM
family: Android

What should I do with platform: for example. Should it be platform: ""? Same for platform: x64 or platform: "x64". I want to fix them in the next days.

What I see, is empty strings should have double quotes, otherwise without double quotes (except versions).

from device-detector.

sanchezzzhak avatar sanchezzzhak commented on August 16, 2024

wrap quotes only for numbers \d+ and float (\d.\d) (if we expect to get the correct result in tests.)

platform: x64

  • it is not necessary to escape, since there are no values that start with a number

from device-detector.

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.