()
| 968 | } |
| 969 | |
| 970 | async 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 | |
| 996 | function initDefaults() { |
| 997 | return new Promise(resolve => { |
no outgoing calls
no test coverage detected