MCPcopy Create free account
hub / github.com/libredirect/browser_extension / getDefaults

Function getDefaults

src/assets/javascripts/services.js:970–994  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

968}
969
970async function getDefaults() {
971 let config = await utils.getConfig()
972 let options = {}
973 for (const service in config.services) {
974 options[service] = {}
975 for (const defaultOption in config.services[service].options) {
976 options[service][defaultOption] = config.services[service].options[defaultOption]
977 }
978 for (const frontend in config.services[service].frontends) {
979 if (config.services[service].frontends[frontend].instanceList) {
980 options[frontend] = []
981 }
982 }
983 }
984 options.exceptions = {
985 url: [],
986 regex: [],
987 }
988 options.theme = "detect"
989 options.popupServices = ["youtube", "tiktok", "imgur", "reddit", "quora", "translate", "maps"]
990 options.fetchInstances = "github"
991 options.redirectOnlyInIncognito = false
992 options = { ...options, ...defaultInstances }
993 return options
994}
995
996function initDefaults() {
997 return new Promise(resolve => {

Callers 2

initDefaultsFunction · 0.85
processUpdateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected