UNPKG

670 BJavaScriptView Raw
1"use strict";
2
3module.exports = function Navigator(userAgent) {
4 const navigator = {};
5 const geolocation = Geolocation();
6
7 Object.defineProperty(navigator, "userAgent", {
8 configurable: false,
9 get: () => {
10 return userAgent || "Tallahassee";
11 },
12 set: (value) => value
13 });
14
15 Object.defineProperty(navigator, "geolocation", {
16 get: () => {
17 return geolocation;
18 },
19 set: (value) => value
20 });
21
22 return navigator;
23};
24
25function Geolocation() {
26 return {
27 getCurrentPosition,
28 watchPosition,
29 clearWatch
30 };
31
32 function getCurrentPosition() {
33 return {};
34 }
35 function watchPosition() {}
36 function clearWatch() {}
37}