Comments (7)
Update
if I remove properties, cacheSize and poolSize from the config, Code will run fine.
from device-detection.
Hi There
You should only need to remove poolSize as this is a Pattern only option. Hash Trie does not have a workset pool like Pattern. It's matches consist of Device offsets which are smaller than Pattern worksets. As a result they are calculated on the fly.
Let me know how you get on.
from device-detection.
Thanks for the answer
if add "properties" option back, It will throw "segmentation fault".
from device-detection.
Which version of the data file are you using currently?
from device-detection.
51Degrees-EnterpriseV3.4.trie
from device-detection.
Of course, sorry ignore me.
I have modified the example above with some changes to the configuration. Properties are not stored as an array but as a comma separated string. The keys in the config are also surrounded by quotes.
Try this and let me know what you get back.
Would you also be able to send over the code where you reference the Device Detection module in: DeviceDetection.provider
const fiftyonedegreescoreConfig = {'dataFile' : 'static/51degrees/51Degrees-EnterpriseV3.4.trie',
'properties' : 'HardwareVendor,HardwareModel,HardwareFamily,PriceBand,PlatformName,PlatformVersion,ScreenPixelsHeight,ScreenPixelsWidth,ReleaseMonth,ReleaseYear,DeviceType,HardwareModelVariants'}
const provider = DeviceDetection.provider(fiftyonedegreescoreConfig)
const match = provider.getMatch(ctx.header['user-agent'])
match.close()
from device-detection.
This code work
const fiftyonedegreescoreConfig = {'dataFile' : 'static/51degrees/51Degrees-EnterpriseV3.4.trie',
'properties' : 'HardwareVendor,HardwareModel,HardwareFamily,PriceBand,PlatformName,PlatformVersion,ScreenPixelsHeight,ScreenPixelsWidth,ReleaseMonth,ReleaseYear,DeviceType,HardwareModelVariants'}
const provider = DeviceDetection.provider(fiftyonedegreescoreConfig)
const match = provider.getMatch(ctx.header['user-agent'])
match.close()
BTW we use module this in Koa.js. Can I write provider.getMatch(ctx.request)
like in Express.js?
Thanks a lot
from device-detection.
Related Issues (20)
- Inconsistent results, unable to detect device type. HOT 5
- Node v12 Version Support HOT 3
- Python quit unexpectedly (Mac, fiftyone_degrees_mobile_detector_v3_wrapper) HOT 6
- get DeviceId by ProfileId, get ProfileId by DeviceId HOT 2
- unexpected matched with HashTrieV34 HOT 4
- different PlatformName for Mac OS X, HashTrieV34 HOT 3
- HAProxy support seems to be broken with new htx represenation enabled HOT 1
- wrong matching Chrome 80.x, Edge 80.x (new); 51Degrees-PremiumV3.4.trie HOT 1
- Reload from file mem leak HOT 13
- Get random match of UA by platform and platform version HOT 3
- [Golang] Can't use Trie - error: redefinition of HOT 13
- Can't update submodules HOT 2
- The data file '51Degrees-LiteV4.1.hash' could not be found HOT 1
- Unable to load Database HOT 12
- Bad Detections HOT 3
- Node version must be >= 6.5 and <= 12. HOT 7
- Cross platform support HOT 4
- Error downloading object: 20000 Evidence Records.yml HOT 2
- Error downloading object: 20000 Evidence Records.yml HOT 1
- Build errors HOT 4
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-detection.