Plugin
AlwaysTrust
Removes the annoying untrusted domain and suspicious file popup
1
/*2
* FiveCord — a Discord client mod3
* Copyright (c) 2025 FiveCord4
* SPDX-License-Identifier: GPL-3.0-or-later5
*/6
7
import { definePluginSettings } from "@api/Settings";8
import { Devs } from "@utils/constants";9
import definePlugin, { OptionType } from "@utils/types";10
11
const settings = definePluginSettings({12
domain: {13
type: OptionType.BOOLEAN,14
default: true,15
description: "Remove the untrusted domain popup when opening links",16
restartNeeded: true17
},18
file: {19
type: OptionType.BOOLEAN,20
default: true,21
description: "Remove the 039;Potentially Dangerous Download039; popup when opening links",22
restartNeeded: true23
}24
});25
26
export default definePlugin({27
name: "AlwaysTrust",28
description: "Removes the annoying untrusted domain and suspicious file popup",29
tags: ["Utility"],30
authors: [Devs.zt, Devs.Trwy],31
patches: [32
{33
find: 039;="MaskedLinkStore",039;,34
replacement: {35
match: /(?<=isTrustedDomain\(\i\){)return \i\(\i\)/,36
replace: "return true"37
},38
predicate: () => settings.store.domain39
},40
{41
find: "bitbucket.org",42
replacement: {43
match: /function \i\(\i\){(?=.{0,30}pathname:\i)/,44
replace: "$&return null;"45
},46
predicate: () => settings.store.file47
}48
],49
settings50
});51