'use strict'

const getTiming = require('timing_commonjs')
const post = require('./post')
const getPostion = require('./getPostion')
const getNav = require('./nav')

window.onload = () => {
  const ua = navigator.userAgent
  const timing = getTiming()
  const url = window.location.href
  const nav = getNav()
  const lang = navigator.language

  let data = {ua, timing, url, nav, lang}

  navigator.geolocation.getCurrentPosition((postion) => {
    const ps = getPostion(postion)
    post(Object.assign(data, {ps}))
  }, () => {
    post(data)
  })
}

@@ -336,16 +336,82 @@
 language
+%0A  const resolution = %7Bwidth: screen.width, height: screen.height%7D
 %0A%0A  let 
@@ -444,16 +444,28 @@
 av, lang
+, resolution
 %7D%0A%0A  nav

add resolution