@sailfish-ai/recorder 1.0.2 → 1.0.3
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/dist/deviceInfo.js
CHANGED
|
@@ -4,7 +4,7 @@ export async function gatherAndCacheDeviceInfo() {
|
|
|
4
4
|
// Gather device information asynchronously
|
|
5
5
|
// TODO - Sibyl v3 - get additional information from the device
|
|
6
6
|
// const connection = navigator.connection || {};
|
|
7
|
-
const geolocation = await getGeolocation();
|
|
7
|
+
// const geolocation = await getGeolocation();
|
|
8
8
|
const info = {
|
|
9
9
|
// connection: {
|
|
10
10
|
// downlink: connection.downlink,
|
|
@@ -15,7 +15,7 @@ export async function gatherAndCacheDeviceInfo() {
|
|
|
15
15
|
// deviceMemory: navigator.deviceMemory,
|
|
16
16
|
language: navigator.language,
|
|
17
17
|
userAgent: navigator.userAgent,
|
|
18
|
-
geolocation,
|
|
18
|
+
// geolocation,
|
|
19
19
|
};
|
|
20
20
|
// Immediately add the device info to the event cache
|
|
21
21
|
sendMessage({ type: "deviceInfo", data: { deviceInfo: info } });
|
|
@@ -597,7 +597,7 @@ var ReconnectingWebSocket = (
|
|
|
597
597
|
return ReconnectingWebSocket2;
|
|
598
598
|
}()
|
|
599
599
|
);
|
|
600
|
-
const version = "1.0.
|
|
600
|
+
const version = "1.0.3";
|
|
601
601
|
let webSocket = null;
|
|
602
602
|
const messageQueue = [];
|
|
603
603
|
function flushMessageQueue() {
|
|
@@ -640,7 +640,6 @@ function getWebSocketHost(url) {
|
|
|
640
640
|
return `${parser2.hostname}${parser2.port ? `:${parser2.port}` : ""}`;
|
|
641
641
|
}
|
|
642
642
|
async function gatherAndCacheDeviceInfo() {
|
|
643
|
-
const geolocation = await getGeolocation();
|
|
644
643
|
const info = {
|
|
645
644
|
// connection: {
|
|
646
645
|
// downlink: connection.downlink,
|
|
@@ -650,32 +649,11 @@ async function gatherAndCacheDeviceInfo() {
|
|
|
650
649
|
// },
|
|
651
650
|
// deviceMemory: navigator.deviceMemory,
|
|
652
651
|
language: navigator.language,
|
|
653
|
-
userAgent: navigator.userAgent
|
|
654
|
-
geolocation
|
|
652
|
+
userAgent: navigator.userAgent
|
|
653
|
+
// geolocation,
|
|
655
654
|
};
|
|
656
655
|
sendMessage({ type: "deviceInfo", data: { deviceInfo: info } });
|
|
657
656
|
}
|
|
658
|
-
function getGeolocation() {
|
|
659
|
-
return new Promise((resolve2) => {
|
|
660
|
-
if ("geolocation" in navigator) {
|
|
661
|
-
navigator.geolocation.getCurrentPosition(
|
|
662
|
-
(position) => {
|
|
663
|
-
resolve2({
|
|
664
|
-
latitude: position.coords.latitude,
|
|
665
|
-
longitude: position.coords.longitude
|
|
666
|
-
});
|
|
667
|
-
},
|
|
668
|
-
(error) => {
|
|
669
|
-
console.error("Error getting geolocation:", error);
|
|
670
|
-
resolve2(void 0);
|
|
671
|
-
}
|
|
672
|
-
);
|
|
673
|
-
} else {
|
|
674
|
-
console.warn("Geolocation is not supported by this browser.");
|
|
675
|
-
resolve2(void 0);
|
|
676
|
-
}
|
|
677
|
-
});
|
|
678
|
-
}
|
|
679
657
|
let eventCache = [];
|
|
680
658
|
function cacheEvents(event) {
|
|
681
659
|
eventCache.push(event);
|
|
@@ -601,7 +601,7 @@
|
|
|
601
601
|
return ReconnectingWebSocket2;
|
|
602
602
|
}()
|
|
603
603
|
);
|
|
604
|
-
const version = "1.0.
|
|
604
|
+
const version = "1.0.3";
|
|
605
605
|
let webSocket = null;
|
|
606
606
|
const messageQueue = [];
|
|
607
607
|
function flushMessageQueue() {
|
|
@@ -644,7 +644,6 @@
|
|
|
644
644
|
return `${parser2.hostname}${parser2.port ? `:${parser2.port}` : ""}`;
|
|
645
645
|
}
|
|
646
646
|
async function gatherAndCacheDeviceInfo() {
|
|
647
|
-
const geolocation = await getGeolocation();
|
|
648
647
|
const info = {
|
|
649
648
|
// connection: {
|
|
650
649
|
// downlink: connection.downlink,
|
|
@@ -654,32 +653,11 @@
|
|
|
654
653
|
// },
|
|
655
654
|
// deviceMemory: navigator.deviceMemory,
|
|
656
655
|
language: navigator.language,
|
|
657
|
-
userAgent: navigator.userAgent
|
|
658
|
-
geolocation
|
|
656
|
+
userAgent: navigator.userAgent
|
|
657
|
+
// geolocation,
|
|
659
658
|
};
|
|
660
659
|
sendMessage({ type: "deviceInfo", data: { deviceInfo: info } });
|
|
661
660
|
}
|
|
662
|
-
function getGeolocation() {
|
|
663
|
-
return new Promise((resolve2) => {
|
|
664
|
-
if ("geolocation" in navigator) {
|
|
665
|
-
navigator.geolocation.getCurrentPosition(
|
|
666
|
-
(position) => {
|
|
667
|
-
resolve2({
|
|
668
|
-
latitude: position.coords.latitude,
|
|
669
|
-
longitude: position.coords.longitude
|
|
670
|
-
});
|
|
671
|
-
},
|
|
672
|
-
(error) => {
|
|
673
|
-
console.error("Error getting geolocation:", error);
|
|
674
|
-
resolve2(void 0);
|
|
675
|
-
}
|
|
676
|
-
);
|
|
677
|
-
} else {
|
|
678
|
-
console.warn("Geolocation is not supported by this browser.");
|
|
679
|
-
resolve2(void 0);
|
|
680
|
-
}
|
|
681
|
-
});
|
|
682
|
-
}
|
|
683
661
|
let eventCache = [];
|
|
684
662
|
function cacheEvents(event) {
|
|
685
663
|
eventCache.push(event);
|