Documentation ¶
Index ¶
- func CreateManifest(opts ProjectOptions) ([]byte, error)
- func CreatePopupPage(moduleName, wasmEmbed string) (html, js []byte)
- func CreateServiceWorker(moduleName, wasmEmbed string) (js []byte)
- func CreateSettingsPage(moduleName, wasmEmbed string) (html, js []byte)
- func CreateSidePanel(moduleName, wasmEmbed string) (html, js []byte)
- type ArchiveEntry
- type File
- type ManifestAction
- type ManifestBackground
- type ManifestBasicSchema
- type ManifestCSP
- type ManifestSidePanel
- type PackFlags
- type ProjectOptions
- type WebextFlags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateManifest ¶
func CreateManifest(opts ProjectOptions) ([]byte, error)
func CreatePopupPage ¶
func CreateServiceWorker ¶
func CreateSettingsPage ¶
func CreateSidePanel ¶
Types ¶
type ArchiveEntry ¶
type File ¶
func CreateProject ¶
func CreateProject(dir string, opts ProjectOptions) []File
type ManifestAction ¶
type ManifestBackground ¶
type ManifestBackground struct {
ServiceWorker string `json:"service_worker"`
}
type ManifestBasicSchema ¶
type ManifestBasicSchema struct { ManifestVersion int `json:"manifest_version"` Name string `json:"name"` Description string `json:"description"` HomepageURL string `json:"homepage_url"` Version string `json:"version"` Icons struct { N16 string `json:"16"` N48 string `json:"48"` N128 string `json:"128"` N256 string `json:"256"` } `json:"icons"` OptionsPage string `json:"options_page,omitempty"` Permissions []string `json:"permissions"` CSP ManifestCSP `json:"content_security_policy"` SidePanel *ManifestSidePanel `json:"side_panel,omitempty"` Background *ManifestBackground `json:"background,omitempty"` Action *ManifestAction `json:"action,omitempty"` }
type ManifestCSP ¶
type ManifestCSP struct {
ExtensionPages string `json:"extension_pages"`
}
type ManifestSidePanel ¶
type ManifestSidePanel struct {
DefaultPath string `json:"default_path"`
}
type ProjectOptions ¶
type ProjectOptions struct { Name string `cli:"name,#set name of the extension"` URL string `cli:"url,#set url to the project home"` ModuleName string `cli:"module-name,#set module name for js bindings"` All bool `cli:"all,#add all components"` Popup bool `cli:"popup,#add popup component"` ServiceWorker bool `cli:"service-worker|background,#add service-worker component"` Settings bool `cli:"settings,#add extension settings component (options_page)"` SidePanel bool `cli:"sidepanel,#add sidepanel component"` }
type WebextFlags ¶
type WebextFlags struct { WASM string `cli:"wasm,#set output path for the built wasm"` Bindings string `cli:"bindings,#set output path for the generated bindings"` Embedding string `cli:"embedding,#set output path for the generated js embedding"` Zip string `cli:"zip,#set output path for the generated zip file"` EmbedMode string `cli:"embed-mode,def=uint8array,comp=uint8array,comp=base64,comp=data-url,#set embedding mode"` EmbedFiles map[string]string `cli:"embed,#add embedded file in format \"[export] {var|const|let} <var-name>=<file-path>\""` ES string `cli:"es,def=5,comp=5,comp=6,#set ES language when transpiling typescript"` ModuleName string `cli:"module-name,def=bindings,#set module name for generated bindings"` PackDir string `cli:"pack-base,#set base dir for matching pack glob patterns"` PackMatch []string `cli:"pack,#add glob pattern to include matched files in zip"` Debug bool `cli:"debug,#debug the wasm build process"` BuildDir string `cli:"build-dir,def=.pcz/build,#set directory to store intermediate build outputs"` NoCache bool `cli:"no-cache,#build without cache"` Trimpath bool `cli:"trimpath,#remove all file system paths from the resulting executable"` Defs []string `cli:"X|define,#link-time string value definition of the form importpath.name=value"` EntrySymbol string `cli:"entry,def=rt0,#set entry symbol name"` Platform toolchain.Platform `cli:"p|platform,def=js/wasm,#\"os/arch\" pair"` Tags []string `cli:"t|tag,#add build tags"` LDFlags []string `cli:"L|ldflag,#add flags to go tool link"` GCFlags []string `cli:"G|gcflag,#add flags to go tool compile (not including gccgo)"` ASMFlags []string `cli:"A|asmflag,#add flags to go tool asm"` }
Click to show internal directories.
Click to hide internal directories.