model/document Cotonic

model/document

The document model can be used to retrieve details about the current document.

get/all

Get all information on the current document. Includes screen size, cookies, user agent details.

self.call("model/document/get/all")
.then(function(m) {
    console.log(m.payload)
});
=> {screen_width: 1280, screen_height: 800,
    inner_width: 1047, inner_height: 292,
    is_touch: false, …}

get/intl

Returns the internationalization details of the current page.

self.call("model/document/get/intl")
.then(function(m) {
    console.log(m.payload)
});
=>  {timezone: {cookie: "", user_agent: "Europe/Amsterdam"},
     language: {cookie: "", user_agent: "en-US", document: null}}

Edit on GitHub