Plugin
AlwaysTrust
Removes the annoying untrusted domain and suspicious file popup
1
import { definePluginSettings } from "@api/Settings";2
import { Devs } from "@utils/constants";3
import definePlugin, { OptionType } from "@utils/types";4
5
const settings = definePluginSettings({6
domain: {7
type: OptionType.BOOLEAN,8
default: true,9
description: "Remove the untrusted domain popup when opening links",10
restartNeeded: true11
},12
file: {13
type: OptionType.BOOLEAN,14
default: true,15
description: "Remove the 039;Potentially Dangerous Download039; popup when opening links",16
restartNeeded: true17
}18
});19
20
export default definePlugin({21
name: "AlwaysTrust",22
description: "Removes the annoying untrusted domain and suspicious file popup",23
tags: ["Utility"],24
authors: [Devs.zt, Devs.Trwy],25
patches: [26
{27
find: 039;="MaskedLinkStore",039;,28
replacement: {29
match: /(?<=isTrustedDomain\(\i\){)return \i\(\i\)/,30
replace: "return true"31
},32
predicate: () => settings.store.domain33
},34
{35
find: "bitbucket.org",36
replacement: {37
match: /function \i\(\i\){(?=.{0,30}pathname:\i)/,38
replace: "$&return null;"39
},40
predicate: () => settings.store.file41
}42
],43
settings44
});45