forked from AlexITC/chrome-scalajs-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppManifest.scala
51 lines (41 loc) · 1.57 KB
/
AppManifest.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import chrome.permissions.Permission
import chrome.permissions.Permission.API
import chrome.{Background, BrowserAction, ContentScript, ExtensionManifest}
import com.alexitc.Chrome
object AppManifest {
def generate(appName: String, appVersion: String): ExtensionManifest = {
new ExtensionManifest {
override val name = appName
override val version = appVersion
override val description = Some(
"TO BE UPDATED" // TODO: REPLACE ME
)
override val icons = Chrome.icons("icons", "app.png", Set(48, 96, 128))
// TODO: REPLACE ME, use only the minimum required permissions
override val permissions = Set[Permission](
API.Storage,
API.Notifications,
API.Alarms
)
override val defaultLocale: Option[String] = Some("en")
// TODO: REPLACE ME
override val browserAction: Option[BrowserAction] =
Some(BrowserAction(icons, Some("TO BE DEFINED - POPUP TITLE"), Some("popup.html")))
// scripts used on all modules
val commonScripts = List("scripts/common.js", "main-bundle.js")
override val background = Background(
scripts = commonScripts ::: List("scripts/background-script.js")
)
override val contentScripts: List[ContentScript] = List(
ContentScript(
matches = List(
"https://github.com/*" // TODO: REPLACE ME
),
css = List("css/active-tab.css"),
js = commonScripts ::: List("scripts/active-tab-script.js")
)
)
override val webAccessibleResources = List("icons/*")
}
}
}