com.alecdorrington.omnibrowser

Members list

Type members

Classlikes

sealed trait Android

Whether Firefox for Android may install an extension, as Firefox's add-on store records it from the extension's manifest.

Whether Firefox for Android may install an extension, as Firefox's add-on store records it from the extension's manifest.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Supported
object Unsupported
object Android

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Android.type
final case class Background(handlers: Handler*)

The background of an extension: the handlers of the events it responds to while no page of it need be open.

The background of an extension: the handlers of the events it responds to while no page of it need be open.

The browser starts the background when one of these events happens, and stops it again once it is idle, so it keeps nothing in memory between events. What it must remember belongs in Browser.Storage.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait Browser extends ContentBrowser

The browser, as the extension's background and pages see it.

The browser, as the extension's background and pages see it.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object Browser

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Browser.type
abstract class BrowserExtension[P]

A browser extension, defined by an object extending this class, which the sbt-omnibrowser plugin builds for each target browser.

A browser extension, defined by an object extending this class, which the sbt-omnibrowser plugin builds for each target browser.

Each part of the extension, its background, contentScripts, popup and options, is a method, so that it is built only when that part starts, and its code is bundled only where it runs. A content script's bundle holds what its own method reaches, and whatever the object's own values reach, so they should be only what every part shares, such as its Messages and StorageKeys.

Type parameters

P

The extension's permissions, as an intersection of Permission types such as Permission.Storage & Permission.Tabs, or Any for none. They are requested in the extension's manifest, and the code within the extension may use only the APIs that they grant.

Attributes

Supertypes
class Object
trait Matchable
class Any

The browser, as every part of the extension sees it, its content scripts included: with only some of its APIs.

The browser, as every part of the extension sees it, its content scripts included: with only some of its APIs.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Browser
trait TabBrowser
final case class ContentScript(matches: Seq[String], runAt: RunAt, run: TabBrowser => IO[Unit], css: Seq[String] = ...)

A script that the browser injects into each page that one of matches matches, at runAt, with access to only some of the browser's APIs, along with the stylesheets css, as paths among the extension's assets.

A script that the browser injects into each page that one of matches matches, at runAt, with access to only some of the browser's APIs, along with the stylesheets css, as paths among the extension's assets.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ContentScript

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class DataCollection(required: Set[PersonalData], optional: Set[DataKind] = ...)

The data that an extension collects or sends elsewhere: the required kinds without which it cannot work, and the optional kinds that the user may refuse. Firefox shows them to the user on installing the extension, and its add-on store refuses extensions that do not declare them.

The data that an extension collects or sends elsewhere: the required kinds without which it cannot work, and the optional kinds that the user may refuse. Firefox shows them to the user on installing the extension, and its add-on store refuses extensions that do not declare them.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
object DataKind

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
DataKind.type
sealed trait DataKind(val id: String)

A kind of data that an extension may collect, as Firefox names it.

A kind of data that an extension may collect, as Firefox names it.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
abstract class Database(val name: String, val version: Int)

A database of the extension's in the browser's IndexedDB, named name, for more than Browser.Storage holds, read and written through Browser.Databases. Its object stores are those that the object extending it makes with store, each a val of it, so that every one is made before the database is first opened:

A database of the extension's in the browser's IndexedDB, named name, for more than Browser.Storage holds, read and written through Browser.Databases. Its object stores are those that the object extending it makes with store, each a val of it, so that every one is made before the database is first opened:

object Lexicon extends Database("lexicon", version = 1):
 val lexemes = store[Lexeme]("lexemes")
 val counts  = store[Int]("counts")

The browser makes it with its stores the first time it is opened, and adds the stores that it lacks whenever it is opened at a version above its own, which must be raised whenever a store is added, and never lowered. A store left out stays in the database, unused, with what it kept.

Only the background and the extension's pages reach it: a content script's IndexedDB is the web page's, not the extension's, so its browser has no databases. No permission is needed. Without Permission.UnlimitedStorage, it has the browser's default quota, and the browser may evict it when the device runs short of space.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object Database

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
Database.type
final case class DatabaseError(database: String, reason: String) extends Exception

A failure of the database named database, as when it cannot be opened, or a write cannot be kept, as when the browser has no room for it, for reason, the browser's own where it gave one.

A failure of the database named database, as when it cannot be opened, or a write cannot be kept, as when the browser has no room for it, for reason, the browser's own where it gave one.

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
final class Granted[Q]

Evidence that an extension has the permission Q, which the APIs that Q grants require.

Evidence that an extension has the permission Q, which the APIs that Q grants require.

Attributes

Supertypes
class Object
trait Matchable
class Any
sealed trait Handler

Something that an extension's Background does when an event happens.

Something that an extension's Background does when an event happens.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Installed
class Serve[Req, Res]
class Startup
object Handler

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Handler.type
object InstallReason

Attributes

Companion
enum
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Why an extension was installed.

Why an extension was installed.

Attributes

Companion
object
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Message

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
Message.type
final class Message[Req, Res](val name: String)(using evidence$1: Encoder[Req], evidence$2: Decoder[Req], evidence$3: Encoder[Res], evidence$4: Decoder[Res])

A kind of message that one part of an extension sends the background, which BrowserExtension.serve answers. Its name must be unique among the extension's messages, and must not begin with omnibrowser/, which the library keeps for its own. Its requests and responses go as JSON, through circe's codecs.

A kind of message that one part of an extension sends the background, which BrowserExtension.serve answers. Its name must be unique among the extension's messages, and must not begin with omnibrowser/, which the library keeps for its own. Its requests and responses go as JSON, through circe's codecs.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
final case class MessagingError(name: String, reason: String) extends Exception

A failure to send or answer the message, or to read the shared value, named name.

A failure to send or answer the message, or to read the shared value, named name.

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
final class ObjectStore[A]

An object store of database, named name, which keeps values of type A, each as JSON, through circe's codecs, under a key of its own. Its keys are ordered as strings are, by their UTF-16 code units. A Database makes its own.

An object store of database, named name, which keeps values of type A, each as JSON, through circe's codecs, under a key of its own. Its keys are ordered as strings are, by their UTF-16 code units. A Database makes its own.

Attributes

Supertypes
class Object
trait Matchable
class Any
final case class Page(run: Browser => IO[Unit], body: String = ..., stylesheets: Seq[String] = ...)

A page of the extension, whose body begins as the HTML body, styled by stylesheets, as paths among the extension's assets, and which run fills in once it has loaded.

A page of the extension, whose body begins as the HTML body, styled by stylesheets, as paths among the extension's assets, and which run fills in once it has loaded.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait Permission

A permission that an extension may request, named in its manifest after its type, as activeTab for Permission.ActiveTab.

A permission that an extension may request, named in its manifest after its type, as activeTab for Permission.ActiveTab.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait ActiveTab
trait Storage
trait Tabs
object Permission

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Permission.type
final case class Permissions[P](names: Set[String])

The manifest names of the permissions in P, an intersection of Permission types, or Any for none.

The manifest names of the permissions in P, an intersection of Permission types, or Any for none.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Permissions

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
enum PersonalData(id: String) extends DataKind

A kind of personal data, which an extension may require.

A kind of personal data, which an extension may require.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
trait DataKind
class Object
trait Matchable
class Any
Show all
enum RunAt(val id: String)

When the browser injects a ContentScript into its page.

When the browser injects a ContentScript into its page.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class Sender(tab: Option[Tab], url: Option[String])

Who sent a Message: a content script, in the tab of its page, or another part of the extension, at url.

Who sent a Message: a content script, in the tab of its page, or another part of the extension, at url.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Shared

Values that one part of an extension owns, and shares with the others, which see each new value as the owner gives it.

Values that one part of an extension owns, and shares with the others, which see each new value as the owner gives it.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Shared.type
enum StorageArea(val id: String)

Where the browser keeps the value of a StorageKey.

Where the browser keeps the value of a StorageKey.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final class StorageKey[A](val area: StorageArea, val name: String, val default: A)(using evidence$1: Encoder[A], evidence$2: Decoder[A])

A value that the extension keeps in the browser's storage, under name in area, which is default until it is first set. Its value is kept as JSON, through circe's codecs. A stored value that they cannot decode, as one that an earlier version stored differently, is default until it is set again, and the browser's console warns of it.

A value that the extension keeps in the browser's storage, under name in area, which is default until it is first set. Its value is kept as JSON, through circe's codecs. A stored value that they cannot decode, as one that an earlier version stored differently, is default until it is set again, and the browser's console warns of it.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object StorageKey

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
StorageKey.type
final class StorageKeys[A](val area: StorageArea, val prefix: String, val default: A)(using evidence$1: Encoder[A], evidence$2: Decoder[A])

A family of StorageKeys in area, each named prefix followed by a name of its own, as many as the extension needs, as one for each word that a user rates, each default until it is first set. Each is a key of its own, so that two parts of the extension setting two of them at once lose neither, and Browser.Storage.all reads every one that is stored. No family's prefix should begin another's in the same area, as count: begins count:x:, or the shorter would read the longer's keys as its own, as it would a key named apart that begins with its prefix.

A family of StorageKeys in area, each named prefix followed by a name of its own, as many as the extension needs, as one for each word that a user rates, each default until it is first set. Each is a key of its own, so that two parts of the extension setting two of them at once lose neither, and Browser.Storage.all reads every one that is stored. No family's prefix should begin another's in the same area, as count: begins count:x:, or the shorter would read the longer's keys as its own, as it would a key named apart that begins with its prefix.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object StorageKeys

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
final case class Tab(id: TabId, windowId: Int, active: Boolean, url: Option[String], title: Option[String])

A tab of the browser. Its url and title are known only for pages that the extension may access, unless it has the Permission.Tabs permission.

A tab of the browser. Its url and title are known only for pages that the extension may access, unless it has the Permission.Tabs permission.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait TabBrowser extends ContentBrowser

The browser, as a content script sees it: with only some of its APIs, and with what the script offers the rest of the extension from its tab.

The browser, as a content script sees it: with only some of its APIs, and with what the script offers the rest of the extension from its tab.

Attributes

Supertypes
class Object
trait Matchable
class Any
object TabId

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
TabId.type
enum Target(val id: String)

A browser that an extension may be built for.

A browser that an extension may be built for.

Attributes

Companion
object
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Target

Attributes

Companion
enum
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Target.type

Types

opaque type TabId

The ID of a Tab, unique within the browser's session.

The ID of a Tab, unique within the browser's session.

Attributes