@gumlet/insights-js-core 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bitbucket-pipelines.yml +2 -2
- package/js/core/Analytics.js +7 -0
- package/package.json +1 -1
package/bitbucket-pipelines.yml
CHANGED
|
@@ -31,5 +31,5 @@ pipelines:
|
|
|
31
31
|
- pip
|
|
32
32
|
script:
|
|
33
33
|
- pip install awscli
|
|
34
|
-
- aws s3 cp ./build/release/ s3://gumlet-cdn/insights/1.1/ --cache-control "public, s-maxage=31536000, max-age=172800" --region us-east-1 --recursive --acl public-read
|
|
35
|
-
- curl -X PURGE -H Fastly-Key:$FASTLY_API_TOKEN https://cdn.gumlytics.com/insights/1.1/gumlet-insights.min.js
|
|
34
|
+
- aws s3 cp ./build/release/ s3://gumlet-cdn/insights/1.1.1/ --cache-control "public, s-maxage=31536000, max-age=172800" --region us-east-1 --recursive --acl public-read
|
|
35
|
+
- curl -X PURGE -H Fastly-Key:$FASTLY_API_TOKEN https://cdn.gumlytics.com/insights/1.1.1/gumlet-insights.min.js
|
package/js/core/Analytics.js
CHANGED
|
@@ -1244,6 +1244,13 @@ class Analytics {
|
|
|
1244
1244
|
Object.keys(overrideData).forEach(function(key) {
|
|
1245
1245
|
sampleData[key] = overrideData[key]
|
|
1246
1246
|
})
|
|
1247
|
+
if (typeof window !== "undefined" && typeof window.parent !== "undefined" && window.navigator){
|
|
1248
|
+
window.navigator.getBattery().then(battery => {
|
|
1249
|
+
sampleData.battery_level_percentage = battery.level * 100;
|
|
1250
|
+
sampleData.battery_charging = battery.charging;
|
|
1251
|
+
})
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1247
1254
|
return sampleData;
|
|
1248
1255
|
}
|
|
1249
1256
|
|