You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`defaultUserAgent` option can be used when running `npm run generate`.
99
+
#### `defaultUserAgent`
103
100
104
-
```js
105
-
{
106
-
modules: ['@nuxtjs/device'],
107
-
device: {
108
-
defaultUserAgent:'Mozilla/5.0 (Linux; Android 5.1.1; Nexus 6 Build/LYZ28E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.39 Mobile Safari/537.36'
109
-
}
110
-
}
111
-
```
101
+
Sets the default value for the `user-agent` header (useful when running `npm run generate`).
112
102
113
-
`refreshOnResize` refresh flags when the window resized.(default: false)
103
+
Default: `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.39 Safari/537.36`
114
104
115
-
```js
116
-
{
117
-
modules: ['@nuxtjs/device'],
118
-
device: {
119
-
refreshOnResize:true
120
-
}
121
-
}
122
-
```
105
+
#### `enabled`
106
+
107
+
Enables the module conditionally.
108
+
109
+
Default: `true`
110
+
111
+
> [!WARNING]
112
+
> This option is deprecated. It will be removed in the next major release.
113
+
114
+
#### `refreshOnResize`
115
+
116
+
Refreshes flags on window resize.
123
117
124
-
Note that the default user agent value is set to `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.39 Safari/537.36`.
125
-
## CloudFront Support
118
+
Default: `false`
126
119
127
-
If the `user-agent` is `Amazon CloudFront`, this module checks the following headers :
120
+
> [!WARNING]
121
+
> This option is deprecated. It will be removed in the next major release.
128
122
123
+
## Amazon CloudFront Support
124
+
125
+
If the user agent is `Amazon CloudFront`, the module checks for the following headers:
126
+
127
+
-`CloudFront-Is-Android-Viewer`
128
+
-`CloudFront-Is-Desktop-Viewer`
129
+
-`CloudFront-Is-IOS-Viewer`
129
130
-`CloudFront-Is-Mobile-Viewer`
130
131
-`CloudFront-Is-Tablet-Viewer`
131
-
-`CloudFront-Is-Desktop-Viewer`
132
-
-`CloudFront-Is-Ios-Viewer`
133
-
-`CloudFront-Is-Android-Viewer`
134
-
135
-
Here are the details about the headers:
136
-
[Amazon CloudFront - Headers for determining the viewer's device type
Read more about determining the viewer's device type in the [Amazon CloudFront docs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/adding-cloudfront-headers.html#cloudfront-headers-device-type).
140
134
141
-
`isWindows` and `isMacOS` flags are not available with CloudFront.
135
+
> [!CAUTION]
136
+
> `isWindows` and `isMacOS` flags are not available in Amazon CloudFront.
142
137
143
138
## Cloudflare Support
144
139
145
-
This module checks the header `CF-Device-Type`.
140
+
This module checks for the `CF-Device-Type` header.
Read more about the device type detection in the [Cloudflare docs](https://developers.cloudflare.com/automatic-platform-optimization/reference/cache-device-type).
149
143
150
144
## License
151
145
152
146
[MIT License](./LICENSE)
153
147
154
-
## Data Source
155
-
156
-
This module uses [crawler-user-agents](https://github.com/monperrus/crawler-user-agents) to generate the regular expression that detect a crawler.
0 commit comments