dom.Navigator add missing attributes (#15310)

* Add missing attributes and methods to dom.Navigator

* Add missing attributes and methods to dom.Navigator

* Add missing attributes and methods to dom.Navigator
This commit is contained in:
Juan Carlos
2020-09-14 03:58:21 -03:00
committed by GitHub
parent 6c49767a6c
commit a667475aaf
2 changed files with 18 additions and 2 deletions

View File

@@ -162,7 +162,7 @@
- Added `deques.toDeque`, which creates a deque from an openArray. The usage is
similar to procs such as `sets.toHashSet` and `tables.toTable`. Previously,
it was necessary to create an empty deque and add items manually.
- `std/with`, `sugar.dup` now support object field assignment expression:
```nim
import std/with
@@ -185,6 +185,7 @@
- Add `getprotobyname` to `winlean`. Add `getProtoByname` to `nativesockets` which returns a protocol code
from the database that matches the protocol `name`.
- Add missing attributes and methods to `dom.Navigator` like `deviceMemory`, `onLine`, `vibrate()`, etc.
## Language changes

View File

@@ -1245,10 +1245,19 @@ type
appCodeName*: cstring
appName*: cstring
appVersion*: cstring
buildID*: cstring ## https://developer.mozilla.org/en-US/docs/Web/API/Navigator/buildID
cookieEnabled*: bool
deviceMemory*: float ## https://developer.mozilla.org/en-US/docs/Web/API/Navigator/deviceMemory
doNotTrack*: cstring ## https://developer.mozilla.org/en-US/docs/Web/API/Navigator/doNotTrack
language*: cstring
languages*: seq[cstring] ## https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/languages
maxTouchPoints*: cint ## https://developer.mozilla.org/en-US/docs/Web/API/Navigator/maxTouchPoints
onLine*: bool ## https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine/onLine
oscpu*: cstring ## https://developer.mozilla.org/en-US/docs/Web/API/Navigator/oscpu
platform*: cstring
userAgent*: cstring
vendor*: cstring ## https://developer.mozilla.org/en-US/docs/Web/API/Navigator/vendor
webdriver*: bool ## https://developer.mozilla.org/en-US/docs/Web/API/Navigator/webdriver
mimeTypes*: seq[ref MimeType]
Plugin* {.importc.} = object of RootObj
@@ -1328,7 +1337,7 @@ since (1, 3):
composed*: bool
DocumentOrShadowRoot* {.importc.} = object of RootObj
activeElement*: Element
# styleSheets*: StyleSheetList
# styleSheets*: StyleSheetList
ShadowRoot* = ref ShadowRootObj
ShadowRootObj {.importc.} = object of DocumentOrShadowRoot
delegatesFocus*: bool
@@ -1581,6 +1590,12 @@ proc pushState*[T](h: History, stateObject: T, title, url: cstring)
# Navigator "methods"
proc javaEnabled*(h: Navigator): bool
since (1, 3):
proc canShare*(self: Navigator; data: cstring): bool ## https://developer.mozilla.org/en-US/docs/Web/API/Navigator/canShare
proc sendBeacon*(self: Navigator; url, data: cstring): bool ## https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon
proc vibrate*(self: Navigator; pattern: cint): bool ## https://developer.mozilla.org/en-US/docs/Web/API/Navigator/vibrate
proc vibrate*(self: Navigator; pattern: openArray[cint]): bool ## https://developer.mozilla.org/en-US/docs/Web/API/Navigator/vibrate
proc registerProtocolHandler*(self: Navigator; scheme, url, title: cstring) ## https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler
# ClassList "methods"
proc add*(c: ClassList, class: cstring)