From 319144317ac9e39cc1b11ba0242a3ea4fa78863b Mon Sep 17 00:00:00 2001 From: Alexis Hernandez Date: Mon, 17 Jan 2022 13:55:46 -0700 Subject: [PATCH] Scala3 support (#108) --- .../chrome/alarms/bindings/AlarmInfo.scala | 1 + .../window/bindings/BoundsSpecification.scala | 1 + .../window/bindings/CreateWindowOptions.scala | 1 + .../chrome/app/window/bindings/Window.scala | 24 +++---- .../chrome/audio/bindings/Properties.scala | 1 + .../BadgeBackgroundColorDetails.scala | 2 +- .../bindings/BadgeTextDetails.scala | 1 + .../browserAction/bindings/IconDetails.scala | 4 +- .../browserAction/bindings/PopupDetails.scala | 1 + .../browserAction/bindings/TabIdDetails.scala | 1 + .../browserAction/bindings/TitleDetails.scala | 1 + .../downloads/bindings/DownloadOptions.scala | 1 + .../downloads/bindings/FileIconOptions.scala | 3 +- .../chrome/downloads/bindings/Query.scala | 1 + .../chrome/events/EventSourceImplicits.scala | 2 - .../bindings/NotificationOptions.scala | 1 + .../chrome/permissions/Permissions.scala | 2 +- .../permissions/bindings/Permissions.scala | 19 +++--- .../chrome/runtime/bindings/Runtime.scala | 56 ++++++++-------- .../sockets/tcp/bindings/SecureOptions.scala | 1 + .../tcp/bindings/SocketProperties.scala | 1 + .../chrome/sockets/tcp/bindings/TCP.scala | 31 ++++----- .../tcp/bindings/TLSVersionBounds.scala | 1 + .../tcpServer/bindings/SocketProperties.scala | 1 + .../tcpServer/bindings/TCPServer.scala | 22 +++---- .../system/display/bindings/Display.scala | 8 +-- .../display/bindings/DisplayProperties.scala | 1 + .../tabs/bindings/CodeInjectionOptions.scala | 1 + .../chrome/tabs/bindings/ConnectInfo.scala | 1 + .../chrome/tabs/bindings/MessageOptions.scala | 1 + .../chrome/tabs/bindings/MoveProperties.scala | 1 + .../tabs/bindings/ReloadProperties.scala | 1 + .../tabs/bindings/TabCreateProperties.scala | 1 + .../scala/chrome/tabs/bindings/TabQuery.scala | 1 + .../scala/chrome/tabs/bindings/Tabs.scala | 64 +++++++++---------- .../tabs/bindings/UpdateProperties.scala | 1 + .../chrome/tabs/bindings/ZoomSettings.scala | 1 + .../chrome/tts/bindings/SpeakOptions.scala | 1 + .../main/scala/chrome/tts/bindings/TTS.scala | 14 ++-- .../chrome/wallpaper/bindings/Wallpaper.scala | 1 + .../bindings/AllFramesDetails.scala | 11 ++-- .../webNavigation/bindings/FrameDetails.scala | 7 +- .../bindings/GetFrameOptions.scala | 1 + .../bindings/OnBeforeNavigateDetails.scala | 13 ++-- .../bindings/OnCommittedDetails.scala | 11 ++-- .../bindings/OnCompletedDetails.scala | 11 ++-- .../OnCreatedNavigationTargetDetails.scala | 13 ++-- .../bindings/OnDOMContentLoadedDetails.scala | 11 ++-- .../bindings/OnErrorOccurredDetails.scala | 13 ++-- .../bindings/OnTabReplacedDetails.scala | 7 +- .../bindings/WebNavigation.scala | 24 +++---- .../BlockingRequestEventSource.scala | 1 - .../bindings/BlockingResponse.scala | 1 + .../webRequest/bindings/RequestFilter.scala | 1 + .../chrome/windows/bindings/Windows.scala | 12 ++-- build.sbt | 31 ++++++--- shared/src/main/scala/chrome/Manifest.scala | 6 +- 57 files changed, 245 insertions(+), 207 deletions(-) diff --git a/bindings/src/main/scala/chrome/alarms/bindings/AlarmInfo.scala b/bindings/src/main/scala/chrome/alarms/bindings/AlarmInfo.scala index 578db48..31f77ef 100644 --- a/bindings/src/main/scala/chrome/alarms/bindings/AlarmInfo.scala +++ b/bindings/src/main/scala/chrome/alarms/bindings/AlarmInfo.scala @@ -1,6 +1,7 @@ package chrome.alarms.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny object AlarmInfo { diff --git a/bindings/src/main/scala/chrome/app/window/bindings/BoundsSpecification.scala b/bindings/src/main/scala/chrome/app/window/bindings/BoundsSpecification.scala index 651119e..56ce558 100644 --- a/bindings/src/main/scala/chrome/app/window/bindings/BoundsSpecification.scala +++ b/bindings/src/main/scala/chrome/app/window/bindings/BoundsSpecification.scala @@ -1,6 +1,7 @@ package chrome.app.window.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny object BoundsSpecification { diff --git a/bindings/src/main/scala/chrome/app/window/bindings/CreateWindowOptions.scala b/bindings/src/main/scala/chrome/app/window/bindings/CreateWindowOptions.scala index 62559be..ca4f3a0 100644 --- a/bindings/src/main/scala/chrome/app/window/bindings/CreateWindowOptions.scala +++ b/bindings/src/main/scala/chrome/app/window/bindings/CreateWindowOptions.scala @@ -1,6 +1,7 @@ package chrome.app.window.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny object CreateWindowOptions { diff --git a/bindings/src/main/scala/chrome/app/window/bindings/Window.scala b/bindings/src/main/scala/chrome/app/window/bindings/Window.scala index e255491..1b3b566 100644 --- a/bindings/src/main/scala/chrome/app/window/bindings/Window.scala +++ b/bindings/src/main/scala/chrome/app/window/bindings/Window.scala @@ -4,32 +4,32 @@ import chrome.events.bindings.Event import scala.scalajs.js import scala.scalajs.js.annotation.JSGlobal -import scala.scalajs.js.{UndefOr, native, undefined} +import scala.scalajs.js.{UndefOr, undefined} @js.native @JSGlobal("chrome.app.window") object Window extends js.Object { - val onBoundsChanged: Event[js.Function0[_]] = native - val onClosed: Event[js.Function0[_]] = native - val onFullscreened: Event[js.Function0[_]] = native - val onMaximized: Event[js.Function0[_]] = native - val onMinimized: Event[js.Function0[_]] = native - val onRestored: Event[js.Function0[_]] = native + val onBoundsChanged: Event[js.Function0[_]] = js.native + val onClosed: Event[js.Function0[_]] = js.native + val onFullscreened: Event[js.Function0[_]] = js.native + val onMaximized: Event[js.Function0[_]] = js.native + val onMinimized: Event[js.Function0[_]] = js.native + val onRestored: Event[js.Function0[_]] = js.native - def current(): AppWindow = native + def current(): AppWindow = js.native def create( url: String, options: UndefOr[CreateWindowOptions] = undefined, callback: UndefOr[js.Function1[AppWindow, _]] = undefined ): Unit = - native + js.native - def getAll(): js.Array[AppWindow] = native + def getAll(): js.Array[AppWindow] = js.native - def get(id: AppWindow.Id): AppWindow = native + def get(id: AppWindow.Id): AppWindow = js.native - def canSetVisibleOnAllWorkspaces(): Boolean = native + def canSetVisibleOnAllWorkspaces(): Boolean = js.native } diff --git a/bindings/src/main/scala/chrome/audio/bindings/Properties.scala b/bindings/src/main/scala/chrome/audio/bindings/Properties.scala index 01caa46..93a35a7 100644 --- a/bindings/src/main/scala/chrome/audio/bindings/Properties.scala +++ b/bindings/src/main/scala/chrome/audio/bindings/Properties.scala @@ -1,6 +1,7 @@ package chrome.audio.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny object Properties { diff --git a/bindings/src/main/scala/chrome/browserAction/bindings/BadgeBackgroundColorDetails.scala b/bindings/src/main/scala/chrome/browserAction/bindings/BadgeBackgroundColorDetails.scala index 6416472..e512fd3 100644 --- a/bindings/src/main/scala/chrome/browserAction/bindings/BadgeBackgroundColorDetails.scala +++ b/bindings/src/main/scala/chrome/browserAction/bindings/BadgeBackgroundColorDetails.scala @@ -2,7 +2,7 @@ package chrome.browserAction.bindings import scala.scalajs.js import scala.scalajs.js.| -import scala.scalajs.js.|.Evidence +import scala.scalajs.js.|.{Evidence, UnionOps, undefOr2jsAny} @js.native trait BadgeBackgroundColorDetails extends TabIdDetails { diff --git a/bindings/src/main/scala/chrome/browserAction/bindings/BadgeTextDetails.scala b/bindings/src/main/scala/chrome/browserAction/bindings/BadgeTextDetails.scala index 11e0085..c269806 100644 --- a/bindings/src/main/scala/chrome/browserAction/bindings/BadgeTextDetails.scala +++ b/bindings/src/main/scala/chrome/browserAction/bindings/BadgeTextDetails.scala @@ -1,6 +1,7 @@ package chrome.browserAction.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny @js.native trait BadgeTextDetails extends TabIdDetails { diff --git a/bindings/src/main/scala/chrome/browserAction/bindings/IconDetails.scala b/bindings/src/main/scala/chrome/browserAction/bindings/IconDetails.scala index 94cdea0..067caa5 100644 --- a/bindings/src/main/scala/chrome/browserAction/bindings/IconDetails.scala +++ b/bindings/src/main/scala/chrome/browserAction/bindings/IconDetails.scala @@ -4,7 +4,7 @@ import org.scalajs.dom.ImageData import scala.scalajs.js import scala.scalajs.js.| -import scala.scalajs.js.|.Evidence +import scala.scalajs.js.|.{Evidence, UnionOps, undefOr2jsAny} @js.native trait IconDetails extends TabIdDetails { @@ -25,7 +25,7 @@ object IconDetails { ): IconDetails = { // explicitly merge our union types so that dynamic is happy val anyImageData: js.UndefOr[js.Any] = imageData.map(_.merge) - val anyPath: js.UndefOr[js.Any] = path.map(_.merge) + val anyPath: js.UndefOr[js.Any] = path.map(_.asInstanceOf[js.Any]) if (anyImageData.isDefined) { js.Dynamic diff --git a/bindings/src/main/scala/chrome/browserAction/bindings/PopupDetails.scala b/bindings/src/main/scala/chrome/browserAction/bindings/PopupDetails.scala index 5b90054..9c329a7 100644 --- a/bindings/src/main/scala/chrome/browserAction/bindings/PopupDetails.scala +++ b/bindings/src/main/scala/chrome/browserAction/bindings/PopupDetails.scala @@ -1,6 +1,7 @@ package chrome.browserAction.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny @js.native trait PopupDetails extends TabIdDetails { diff --git a/bindings/src/main/scala/chrome/browserAction/bindings/TabIdDetails.scala b/bindings/src/main/scala/chrome/browserAction/bindings/TabIdDetails.scala index 5d0a5b1..e767285 100644 --- a/bindings/src/main/scala/chrome/browserAction/bindings/TabIdDetails.scala +++ b/bindings/src/main/scala/chrome/browserAction/bindings/TabIdDetails.scala @@ -1,6 +1,7 @@ package chrome.browserAction.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny @js.native trait TabIdDetails extends js.Object { diff --git a/bindings/src/main/scala/chrome/browserAction/bindings/TitleDetails.scala b/bindings/src/main/scala/chrome/browserAction/bindings/TitleDetails.scala index f0ed750..4d07532 100644 --- a/bindings/src/main/scala/chrome/browserAction/bindings/TitleDetails.scala +++ b/bindings/src/main/scala/chrome/browserAction/bindings/TitleDetails.scala @@ -1,6 +1,7 @@ package chrome.browserAction.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny @js.native trait TitleDetails extends TabIdDetails { diff --git a/bindings/src/main/scala/chrome/downloads/bindings/DownloadOptions.scala b/bindings/src/main/scala/chrome/downloads/bindings/DownloadOptions.scala index 7f42584..05c582f 100644 --- a/bindings/src/main/scala/chrome/downloads/bindings/DownloadOptions.scala +++ b/bindings/src/main/scala/chrome/downloads/bindings/DownloadOptions.scala @@ -1,6 +1,7 @@ package chrome.downloads.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny @js.native trait DownloadOptions extends js.Object { diff --git a/bindings/src/main/scala/chrome/downloads/bindings/FileIconOptions.scala b/bindings/src/main/scala/chrome/downloads/bindings/FileIconOptions.scala index 217794d..ab14d52 100644 --- a/bindings/src/main/scala/chrome/downloads/bindings/FileIconOptions.scala +++ b/bindings/src/main/scala/chrome/downloads/bindings/FileIconOptions.scala @@ -1,6 +1,7 @@ package chrome.downloads.bindings -import scalajs.js +import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny @js.native trait FileIconOptions extends js.Object { diff --git a/bindings/src/main/scala/chrome/downloads/bindings/Query.scala b/bindings/src/main/scala/chrome/downloads/bindings/Query.scala index 4fe60bf..5a83595 100644 --- a/bindings/src/main/scala/chrome/downloads/bindings/Query.scala +++ b/bindings/src/main/scala/chrome/downloads/bindings/Query.scala @@ -1,6 +1,7 @@ package chrome.downloads.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny @js.native trait Query extends js.Object { diff --git a/bindings/src/main/scala/chrome/events/EventSourceImplicits.scala b/bindings/src/main/scala/chrome/events/EventSourceImplicits.scala index fd04a6f..0b1f082 100644 --- a/bindings/src/main/scala/chrome/events/EventSourceImplicits.scala +++ b/bindings/src/main/scala/chrome/events/EventSourceImplicits.scala @@ -84,8 +84,6 @@ class EventSource3Impl[A, B, C](event: Event[js.Function3[A, B, C, _]]) extends object EventSourceImplicits { - import scala.language.implicitConversions - implicit def eventAsEventSource0(event: Event[js.Function0[_]]): EventSource[Unit] = new EventSource0Impl(event) diff --git a/bindings/src/main/scala/chrome/notifications/bindings/NotificationOptions.scala b/bindings/src/main/scala/chrome/notifications/bindings/NotificationOptions.scala index 3f3ec4a..cc637bf 100644 --- a/bindings/src/main/scala/chrome/notifications/bindings/NotificationOptions.scala +++ b/bindings/src/main/scala/chrome/notifications/bindings/NotificationOptions.scala @@ -1,6 +1,7 @@ package chrome.notifications.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny @js.native trait NotificationOptions extends js.Object { diff --git a/bindings/src/main/scala/chrome/permissions/Permissions.scala b/bindings/src/main/scala/chrome/permissions/Permissions.scala index 1121112..a8bf3bd 100644 --- a/bindings/src/main/scala/chrome/permissions/Permissions.scala +++ b/bindings/src/main/scala/chrome/permissions/Permissions.scala @@ -2,8 +2,8 @@ package chrome.permissions import chrome.events.EventSource import chrome.events.EventSourceImplicits._ +import chrome.permissions.Permission.{API, Host} import chrome.permissions.bindings._ -import chrome.permissions.Permission.{Host, API} import chrome.utils.ErrorHandling._ import scala.concurrent.{Future, Promise} diff --git a/bindings/src/main/scala/chrome/permissions/bindings/Permissions.scala b/bindings/src/main/scala/chrome/permissions/bindings/Permissions.scala index a9b7187..7bb79ac 100644 --- a/bindings/src/main/scala/chrome/permissions/bindings/Permissions.scala +++ b/bindings/src/main/scala/chrome/permissions/bindings/Permissions.scala @@ -4,32 +4,33 @@ import chrome.events.bindings.Event import scala.scalajs.js import scala.scalajs.js.annotation.JSGlobal -import scala.scalajs.js.{UndefOr, native, undefined} +import scala.scalajs.js.{UndefOr, undefined} +import scala.scalajs.js.|.undefOr2jsAny @js.native @JSGlobal("chrome.permissions") object Permissions extends js.Object { - val onAdded: Event[js.Function1[PermissionList, _]] = native - val onRemoved: Event[js.Function1[PermissionList, _]] = native + val onAdded: Event[js.Function1[PermissionList, _]] = js.native + val onRemoved: Event[js.Function1[PermissionList, _]] = js.native - def getAll(callback: js.Function1[PermissionList, _]): Unit = native + def getAll(callback: js.Function1[PermissionList, _]): Unit = js.native - def contains(permissions: PermissionList, callback: js.Function1[Boolean, _]): Unit = native + def contains(permissions: PermissionList, callback: js.Function1[Boolean, _]): Unit = js.native def request(permissions: PermissionList, callback: UndefOr[js.Function1[Boolean, _]] = undefined): Unit = - native + js.native def remove(permissions: PermissionList, callback: UndefOr[js.Function1[Boolean, _]] = undefined): Unit = - native + js.native } @js.native trait PermissionList extends js.Object { - var permissions: UndefOr[js.Array[String]] = native - var origins: UndefOr[js.Array[String]] = native + var permissions: UndefOr[js.Array[String]] = js.native + var origins: UndefOr[js.Array[String]] = js.native } diff --git a/bindings/src/main/scala/chrome/runtime/bindings/Runtime.scala b/bindings/src/main/scala/chrome/runtime/bindings/Runtime.scala index fc7c464..f61b584 100644 --- a/bindings/src/main/scala/chrome/runtime/bindings/Runtime.scala +++ b/bindings/src/main/scala/chrome/runtime/bindings/Runtime.scala @@ -5,7 +5,7 @@ import org.scalajs.dom.Window import scala.scalajs.js import scala.scalajs.js.annotation.JSGlobal -import scala.scalajs.js.{UndefOr, native, undefined} +import scala.scalajs.js.{UndefOr, undefined} @JSGlobal("chrome.runtime") @js.native @@ -13,61 +13,61 @@ object Runtime extends js.Object { type AppID = String - val id: AppID = native - val onStartup: Event[js.Function0[_]] = native - val onInstalled: Event[js.Function1[OnInstalledDetails, _]] = native - val onSuspend: Event[js.Function0[_]] = native - val onSuspendCanceled: Event[js.Function0[_]] = native + val id: AppID = js.native + val onStartup: Event[js.Function0[_]] = js.native + val onInstalled: Event[js.Function1[OnInstalledDetails, _]] = js.native + val onSuspend: Event[js.Function0[_]] = js.native + val onSuspendCanceled: Event[js.Function0[_]] = js.native val onUpdateAvailable: Event[js.Function1[OnUpdateAvailableDetails, _]] = - native - val onBrowserUpdateAvailable: Event[js.Function0[_]] = native - val onConnect: Event[js.Function1[Port, _]] = native - val onConnectExternal: Event[js.Function1[Port, _]] = native - val onMessage: Event[js.Function3[UndefOr[Any], MessageSender, js.Function1[Any, _], Boolean]] = native - val onMessageExternal: Event[js.Function3[UndefOr[Any], MessageSender, js.Function1[Any, _], Boolean]] = native + js.native + val onBrowserUpdateAvailable: Event[js.Function0[_]] = js.native + val onConnect: Event[js.Function1[Port, _]] = js.native + val onConnectExternal: Event[js.Function1[Port, _]] = js.native + val onMessage: Event[js.Function3[UndefOr[Any], MessageSender, js.Function1[Any, _], Boolean]] = js.native + val onMessageExternal: Event[js.Function3[UndefOr[Any], MessageSender, js.Function1[Any, _], Boolean]] = js.native val onRestartRequired: Event[js.Function1[RestartReasons.RestartReason, _]] = - native + js.native - def lastError: UndefOr[Error] = native + def lastError: UndefOr[Error] = js.native - def getBackgroundPage(callback: js.Function1[Window, _]): Unit = native + def getBackgroundPage(callback: js.Function1[Window, _]): Unit = js.native - def reload(): Unit = native + def reload(): Unit = js.native - def restart(): Unit = native + def restart(): Unit = js.native - def getManifest(): Manifest = native + def getManifest(): Manifest = js.native def openOptionsPage(callback: js.UndefOr[js.Function0[_]]): Unit = js.native - def getURL(path: String): String = native + def getURL(path: String): String = js.native - def setUninstallURL(url: String): Unit = native + def setUninstallURL(url: String): Unit = js.native - def requestUpdateCheck(callback: js.Function2[UpdateCheck.Status, UndefOr[UpdateCheck.Details], _]): Unit = native + def requestUpdateCheck(callback: js.Function2[UpdateCheck.Status, UndefOr[UpdateCheck.Details], _]): Unit = js.native - def connect(extensionId: UndefOr[AppID] = undefined, connectInfo: UndefOr[ConnectInfo] = undefined): Port = native + def connect(extensionId: UndefOr[AppID] = undefined, connectInfo: UndefOr[ConnectInfo] = undefined): Port = js.native - def connectNative(application: String): Port = native + def connectNative(application: String): Port = js.native def sendMessage( extensionId: UndefOr[AppID] = undefined, message: js.Any, options: UndefOr[SendMessageOptions] = undefined, responseCallback: UndefOr[js.Function1[js.Object, _]] = js.undefined - ): Unit = native + ): Unit = js.native def sendNativeMessage( application: String, message: js.Object, responseCallback: UndefOr[js.Function1[js.Object, _]] - ): Unit = native + ): Unit = js.native - def getPlatformInfo(callback: js.Function1[PlatformInfo, _]): Unit = native + def getPlatformInfo(callback: js.Function1[PlatformInfo, _]): Unit = js.native - def getPackageDirectoryEntry(callback: js.Function1[DirectoryEntry, _]): Unit = native + def getPackageDirectoryEntry(callback: js.Function1[DirectoryEntry, _]): Unit = js.native } @@ -82,7 +82,7 @@ object UpdateCheck { @js.native trait Details extends js.Object { - val version: String = native + val version: String = js.native } diff --git a/bindings/src/main/scala/chrome/sockets/tcp/bindings/SecureOptions.scala b/bindings/src/main/scala/chrome/sockets/tcp/bindings/SecureOptions.scala index bc13811..d3c172e 100644 --- a/bindings/src/main/scala/chrome/sockets/tcp/bindings/SecureOptions.scala +++ b/bindings/src/main/scala/chrome/sockets/tcp/bindings/SecureOptions.scala @@ -1,6 +1,7 @@ package chrome.sockets.tcp.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny @js.native trait SecureOptions extends js.Object { diff --git a/bindings/src/main/scala/chrome/sockets/tcp/bindings/SocketProperties.scala b/bindings/src/main/scala/chrome/sockets/tcp/bindings/SocketProperties.scala index 068a68e..2b95737 100644 --- a/bindings/src/main/scala/chrome/sockets/tcp/bindings/SocketProperties.scala +++ b/bindings/src/main/scala/chrome/sockets/tcp/bindings/SocketProperties.scala @@ -1,6 +1,7 @@ package chrome.sockets.tcp.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny @js.native trait SocketProperties extends js.Object { diff --git a/bindings/src/main/scala/chrome/sockets/tcp/bindings/TCP.scala b/bindings/src/main/scala/chrome/sockets/tcp/bindings/TCP.scala index 526726b..0ef4022 100644 --- a/bindings/src/main/scala/chrome/sockets/tcp/bindings/TCP.scala +++ b/bindings/src/main/scala/chrome/sockets/tcp/bindings/TCP.scala @@ -5,44 +5,45 @@ import chrome.events.bindings.Event import scala.scalajs.js import scala.scalajs.js.annotation.JSGlobal import scala.scalajs.js.typedarray.ArrayBuffer -import scala.scalajs.js.{UndefOr, native, undefined} +import scala.scalajs.js.{UndefOr, undefined} @js.native @JSGlobal("chrome.sockets.tcp") object TCP extends js.Object { - val onReceive: Event[js.Function1[ReceiveEvent, _]] = native - val onReceiveError: Event[js.Function1[ReceiveErrorEvent, _]] = native + val onReceive: Event[js.Function1[ReceiveEvent, _]] = js.native + val onReceiveError: Event[js.Function1[ReceiveErrorEvent, _]] = js.native - def create(properties: UndefOr[SocketProperties] = undefined, callback: js.Function1[CreateInfo, _]): Unit = native + def create(properties: UndefOr[SocketProperties] = undefined, callback: js.Function1[CreateInfo, _]): Unit = js.native def update(socketId: SocketId, properties: SocketProperties, callback: UndefOr[js.Function0[_]] = undefined): Unit = - native + js.native - def setPaused(socketId: SocketId, paused: Boolean, callback: UndefOr[js.Function0[_]] = undefined): Unit = native + def setPaused(socketId: SocketId, paused: Boolean, callback: UndefOr[js.Function0[_]] = undefined): Unit = js.native def setKeepAlive( socketId: SocketId, enable: Boolean, delay: UndefOr[Int] = undefined, callback: js.Function1[Int, _] - ): Unit = native + ): Unit = js.native - def setNoDelay(socketId: SocketId, noDelay: Boolean, callback: js.Function1[Int, _]): Unit = native + def setNoDelay(socketId: SocketId, noDelay: Boolean, callback: js.Function1[Int, _]): Unit = js.native - def connect(socketId: SocketId, peerAddress: String, peerPort: Int, callback: js.Function1[Int, _]): Unit = native + def connect(socketId: SocketId, peerAddress: String, peerPort: Int, callback: js.Function1[Int, _]): Unit = js.native - def disconnect(socketId: SocketId, callback: UndefOr[js.Function0[_]] = undefined): Unit = native + def disconnect(socketId: SocketId, callback: UndefOr[js.Function0[_]] = undefined): Unit = js.native - def secure(socketId: SocketId, options: UndefOr[SecureOptions] = undefined, callback: js.Function0[_]): Unit = native + def secure(socketId: SocketId, options: UndefOr[SecureOptions] = undefined, callback: js.Function0[_]): Unit = + js.native - def send(socketId: SocketId, data: ArrayBuffer, callback: js.Function1[SendInfo, _]): Unit = native + def send(socketId: SocketId, data: ArrayBuffer, callback: js.Function1[SendInfo, _]): Unit = js.native - def close(socketId: SocketId, callback: js.Function0[_]): Unit = native + def close(socketId: SocketId, callback: js.Function0[_]): Unit = js.native - def getInfo(socketId: SocketId, callback: js.Function1[SocketInfo, _]): Unit = native + def getInfo(socketId: SocketId, callback: js.Function1[SocketInfo, _]): Unit = js.native def getSockets(callback: js.Function1[js.Array[SocketInfo], _]): Unit = - native + js.native } diff --git a/bindings/src/main/scala/chrome/sockets/tcp/bindings/TLSVersionBounds.scala b/bindings/src/main/scala/chrome/sockets/tcp/bindings/TLSVersionBounds.scala index 0fca3cf..8bd2901 100644 --- a/bindings/src/main/scala/chrome/sockets/tcp/bindings/TLSVersionBounds.scala +++ b/bindings/src/main/scala/chrome/sockets/tcp/bindings/TLSVersionBounds.scala @@ -1,6 +1,7 @@ package chrome.sockets.tcp.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny @js.native trait TLSVersionBounds extends js.Object { diff --git a/bindings/src/main/scala/chrome/sockets/tcpServer/bindings/SocketProperties.scala b/bindings/src/main/scala/chrome/sockets/tcpServer/bindings/SocketProperties.scala index 6f85e07..7035ae0 100644 --- a/bindings/src/main/scala/chrome/sockets/tcpServer/bindings/SocketProperties.scala +++ b/bindings/src/main/scala/chrome/sockets/tcpServer/bindings/SocketProperties.scala @@ -1,6 +1,7 @@ package chrome.sockets.tcpServer.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny @js.native trait SocketProperties extends js.Object { diff --git a/bindings/src/main/scala/chrome/sockets/tcpServer/bindings/TCPServer.scala b/bindings/src/main/scala/chrome/sockets/tcpServer/bindings/TCPServer.scala index bbad887..7dc8726 100644 --- a/bindings/src/main/scala/chrome/sockets/tcpServer/bindings/TCPServer.scala +++ b/bindings/src/main/scala/chrome/sockets/tcpServer/bindings/TCPServer.scala @@ -4,21 +4,21 @@ import chrome.events.bindings.Event import scala.scalajs.js import scala.scalajs.js.annotation.JSGlobal -import scala.scalajs.js.{UndefOr, native, undefined} +import scala.scalajs.js.{UndefOr, undefined} @js.native @JSGlobal("chrome.sockets.tcpServer") object TCPServer extends js.Object { - val onAccept: Event[js.Function1[AcceptEvent, _]] = native - val onAcceptError: Event[js.Function1[AcceptErrorEvent, _]] = native + val onAccept: Event[js.Function1[AcceptEvent, _]] = js.native + val onAcceptError: Event[js.Function1[AcceptErrorEvent, _]] = js.native - def create(properties: UndefOr[SocketProperties] = undefined, callback: js.Function1[CreateInfo, _]): Unit = native + def create(properties: UndefOr[SocketProperties] = undefined, callback: js.Function1[CreateInfo, _]): Unit = js.native def update(socketId: SocketId, properties: SocketProperties, callback: UndefOr[js.Function0[_]] = undefined): Unit = - native + js.native - def setPaused(socketId: SocketId, paused: Boolean, callback: UndefOr[js.Function0[_]] = undefined): Unit = native + def setPaused(socketId: SocketId, paused: Boolean, callback: UndefOr[js.Function0[_]] = undefined): Unit = js.native def listen( socketId: SocketId, @@ -26,15 +26,15 @@ object TCPServer extends js.Object { port: Int, backlog: UndefOr[Int] = undefined, callback: js.Function1[Int, _] - ): Unit = native + ): Unit = js.native - def disconnect(socketId: SocketId, callback: UndefOr[js.Function0[_]] = undefined): Unit = native + def disconnect(socketId: SocketId, callback: UndefOr[js.Function0[_]] = undefined): Unit = js.native - def close(socketId: SocketId, callback: UndefOr[js.Function0[_]] = undefined): Unit = native + def close(socketId: SocketId, callback: UndefOr[js.Function0[_]] = undefined): Unit = js.native - def getInfo(socketId: SocketId, callback: js.Function1[SocketInfo, _]): Unit = native + def getInfo(socketId: SocketId, callback: js.Function1[SocketInfo, _]): Unit = js.native def getSockets(callback: js.Function1[js.Array[SocketInfo], _]): Unit = - native + js.native } diff --git a/bindings/src/main/scala/chrome/system/display/bindings/Display.scala b/bindings/src/main/scala/chrome/system/display/bindings/Display.scala index 69fa6e9..dff0161 100644 --- a/bindings/src/main/scala/chrome/system/display/bindings/Display.scala +++ b/bindings/src/main/scala/chrome/system/display/bindings/Display.scala @@ -4,18 +4,18 @@ import chrome.events.bindings.Event import scala.scalajs.js import scala.scalajs.js.annotation.JSGlobal -import scala.scalajs.js.{UndefOr, native, undefined} +import scala.scalajs.js.{UndefOr, undefined} @js.native @JSGlobal("chrome.system.display") object Display extends js.Object { type ID = String - val onDisplayChanged: Event[js.Function0[_]] = native + val onDisplayChanged: Event[js.Function0[_]] = js.native - def getInfo(callback: js.Function1[js.Array[DisplayInfo], _]): Unit = native + def getInfo(callback: js.Function1[js.Array[DisplayInfo], _]): Unit = js.native def setDisplayProperties(id: ID, info: DisplayProperties, callback: UndefOr[js.Function0[_]] = undefined): Unit = - native + js.native } diff --git a/bindings/src/main/scala/chrome/system/display/bindings/DisplayProperties.scala b/bindings/src/main/scala/chrome/system/display/bindings/DisplayProperties.scala index 84b8b8c..5b75ed0 100644 --- a/bindings/src/main/scala/chrome/system/display/bindings/DisplayProperties.scala +++ b/bindings/src/main/scala/chrome/system/display/bindings/DisplayProperties.scala @@ -1,6 +1,7 @@ package chrome.system.display.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny object DisplayProperties { diff --git a/bindings/src/main/scala/chrome/tabs/bindings/CodeInjectionOptions.scala b/bindings/src/main/scala/chrome/tabs/bindings/CodeInjectionOptions.scala index 60662c5..582177b 100644 --- a/bindings/src/main/scala/chrome/tabs/bindings/CodeInjectionOptions.scala +++ b/bindings/src/main/scala/chrome/tabs/bindings/CodeInjectionOptions.scala @@ -1,6 +1,7 @@ package chrome.tabs.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny object CodeInjectionOptions { diff --git a/bindings/src/main/scala/chrome/tabs/bindings/ConnectInfo.scala b/bindings/src/main/scala/chrome/tabs/bindings/ConnectInfo.scala index 3c35bd7..d8d9570 100644 --- a/bindings/src/main/scala/chrome/tabs/bindings/ConnectInfo.scala +++ b/bindings/src/main/scala/chrome/tabs/bindings/ConnectInfo.scala @@ -1,6 +1,7 @@ package chrome.tabs.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny object ConnectInfo { diff --git a/bindings/src/main/scala/chrome/tabs/bindings/MessageOptions.scala b/bindings/src/main/scala/chrome/tabs/bindings/MessageOptions.scala index 086366e..6332b2e 100644 --- a/bindings/src/main/scala/chrome/tabs/bindings/MessageOptions.scala +++ b/bindings/src/main/scala/chrome/tabs/bindings/MessageOptions.scala @@ -1,6 +1,7 @@ package chrome.tabs.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny object MessageOptions { diff --git a/bindings/src/main/scala/chrome/tabs/bindings/MoveProperties.scala b/bindings/src/main/scala/chrome/tabs/bindings/MoveProperties.scala index 6d612d2..985f059 100644 --- a/bindings/src/main/scala/chrome/tabs/bindings/MoveProperties.scala +++ b/bindings/src/main/scala/chrome/tabs/bindings/MoveProperties.scala @@ -3,6 +3,7 @@ package chrome.tabs.bindings import chrome.windows.bindings.Window import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny object MoveProperties { diff --git a/bindings/src/main/scala/chrome/tabs/bindings/ReloadProperties.scala b/bindings/src/main/scala/chrome/tabs/bindings/ReloadProperties.scala index b1c2739..a405f66 100644 --- a/bindings/src/main/scala/chrome/tabs/bindings/ReloadProperties.scala +++ b/bindings/src/main/scala/chrome/tabs/bindings/ReloadProperties.scala @@ -1,6 +1,7 @@ package chrome.tabs.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny @js.native trait ReloadProperties extends js.Object { diff --git a/bindings/src/main/scala/chrome/tabs/bindings/TabCreateProperties.scala b/bindings/src/main/scala/chrome/tabs/bindings/TabCreateProperties.scala index a475e28..ae742ed 100644 --- a/bindings/src/main/scala/chrome/tabs/bindings/TabCreateProperties.scala +++ b/bindings/src/main/scala/chrome/tabs/bindings/TabCreateProperties.scala @@ -3,6 +3,7 @@ package chrome.tabs.bindings import chrome.windows.bindings.Window import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny object TabCreateProperties { diff --git a/bindings/src/main/scala/chrome/tabs/bindings/TabQuery.scala b/bindings/src/main/scala/chrome/tabs/bindings/TabQuery.scala index 133eda4..fcf2db6 100644 --- a/bindings/src/main/scala/chrome/tabs/bindings/TabQuery.scala +++ b/bindings/src/main/scala/chrome/tabs/bindings/TabQuery.scala @@ -3,6 +3,7 @@ package chrome.tabs.bindings import chrome.windows.bindings.Window import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny @js.native trait TabQuery extends js.Object { diff --git a/bindings/src/main/scala/chrome/tabs/bindings/Tabs.scala b/bindings/src/main/scala/chrome/tabs/bindings/Tabs.scala index e00147e..f37bf34 100644 --- a/bindings/src/main/scala/chrome/tabs/bindings/Tabs.scala +++ b/bindings/src/main/scala/chrome/tabs/bindings/Tabs.scala @@ -6,104 +6,104 @@ import chrome.windows.bindings.Window import scala.scalajs.js import scala.scalajs.js.annotation.JSGlobal -import scala.scalajs.js.{UndefOr, `|`, native, undefined} +import scala.scalajs.js.{UndefOr, `|`, undefined} @JSGlobal("chrome.tabs") @js.native object Tabs extends js.Object { - val onCreated: Event[js.Function1[Tab, _]] = native - val onUpdated: Event[js.Function3[Tab.Id, ChangeInfo, Tab, _]] = native - val onMoved: Event[js.Function2[Tab.Id, MoveInfo, _]] = native - val onActivated: Event[js.Function1[ActiveInfo, _]] = native - val onHighlighted: Event[js.Function1[HighlightInfo, _]] = native - val onDetached: Event[js.Function2[Tab.Id, DetachInfo, _]] = native - val onAttached: Event[js.Function2[Tab.Id, AttachInfo, _]] = native - val onRemoved: Event[js.Function2[Tab.Id, RemoveInfo, _]] = native - val onReplaced: Event[js.Function2[Tab.Id, Tab.Id, _]] = native - val onZoomChange: Event[js.Function1[ZoomChangeInfo, _]] = native + val onCreated: Event[js.Function1[Tab, _]] = js.native + val onUpdated: Event[js.Function3[Tab.Id, ChangeInfo, Tab, _]] = js.native + val onMoved: Event[js.Function2[Tab.Id, MoveInfo, _]] = js.native + val onActivated: Event[js.Function1[ActiveInfo, _]] = js.native + val onHighlighted: Event[js.Function1[HighlightInfo, _]] = js.native + val onDetached: Event[js.Function2[Tab.Id, DetachInfo, _]] = js.native + val onAttached: Event[js.Function2[Tab.Id, AttachInfo, _]] = js.native + val onRemoved: Event[js.Function2[Tab.Id, RemoveInfo, _]] = js.native + val onReplaced: Event[js.Function2[Tab.Id, Tab.Id, _]] = js.native + val onZoomChange: Event[js.Function1[ZoomChangeInfo, _]] = js.native - def get(tabId: Tab.Id, callback: js.Function1[Tab, _]): Unit = native + def get(tabId: Tab.Id, callback: js.Function1[Tab, _]): Unit = js.native - def getCurrent(callback: js.Function1[Tab, _]): Unit = native + def getCurrent(callback: js.Function1[Tab, _]): Unit = js.native - def connect(tabId: Tab.Id, connectInfo: UndefOr[ConnectInfo] = undefined): Port = native + def connect(tabId: Tab.Id, connectInfo: UndefOr[ConnectInfo] = undefined): Port = js.native def sendRequest( tabId: Tab.Id, request: js.Any, responseCallback: UndefOr[js.Function1[js.Any, _]] = undefined - ): Unit = native + ): Unit = js.native def sendMessage( tabId: Tab.Id, message: js.Any, options: UndefOr[MessageOptions] = undefined, responseCallback: UndefOr[js.Function1[js.Any, _]] = undefined - ): Unit = native + ): Unit = js.native def create(createProperties: TabCreateProperties, callback: UndefOr[js.Function1[Tab, _]] = undefined): Unit = - native + js.native def duplicate(tabId: Tab.Id, callback: UndefOr[js.Function1[UndefOr[Tab], _]] = undefined): Unit = - native + js.native - def query(queryInfo: TabQuery, callback: js.Function1[js.Array[Tab], _]): Unit = native + def query(queryInfo: TabQuery, callback: js.Function1[js.Array[Tab], _]): Unit = js.native - def highlight(highlightInfo: HighlightInfo, callback: js.Function1[Window, _]): Unit = native + def highlight(highlightInfo: HighlightInfo, callback: js.Function1[Window, _]): Unit = js.native def update( tabId: UndefOr[Tab.Id] = undefined, updateProperties: UpdateProperties, callback: UndefOr[js.Function1[UndefOr[Tab], _]] = undefined ): Unit = - native + js.native def move( tabIds: js.Any, moveProperties: MoveProperties, callback: UndefOr[js.Function1[Tab | js.Array[Tab], _]] = undefined - ): Unit = native + ): Unit = js.native def reload( tabId: UndefOr[Tab.Id] = undefined, reloadProperties: ReloadProperties, callback: UndefOr[js.Function0[_]] = undefined - ): Unit = native + ): Unit = js.native - def remove(tabIds: js.Any, callback: UndefOr[js.Function0[_]] = undefined): Unit = native + def remove(tabIds: js.Any, callback: UndefOr[js.Function0[_]] = undefined): Unit = js.native - def detectLanguage(tabId: UndefOr[Tab.Id] = undefined, callback: js.Function1[String, _]): Unit = native + def detectLanguage(tabId: UndefOr[Tab.Id] = undefined, callback: js.Function1[String, _]): Unit = js.native def captureVisibleTab( windowId: UndefOr[Window.Id] = undefined, options: UndefOr[CaptureOptions] = undefined, callback: UndefOr[js.Function1[String, _]] = undefined - ): Unit = native + ): Unit = js.native def executeScript( tabId: UndefOr[Tab.Id] = undefined, details: CodeInjectionOptions, callback: UndefOr[js.Function1[UndefOr[js.Array[js.Any]], _]] = undefined - ): Unit = native + ): Unit = js.native def insertCSS( tabId: UndefOr[Tab.Id] = undefined, details: CodeInjectionOptions, callback: UndefOr[js.Function0[_]] = undefined - ): Unit = native + ): Unit = js.native def setZoom( tabId: UndefOr[Tab.Id] = undefined, zoomFactor: Double, callback: UndefOr[js.Function0[_]] = undefined - ): Unit = native + ): Unit = js.native - def getZoom(tabId: UndefOr[Tab.Id] = undefined, callback: js.Function1[Double, _]): Unit = native + def getZoom(tabId: UndefOr[Tab.Id] = undefined, callback: js.Function1[Double, _]): Unit = js.native def setZoomSettings(tabId: UndefOr[Tab.Id] = undefined, zoomSettings: ZoomSettings, callback: js.Function0[_]): Unit = - native + js.native - def getZoomSettings(tabId: UndefOr[Tab.Id] = undefined, callback: js.Function1[ZoomSettings, _]): Unit = native + def getZoomSettings(tabId: UndefOr[Tab.Id] = undefined, callback: js.Function1[ZoomSettings, _]): Unit = js.native } diff --git a/bindings/src/main/scala/chrome/tabs/bindings/UpdateProperties.scala b/bindings/src/main/scala/chrome/tabs/bindings/UpdateProperties.scala index 67d5b6d..0702f00 100644 --- a/bindings/src/main/scala/chrome/tabs/bindings/UpdateProperties.scala +++ b/bindings/src/main/scala/chrome/tabs/bindings/UpdateProperties.scala @@ -1,6 +1,7 @@ package chrome.tabs.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny object UpdateProperties { diff --git a/bindings/src/main/scala/chrome/tabs/bindings/ZoomSettings.scala b/bindings/src/main/scala/chrome/tabs/bindings/ZoomSettings.scala index f63e82f..4a94e37 100644 --- a/bindings/src/main/scala/chrome/tabs/bindings/ZoomSettings.scala +++ b/bindings/src/main/scala/chrome/tabs/bindings/ZoomSettings.scala @@ -1,6 +1,7 @@ package chrome.tabs.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny @js.native trait ZoomSettings extends js.Object { diff --git a/bindings/src/main/scala/chrome/tts/bindings/SpeakOptions.scala b/bindings/src/main/scala/chrome/tts/bindings/SpeakOptions.scala index 958b86d..51596cc 100644 --- a/bindings/src/main/scala/chrome/tts/bindings/SpeakOptions.scala +++ b/bindings/src/main/scala/chrome/tts/bindings/SpeakOptions.scala @@ -1,6 +1,7 @@ package chrome.tts.bindings import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny object SpeakOptions { diff --git a/bindings/src/main/scala/chrome/tts/bindings/TTS.scala b/bindings/src/main/scala/chrome/tts/bindings/TTS.scala index 9d6c7d5..2579ff2 100644 --- a/bindings/src/main/scala/chrome/tts/bindings/TTS.scala +++ b/bindings/src/main/scala/chrome/tts/bindings/TTS.scala @@ -2,7 +2,7 @@ package chrome.tts.bindings import scala.scalajs.js import scala.scalajs.js.annotation.JSGlobal -import scala.scalajs.js.{UndefOr, native, undefined} +import scala.scalajs.js.{UndefOr, undefined} @js.native @JSGlobal("chrome.tts") @@ -12,16 +12,16 @@ object TTS extends js.Object { utterance: String, options: UndefOr[SpeakOptions] = undefined, callback: UndefOr[js.Function0[_]] = undefined - ): Unit = native + ): Unit = js.native - def stop(): Unit = native + def stop(): Unit = js.native - def pause(): Unit = native + def pause(): Unit = js.native - def resume(): Unit = native + def resume(): Unit = js.native - def isSpeaking(callback: UndefOr[js.Function1[Boolean, _]] = undefined): Unit = native + def isSpeaking(callback: UndefOr[js.Function1[Boolean, _]] = undefined): Unit = js.native - def getVoices(callback: UndefOr[js.Function1[js.Array[TTSVoice], _]] = undefined): Unit = native + def getVoices(callback: UndefOr[js.Function1[js.Array[TTSVoice], _]] = undefined): Unit = js.native } diff --git a/bindings/src/main/scala/chrome/wallpaper/bindings/Wallpaper.scala b/bindings/src/main/scala/chrome/wallpaper/bindings/Wallpaper.scala index 9858f8e..90a1058 100644 --- a/bindings/src/main/scala/chrome/wallpaper/bindings/Wallpaper.scala +++ b/bindings/src/main/scala/chrome/wallpaper/bindings/Wallpaper.scala @@ -2,6 +2,7 @@ package chrome.wallpaper.bindings import scala.scalajs.js import scala.scalajs.js.annotation.JSGlobal +import scala.scalajs.js.|.undefOr2jsAny @js.native trait WallpaperDetails extends js.Object { diff --git a/bindings/src/main/scala/chrome/webNavigation/bindings/AllFramesDetails.scala b/bindings/src/main/scala/chrome/webNavigation/bindings/AllFramesDetails.scala index 14484fb..1228869 100644 --- a/bindings/src/main/scala/chrome/webNavigation/bindings/AllFramesDetails.scala +++ b/bindings/src/main/scala/chrome/webNavigation/bindings/AllFramesDetails.scala @@ -1,28 +1,27 @@ package chrome.webNavigation.bindings import scala.scalajs.js -import scala.scalajs.js.native @js.native trait AllFramesDetails extends js.Object { /** True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired. */ - val errorOccurred: Boolean = native + val errorOccurred: Boolean = js.native /** The ID of the process that runs the renderer for this frame. */ - val processId: js.UndefOr[Int] = native + val processId: js.UndefOr[Int] = js.native /** The ID of the frame. 0 indicates that this is the main frame; a positive value indicates the ID of a subframe. */ - val frameId: Int = native + val frameId: Int = js.native /** ID of frame that wraps the frame. Set to -1 if no parent frame exists. */ - val frameParentId: Int = native + val frameParentId: Int = js.native /** The URL currently associated with this frame. */ - val url: String = native + val url: String = js.native } diff --git a/bindings/src/main/scala/chrome/webNavigation/bindings/FrameDetails.scala b/bindings/src/main/scala/chrome/webNavigation/bindings/FrameDetails.scala index b9f6134..9a6f47f 100644 --- a/bindings/src/main/scala/chrome/webNavigation/bindings/FrameDetails.scala +++ b/bindings/src/main/scala/chrome/webNavigation/bindings/FrameDetails.scala @@ -1,22 +1,21 @@ package chrome.webNavigation.bindings import scala.scalajs.js -import scala.scalajs.js.native @js.native trait FrameDetails extends js.Object { /** True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired. */ - val errorOccurred: Boolean = native + val errorOccurred: Boolean = js.native /** The URL currently associated with this frame, if the frame identified by the frameId existed at one point in the * given tab. The fact that an URL is associated with a given frameId does not imply that the corresponding frame * still exists. */ - val url: String = native + val url: String = js.native /** ID of frame that wraps the frame. Set to -1 if no parent frame exists. */ - val frameParentId: Int = native + val frameParentId: Int = js.native } diff --git a/bindings/src/main/scala/chrome/webNavigation/bindings/GetFrameOptions.scala b/bindings/src/main/scala/chrome/webNavigation/bindings/GetFrameOptions.scala index ae0e2c2..6d3e5f0 100644 --- a/bindings/src/main/scala/chrome/webNavigation/bindings/GetFrameOptions.scala +++ b/bindings/src/main/scala/chrome/webNavigation/bindings/GetFrameOptions.scala @@ -3,6 +3,7 @@ package chrome.webNavigation.bindings import chrome.tabs.bindings.Tab import scala.scalajs.js +import scala.scalajs.js.|.undefOr2jsAny @js.native trait GetFrameOptions extends js.Object { diff --git a/bindings/src/main/scala/chrome/webNavigation/bindings/OnBeforeNavigateDetails.scala b/bindings/src/main/scala/chrome/webNavigation/bindings/OnBeforeNavigateDetails.scala index 965bf4c..37977db 100644 --- a/bindings/src/main/scala/chrome/webNavigation/bindings/OnBeforeNavigateDetails.scala +++ b/bindings/src/main/scala/chrome/webNavigation/bindings/OnBeforeNavigateDetails.scala @@ -1,33 +1,32 @@ package chrome.webNavigation.bindings import scala.scalajs.js -import scala.scalajs.js._ @js.native trait OnBeforeNavigateDetails extends js.Object { /** The ID of the tab in which the navigation is about to occur. */ - val tabId: Int = native - val url: String = native + val tabId: Int = js.native + val url: String = js.native /** Deprecated since Chrome 50. The processId is no longer set for this event, since the process which will render the * resulting document is not known until onCommit. Always returns the value of -1. * * Missing in firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1248426 */ - val processId: js.UndefOr[Int] = native + val processId: js.UndefOr[Int] = js.native /** 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. * Frame IDs are unique for a given tab and process. */ - val frameId: Int = native + val frameId: Int = js.native /** Since Chrome 24. ID of frame that wraps the frame. Set to -1 of no parent frame exists. */ - val parentFrameId: Int = native + val parentFrameId: Int = js.native /** The time when the browser was about to start the navigation, in milliseconds since the epoch. */ - val timeStamp: Double = native + val timeStamp: Double = js.native } diff --git a/bindings/src/main/scala/chrome/webNavigation/bindings/OnCommittedDetails.scala b/bindings/src/main/scala/chrome/webNavigation/bindings/OnCommittedDetails.scala index c30fc28..bafe256 100644 --- a/bindings/src/main/scala/chrome/webNavigation/bindings/OnCommittedDetails.scala +++ b/bindings/src/main/scala/chrome/webNavigation/bindings/OnCommittedDetails.scala @@ -1,26 +1,25 @@ package chrome.webNavigation.bindings import scala.scalajs.js -import scala.scalajs.js._ @js.native trait OnCommittedDetails extends js.Object { /** The ID of the tab in which the navigation occurs. */ - val tabId: Int = native - val url: String = native + val tabId: Int = js.native + val url: String = js.native /** The ID of the process that runs the renderer for this frame. * * Missing in firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1248426 */ - val processId: js.UndefOr[Int] = native + val processId: js.UndefOr[Int] = js.native /** 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. * Frame IDs are unique within a tab. */ - val frameId: Int = native + val frameId: Int = js.native /** Cause of the navigation. */ @@ -32,6 +31,6 @@ trait OnCommittedDetails extends js.Object { /** The time when the navigation was committed, in milliseconds since the epoch. */ - val timeStamp: Double = native + val timeStamp: Double = js.native } diff --git a/bindings/src/main/scala/chrome/webNavigation/bindings/OnCompletedDetails.scala b/bindings/src/main/scala/chrome/webNavigation/bindings/OnCompletedDetails.scala index b3b55e7..ad86d2b 100644 --- a/bindings/src/main/scala/chrome/webNavigation/bindings/OnCompletedDetails.scala +++ b/bindings/src/main/scala/chrome/webNavigation/bindings/OnCompletedDetails.scala @@ -1,28 +1,27 @@ package chrome.webNavigation.bindings import scala.scalajs.js -import scala.scalajs.js._ @js.native trait OnCompletedDetails extends js.Object { /** The ID of the tab in which the navigation occurs. */ - val tabId: Int = native - val url: String = native + val tabId: Int = js.native + val url: String = js.native /** The ID of the process that runs the renderer for this frame. * * Missing in firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1248426 */ - val processId: js.UndefOr[Int] = native + val processId: js.UndefOr[Int] = js.native /** 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. * Frame IDs are unique within a tab. */ - val frameId: Int = native + val frameId: Int = js.native /** The time when the document finished loading, in milliseconds since the epoch. */ - val timeStamp: Double = native + val timeStamp: Double = js.native } diff --git a/bindings/src/main/scala/chrome/webNavigation/bindings/OnCreatedNavigationTargetDetails.scala b/bindings/src/main/scala/chrome/webNavigation/bindings/OnCreatedNavigationTargetDetails.scala index 7831254..a4422a6 100644 --- a/bindings/src/main/scala/chrome/webNavigation/bindings/OnCreatedNavigationTargetDetails.scala +++ b/bindings/src/main/scala/chrome/webNavigation/bindings/OnCreatedNavigationTargetDetails.scala @@ -1,34 +1,33 @@ package chrome.webNavigation.bindings import scala.scalajs.js -import scala.scalajs.js._ @js.native trait OnCreatedNavigationTargetDetails extends js.Object { /** The ID of the tab in which the navigation is triggered. */ - val sourceTabId: Int = native + val sourceTabId: Int = js.native /** The ID of the process that runs the renderer for the source frame. * * Missing in firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1248426 */ - val sourceProcessId: js.UndefOr[Int] = native + val sourceProcessId: js.UndefOr[Int] = js.native /** The ID of the frame with sourceTabId in which the navigation is triggered. 0 indicates the main frame. */ - val sourceFrameId: Int = native + val sourceFrameId: Int = js.native /** The URL to be opened in the new window. */ - val url: String = native + val url: String = js.native /** The ID of the tab in which the url is opened. */ - val tabId: Int = native + val tabId: Int = js.native /** The time when the browser was about to create a new view, in milliseconds since the epoch. */ - val timeStamp: Double = native + val timeStamp: Double = js.native } diff --git a/bindings/src/main/scala/chrome/webNavigation/bindings/OnDOMContentLoadedDetails.scala b/bindings/src/main/scala/chrome/webNavigation/bindings/OnDOMContentLoadedDetails.scala index d9f535e..bb71b93 100644 --- a/bindings/src/main/scala/chrome/webNavigation/bindings/OnDOMContentLoadedDetails.scala +++ b/bindings/src/main/scala/chrome/webNavigation/bindings/OnDOMContentLoadedDetails.scala @@ -1,28 +1,27 @@ package chrome.webNavigation.bindings import scala.scalajs.js -import scala.scalajs.js._ @js.native trait OnDOMContentLoadedDetails extends js.Object { /** The ID of the tab in which the navigation occurs. */ - val tabId: Int = native - val url: String = native + val tabId: Int = js.native + val url: String = js.native /** The ID of the process that runs the renderer for this frame. * * Missing in firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1248426 */ - val processId: js.UndefOr[Int] = native + val processId: js.UndefOr[Int] = js.native /** 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. * Frame IDs are unique within a tab. */ - val frameId: Int = native + val frameId: Int = js.native /** The time when the page's DOM was fully constructed, in milliseconds since the epoch. */ - val timeStamp: Double = native + val timeStamp: Double = js.native } diff --git a/bindings/src/main/scala/chrome/webNavigation/bindings/OnErrorOccurredDetails.scala b/bindings/src/main/scala/chrome/webNavigation/bindings/OnErrorOccurredDetails.scala index cdf6d78..71a3bf3 100644 --- a/bindings/src/main/scala/chrome/webNavigation/bindings/OnErrorOccurredDetails.scala +++ b/bindings/src/main/scala/chrome/webNavigation/bindings/OnErrorOccurredDetails.scala @@ -1,32 +1,31 @@ package chrome.webNavigation.bindings import scala.scalajs.js -import scala.scalajs.js._ @js.native trait OnErrorOccurredDetails extends js.Object { /** The ID of the tab in which the navigation occurs. */ - val tabId: Int = native - val url: String = native + val tabId: Int = js.native + val url: String = js.native /** The ID of the process that runs the renderer for this frame. * * Missing in firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1248426 */ - val processId: js.UndefOr[Int] = native + val processId: js.UndefOr[Int] = js.native /** 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. * Frame IDs are unique within a tab. */ - val frameId: Int = native + val frameId: Int = js.native /** The error description. */ - val error: String = native + val error: String = js.native /** The time when the error occurred, in milliseconds since the epoch. */ - val timeStamp: Double = native + val timeStamp: Double = js.native } diff --git a/bindings/src/main/scala/chrome/webNavigation/bindings/OnTabReplacedDetails.scala b/bindings/src/main/scala/chrome/webNavigation/bindings/OnTabReplacedDetails.scala index 748eb2c..809248c 100644 --- a/bindings/src/main/scala/chrome/webNavigation/bindings/OnTabReplacedDetails.scala +++ b/bindings/src/main/scala/chrome/webNavigation/bindings/OnTabReplacedDetails.scala @@ -1,20 +1,19 @@ package chrome.webNavigation.bindings import scala.scalajs.js -import scala.scalajs.js._ @js.native trait OnTabReplacedDetails extends js.Object { /** The ID of the tab that was replaced. */ - val replacedTabId: Int = native + val replacedTabId: Int = js.native /** The ID of the tab that replaced the old tab. */ - val tabId: Int = native + val tabId: Int = js.native /** The time when the replacement happened, in milliseconds since the epoch. */ - val timeStamp: Double = native + val timeStamp: Double = js.native } diff --git a/bindings/src/main/scala/chrome/webNavigation/bindings/WebNavigation.scala b/bindings/src/main/scala/chrome/webNavigation/bindings/WebNavigation.scala index 7779b5b..b4c96f7 100644 --- a/bindings/src/main/scala/chrome/webNavigation/bindings/WebNavigation.scala +++ b/bindings/src/main/scala/chrome/webNavigation/bindings/WebNavigation.scala @@ -4,7 +4,6 @@ import chrome.events.bindings.Event import scala.scalajs.js import scala.scalajs.js.annotation.JSGlobal -import scala.scalajs.js.native /** @see * chrome.webNavigation API @@ -15,44 +14,44 @@ object WebNavigation extends js.Object { /** Fired when a navigation is about to occur. */ - val onBeforeNavigate: Event[js.Function1[OnBeforeNavigateDetails, _]] = native + val onBeforeNavigate: Event[js.Function1[OnBeforeNavigateDetails, _]] = js.native /** Fired when a navigation is committed. The document (and the resources it refers to, such as images and subframes) * might still be downloading, but at least part of the document has been received from the server and the browser * has decided to switch to the new document. */ - val onCommitted: Event[js.Function1[OnCommittedDetails, _]] = native + val onCommitted: Event[js.Function1[OnCommittedDetails, _]] = js.native /** Fired when the page's DOM is fully constructed, but the referenced resources may not finish loading. */ - val onDOMContentLoaded: Event[js.Function1[OnDOMContentLoadedDetails, _]] = native + val onDOMContentLoaded: Event[js.Function1[OnDOMContentLoadedDetails, _]] = js.native /** Fired when a document, including the resources it refers to, is completely loaded and initialized. */ - val onCompleted: Event[js.Function1[OnCompletedDetails, _]] = native + val onCompleted: Event[js.Function1[OnCompletedDetails, _]] = js.native /** Fired when an error occurs and the navigation is aborted. This can happen if either a network error occurred, or * the user aborted the navigation. */ - val onErrorOccurred: Event[js.Function1[OnErrorOccurredDetails, _]] = native + val onErrorOccurred: Event[js.Function1[OnErrorOccurredDetails, _]] = js.native /** Fired when a new window, or a new tab in an existing window, is created to host a navigation. */ - val onCreatedNavigationTarget: Event[js.Function1[OnCreatedNavigationTargetDetails, _]] = native + val onCreatedNavigationTarget: Event[js.Function1[OnCreatedNavigationTargetDetails, _]] = js.native /** Fired when the reference fragment of a frame was updated. All future events for that frame will use the updated * URL. */ - val onReferenceFragmentUpdated: Event[js.Function1[OnCommittedDetails, _]] = native + val onReferenceFragmentUpdated: Event[js.Function1[OnCommittedDetails, _]] = js.native /** Fired when the contents of the tab is replaced by a different (usually previously pre-rendered) tab. */ - val onTabReplaced: Event[js.Function1[OnTabReplacedDetails, _]] = native + val onTabReplaced: Event[js.Function1[OnTabReplacedDetails, _]] = js.native /** Fired when the frame's history was updated to a new URL. All future events for that frame will use the updated * URL. */ - val onHistoryStateUpdated: Event[js.Function1[OnCommittedDetails, _]] = native + val onHistoryStateUpdated: Event[js.Function1[OnCommittedDetails, _]] = js.native /** Retrieves information about the given frame. A frame refers to an