Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "config"

Index

Variables

CONFIGNAME

CONFIGNAME: "userconfig" = "userconfig"

Tridactyl Configuration

We very strongly recommend that you pretty much ignore this page and instead follow the link below DEFAULTS that will take you to our own source code which is formatted in a marginally more sane fashion.

DEFAULTS

DEFAULTS: any = o({configversion: "0.0",nmaps: o({o: "fillcmdline open",O: "current_url open",w: "fillcmdline winopen",W: "current_url winopen",t: "fillcmdline tabopen","]]": "followpage next","[[": "followpage prev","[c": "urlincrement -1","]c": "urlincrement 1","<c-x>": "urlincrement -1","<c-a>": "urlincrement 1",T: "current_url tabopen",yy: "clipboard yank",ys: "clipboard yankshort",yc: "clipboard yankcanon",gh: "home",gH: "home true",p: "clipboard open",P: "clipboard tabopen",j: "scrollline 10","<c-e>": "scrollline 10",k: "scrollline -10","<c-y>": "scrollline 10",h: "scrollpx -50",l: "scrollpx 50",G: "scrollto 100",gg: "scrollto 0","<c-u>": "scrollpage -0.5","<c-d>": "scrollpage 0.5",// Disabled while our find mode is bad/* "<c-f>": "scrollpage -1", */// "<c-b>": "scrollpage -1",$: "scrollto 100 x",// "0": "scrollto 0 x", // will get interpreted as a count"^": "scrollto 0 x","<c-6>": "buffer #",H: "back",L: "forward","<c-o>": "back","<c-i>": "forward",d: "tabclose",u: "undo",r: "reload",R: "reloadhard",gi: "focusinput -l","g;": "changelistjump -1",gt: "tabnext_gt",gT: "tabprev",// "<c-n>": "tabnext_gt", // c-n is reserved for new window// "<c-p>": "tabprev","g^": "tabfirst",g0: "tabfirst",g$: "tablast",gr: "reader",gu: "urlparent",gU: "urlroot",":": "fillcmdline",s: "fillcmdline open search",S: "fillcmdline tabopen search",// find mode not suitable for general consumption yet.// "/": "find",// "?": "find -1",// "n": "findnext 1",// "N": "findnext -1",M: "gobble 1 quickmark",// "B": "fillcmdline bufferall",b: "fillcmdline buffer",ZZ: "qall",f: "hint",F: "hint -b",";i": "hint -i",";I": "hint -I",";k": "hint -k",";y": "hint -y",";p": "hint -p",";r": "hint -r",";s": "hint -s",";S": "hint -S",";a": "hint -a",";A": "hint -A",";;": "hint -;",";#": "hint -#",I: "mode ignore",a: "current_url bmark",A: "bmark",zi: "zoom 0.1 true",zo: "zoom -0.1 true",zz: "zoom 1",".": "repeat","<SA-ArrowUp><SA-ArrowUp><SA-ArrowDown><SA-ArrowDown><SA-ArrowLeft><SA-ArrowRight><SA-ArrowLeft><SA-ArrowRight>ba":"open https://www.youtube.com/watch?v=M3iOROuTuMA",}),autocmds: o({DocStart: o({"addons.mozilla.org": "mode ignore",}),}),exaliases: o({alias: "command",au: "autocmd",b: "buffer",o: "open",w: "winopen",t: "tabopen",tn: "tabnext_gt",bn: "tabnext_gt",tnext: "tabnext_gt",bnext: "tabnext_gt",tp: "tabprev",tN: "tabprev",bp: "tabprev",bN: "tabprev",tprev: "tabprev",bprev: "tabprev",bfirst: "tabfirst",blast: "tablast",tfirst: "tabfirst",tlast: "tablast",bd: "tabclose",bdelete: "tabclose",sanitize: "sanitise",tutorial: "tutor",}),followpagepatterns: o({next: "^(next|newer)\\b|»|>>|more",prev: "^(prev(ious)?|older)\\b|«|<<",}),searchengine: "google",searchurls: o({google: "https://www.google.com/search?q=",scholar: "https://scholar.google.com/scholar?q=",googleuk: "https://www.google.co.uk/search?q=",bing: "https://www.bing.com/search?q=",duckduckgo: "https://duckduckgo.com/?q=",yahoo: "https://search.yahoo.com/search?p=",twitter: "https://twitter.com/search?q=",wikipedia: "https://en.wikipedia.org/wiki/Special:Search/",youtube: "https://www.youtube.com/results?search_query=",amazon:"https://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=",amazonuk:"https://www.amazon.co.uk/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=",startpage:"https://startpage.com/do/search?language=english&cat=web&query=",github: "https://github.com/search?utf8=✓&q=",searx: "https://searx.me/?category_general=on&q=",cnrtl: "http://www.cnrtl.fr/lexicographie/",osm: "https://www.openstreetmap.org/search?query=",mdn: "https://developer.mozilla.org/en-US/search?q=",gentoo_wiki:"https://wiki.gentoo.org/index.php?title=Special%3ASearch&profile=default&fulltext=Search&search=",qwant: "https://www.qwant.com/?q=",}),newtab: "",viewsource: "tridactyl", // "tridactyl" or "default"storageloc: "sync",homepages: [],hintchars: "hjklasdfgyuiopqwertnmzxcvb",hintfiltermode: "simple", // "simple", "vimperator", "vimperator-reflow"// Controls whether the page can focus elements for you via js// Remember to also change browser.autofocus (autofocusing elements via// HTML) in about:config// Maybe have a nice user-vicible message when the setting is changed?allowautofocus: "true",tabopenpos: "next",relatedopenpos: "related",ttsvoice: "default", // chosen from the listvoices list, or "default"ttsvolume: 1, // 0 to 1ttsrate: 1, // 0.1 to 10ttspitch: 1, // 0 to 2// either "nextinput" or "firefox"// If nextinput, <Tab> after gi brings selects the next input// If firefox, <Tab> selects the next selectable element, e.g. a linkgimode: "nextinput", // either "nextinput" or "firefox"// either "beginning" or "end"// Decides where to place the cursor when selecting non-empty input fieldscursorpos: "end",theme: "default", // currently available: "default", "dark"// Default logging levels - 2 === WARNINGlogging: o({messaging: 2,cmdline: 2,controller: 2,hinting: 2,state: 2,excmd: 1,}),})

INITIALISED

INITIALISED: boolean = false

USERCONFIG

USERCONFIG: any = o({})

WAITERS

WAITERS: any[] = []

Functions

get

  • get(...target: any[]): any
  • Get the value of the key target.

    If the user has not specified a key, use the corresponding key from defaults, if one exists, else undefined.

    Parameters

    • Rest ...target: any[]

    Returns any

getAsync

  • getAsync(...target: any[]): Promise<any>
  • Get the value of the key target, but wait for config to be loaded from the database first if it has not been at least once before.

    This is useful if you are a content script and you've just been loaded.

    Parameters

    • Rest ...target: any[]

    Returns Promise<any>

getDeepProperty

  • getDeepProperty(obj: any, target: any): any
  • Given an object and a target, extract the target if it exists, else return undefined

    Parameters

    • obj: any
    • target: any

      path of properties as an array

    Returns any

init

  • init(): Promise<void>
  • Read all user configuration from storage API then notify any waiting asynchronous calls

    asynchronous calls generated by getAsync.

    Returns Promise<void>

o

  • o(object: any): any
  • Parameters

    • object: any

    Returns any

save

  • save(storage?: "local" | "sync"): Promise<void>
  • Save the config back to storage API.

    Config is not synchronised between different instances of this module until sometime after this happens.

    Parameters

    • Default value storage: "local" | "sync" = get("storageloc")

    Returns Promise<void>

schlepp

  • schlepp(settings: any): void
  • Parameters

    • settings: any

    Returns void

set

  • set(...args: any[]): void
  • Full target specification, then value

    e.g. set("nmaps", "o", "open") set("search", "default", "google") set("aucmd", "BufRead", "memrise.com", "open memrise.com")

    Parameters

    • Rest ...args: any[]

    Returns void

setDeepProperty

  • setDeepProperty(obj: any, value: any, target: any): any
  • Create the key path target if it doesn't exist and set the final property to value.

    If the path is an empty array, replace the obj.

    Parameters

    • obj: any
    • value: any
    • target: any

      path of properties as an array

    Returns any

unset

  • unset(...target: any[]): void
  • Delete the key at target if it exists

    Parameters

    • Rest ...target: any[]

    Returns void

update

  • update(): Promise<void>
  • Updates the config to the latest version. Proposed semantic for config versionning:

    • x.y -> x+1.0 : major architectural changes
    • x.y -> x.y+1 : renaming settings/changing their types There's no need for an updater if you're only adding a new setting/changing a default setting

    When adding updaters, don't forget to set("configversion", newversionnumber)!

    Returns Promise<void>

Generated using TypeDoc