Plugin

AlwaysTrust

Removes the annoying untrusted domain and suspicious file popup

Utility
index.ts
Download

Source

src/plugins/alwaysTrust/index.ts
1import { definePluginSettings } from "@api/Settings";
2import { Devs } from "@utils/constants";
3import definePlugin, { OptionType } from "@utils/types";
4
5const settings = definePluginSettings({
6 domain: {
7 type: OptionType.BOOLEAN,
8 default: true,
9 description: "Remove the untrusted domain popup when opening links",
10 restartNeeded: true
11 },
12 file: {
13 type: OptionType.BOOLEAN,
14 default: true,
15 description: "Remove the 'Potentially Dangerous Download' popup when opening links",
16 restartNeeded: true
17 }
18});
19
20export 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: '="MaskedLinkStore",',
28 replacement: {
29 match: /(?<=isTrustedDomain\(\i\){)return \i\(\i\)/,
30 replace: "return true"
31 },
32 predicate: () => settings.store.domain
33 },
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.file
41 }
42 ],
43 settings
44});
45