diff --git a/sbt-plugin/src/main/scala/net/lullabyte/JsonCodecs.scala b/sbt-plugin/src/main/scala/net/lullabyte/JsonCodecs.scala index 4d13eb9..43fa978 100644 --- a/sbt-plugin/src/main/scala/net/lullabyte/JsonCodecs.scala +++ b/sbt-plugin/src/main/scala/net/lullabyte/JsonCodecs.scala @@ -124,6 +124,14 @@ object JsonCodecs { ) } + implicit val contentScriptsEncoder = Encoder.instance[chrome.ContentScripts] { contentScripts => + Json.obj( + ("matches", Json.fromValues(contentScripts.matches.map(Json.fromString))), + ("css", Json.fromValues(contentScripts.css.map(Json.fromString))), + ("js", Json.fromValues(contentScripts.js.map(Json.fromString))) + ) + } + implicit val actionEncoder = Encoder.instance[chrome.Commands.Action] { action => Json.obj( ("suggested_key", action.suggestedKey.asJson), @@ -189,7 +197,8 @@ object JsonCodecs { ("omnibox", manifest.omnibox.asJson), ("options_ui", manifest.optionsUI.asJson), ("browser_action", manifest.browserAction.asJson), - ("chrome_ui_overrides", manifest.chromeUIOverrides.asJson) + ("chrome_ui_overrides", manifest.chromeUIOverrides.asJson), + ("content_scripts", manifest.contentScripts.asJson) ) Json.fromFields( commonValues ++ extValues diff --git a/shared/src/main/scala/chrome/Manifest.scala b/shared/src/main/scala/chrome/Manifest.scala index 23525f2..2f1bb45 100644 --- a/shared/src/main/scala/chrome/Manifest.scala +++ b/shared/src/main/scala/chrome/Manifest.scala @@ -35,6 +35,12 @@ case class BrowserAction( title: Option[String] = None, popup: Option[String] = None ) + +case class ContentScripts( + matches: List[String], + css: List[String], + js: List[String]) + case class Bluetooth( uuids: List[String] = Nil, socket: Option[Boolean] = None, @@ -103,4 +109,5 @@ trait ExtensionManifest extends chrome.Manifest { val omnibox: Option[Omnibox] = None val optionsUI: Option[OptionsUI] = None val chromeUIOverrides: Option[ChromeUIOverrides] = None + val contentScripts: Option[ContentScripts] = None }