Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
extensions.forEach((extension) => browser.management.setEnabled(extension.id, false))
window.close()
async function disableAllExtensions() {
const extensionsAndApps = await browser.management.getAll()
const extensions = extensionsAndApps
.filter((extensionOrApp) => {
return extensionOrApp.type === 'extension' &&
extensionOrApp.name !== "Cato"
})
extensions.forEach((extension) => browser.management.setEnabled(extension.id, false))
window.close()
}
action: async () => {
await browser.management.setEnabled(extension.id, false)
window.close()
},
icon: {
async function displayActiveExtensions() {
window.currentSearchSuggestions = []
if (!plugin.valid) {
window.searchInput.value = `${plugin.searchScope} `
window.searchResultsList.innerHTML = ""
const extensionsAndApps = await browser.management.getAll()
let extensions = extensionsAndApps.filter((extensionOrApp) => {
return extensionOrApp.type === 'extension' &&
extensionOrApp.name !== "Cato" &&
extensionOrApp.enabled
})
extensions = sortBy(extensions, ['name'])
window.currentSearchSuggestions = extensions.map((extension) => {
const action = {
keyword: `${extension.name}`,
action: async () => {
await browser.management.setEnabled(extension.id, false)
window.close()
},
icon: {
return async function closureFunc() {
const options = {showConfirmDialog: true}
await browser.management.uninstall(extension.id, options)
}
}
async function uninstallExtension() {
window.searchInput.value = ''
window.searchResultsList.innerHTML = ""
if (!plugin.valid) {
window.searchInput.value = `${plugin.keyword} `
window.searchResultsList.innerHTML = ""
const extensionsAndApps = await browser.management.getAll()
let extensions = extensionsAndApps
.filter((extensionOrApp) => {
return extensionOrApp.type === 'extension' &&
extensionOrApp.name !== "Awesome Task Launcher"
})
extensions = sortBy(extensions, ['name'])
window.currentSearchSuggestions = extensions.map((extension) => {
const action = {
'keyword': `${extension.name}`,
'action': uninstall(extension),
'icon': {
path: utils.useAvalableExtensionIcon(extension)
}
}
browser.runtime.onInstalled.addListener(async ({ reason, previousVersion }) => {
if (reason === 'update') {
const { installType } = await browser.management.getSelf()
if (installType === 'development') {
return
}
const { version } = browser.runtime.getManifest()
const versionDiffType = semverDiff(previousVersion, version)
if (versionDiffType === null || versionDiffType === 'patch') {
return
}
const changelogUrl = changelogs[version]
if (changelogUrl) {
const {
;(async (): Promise => {
const self = await browser.management.getSelf()
if (self.installType === 'development') {
browser.runtime.getPackageDirectoryEntry(dir => watchChanges(dir))
}
})()
}
browser.runtime.reload();
};
const watchChanges = (dir, lastTimestamp) => {
timestampForFilesInDirectory(dir).then((timestamp) => {
if (!lastTimestamp || (lastTimestamp === timestamp)) {
setTimeout(() => watchChanges(dir, timestamp), 1000);
} else {
reload();
}
});
};
browser.management.getSelf()
.then((self) => {
if (self.installType === 'development') {
browser.runtime.getPackageDirectoryEntry(dir => watchChanges(dir));
}
});