Adrià Vilanova MartÃnez | a2ede8c | 2024-04-21 16:43:01 +0200 | [diff] [blame^] | 1 | interface BaseOptionConfig { |
| 2 | context: "options" | "experiments" | "internal" | "deprecated"; |
| 3 | } |
| 4 | export type OptionConfig = BaseOptionConfig & |
| 5 | ( |
| 6 | | { |
| 7 | defaultValue: any; |
| 8 | killSwitchType: |
| 9 | | "option" |
| 10 | | "experiment" |
| 11 | | "ignore" |
| 12 | | "deprecated"; |
| 13 | } |
| 14 | | { |
| 15 | killSwitchType: "internalKillSwitch"; |
| 16 | } |
| 17 | ); |
| 18 | export type OptionsPrototype = Record<string, OptionConfig>; |
| 19 | |
| 20 | export const optionsPrototype: OptionsPrototype = { |
| 21 | // Available options: |
| 22 | list: { |
| 23 | defaultValue: true, |
| 24 | context: "options", |
| 25 | killSwitchType: "option", |
| 26 | }, |
| 27 | thread: { |
| 28 | defaultValue: false, |
| 29 | context: "options", |
| 30 | killSwitchType: "option", |
| 31 | }, |
| 32 | threadall: { |
| 33 | defaultValue: true, |
| 34 | context: "options", |
| 35 | killSwitchType: "option", |
| 36 | }, |
| 37 | fixedtoolbar: { |
| 38 | defaultValue: false, |
| 39 | context: "options", |
| 40 | killSwitchType: "option", |
| 41 | }, |
| 42 | redirect: { |
| 43 | defaultValue: false, |
| 44 | context: "options", |
| 45 | killSwitchType: "option", |
| 46 | }, |
| 47 | history: { |
| 48 | defaultValue: false, |
| 49 | context: "options", |
| 50 | killSwitchType: "option", |
| 51 | }, |
| 52 | loaddrafts: { |
| 53 | defaultValue: false, |
| 54 | context: "options", |
| 55 | killSwitchType: "option", |
| 56 | }, |
| 57 | increasecontrast: { |
| 58 | defaultValue: false, |
| 59 | context: "options", |
| 60 | killSwitchType: "option", |
| 61 | }, |
| 62 | stickysidebarheaders: { |
| 63 | defaultValue: false, |
| 64 | context: "options", |
| 65 | killSwitchType: "option", |
| 66 | }, |
| 67 | profileindicator: { |
| 68 | defaultValue: false, |
| 69 | context: "options", |
| 70 | killSwitchType: "option", |
| 71 | }, |
| 72 | profileindicatoralt: { |
| 73 | defaultValue: false, |
| 74 | context: "options", |
| 75 | killSwitchType: "option", |
| 76 | }, |
| 77 | profileindicatoralt_months: { |
| 78 | defaultValue: 12, |
| 79 | context: "options", |
| 80 | killSwitchType: "ignore", |
| 81 | }, |
| 82 | ccdarktheme: { |
| 83 | defaultValue: false, |
| 84 | context: "options", |
| 85 | killSwitchType: "option", |
| 86 | }, |
| 87 | ccdarktheme_mode: { |
| 88 | defaultValue: "switch", |
| 89 | context: "options", |
| 90 | killSwitchType: "ignore", |
| 91 | }, |
| 92 | ccforcehidedrawer: { |
| 93 | defaultValue: false, |
| 94 | context: "options", |
| 95 | killSwitchType: "option", |
| 96 | }, |
| 97 | // #!if ['chromium', 'chromium_mv3'].includes(browser_target) |
| 98 | ccdragndropfix: { |
| 99 | defaultValue: false, |
| 100 | context: "options", |
| 101 | killSwitchType: "option", |
| 102 | }, |
| 103 | // #!endif |
| 104 | batchlock: { |
| 105 | defaultValue: false, |
| 106 | context: "options", |
| 107 | killSwitchType: "option", |
| 108 | }, |
| 109 | enhancedannouncementsdot: { |
| 110 | defaultValue: false, |
| 111 | context: "options", |
| 112 | killSwitchType: "option", |
| 113 | }, |
| 114 | repositionexpandthread: { |
| 115 | defaultValue: false, |
| 116 | context: "options", |
| 117 | killSwitchType: "option", |
| 118 | }, |
| 119 | threadlistavatars: { |
| 120 | defaultValue: false, |
| 121 | context: "options", |
| 122 | killSwitchType: "option", |
| 123 | }, |
| 124 | autorefreshlist: { |
| 125 | defaultValue: false, |
| 126 | context: "options", |
| 127 | killSwitchType: "option", |
| 128 | }, |
| 129 | imagemaxheight: { |
| 130 | defaultValue: false, |
| 131 | context: "options", |
| 132 | killSwitchType: "option", |
| 133 | }, |
| 134 | // #!if ['chromium', 'chromium_mv3'].includes(browser_target) |
| 135 | blockdrafts: { |
| 136 | defaultValue: false, |
| 137 | context: "options", |
| 138 | killSwitchType: "option", |
| 139 | }, |
| 140 | // #!endif |
| 141 | perforumstats: { |
| 142 | defaultValue: false, |
| 143 | context: "options", |
| 144 | killSwitchType: "option", |
| 145 | }, |
| 146 | interopthreadpage: { |
| 147 | defaultValue: false, |
| 148 | context: "options", |
| 149 | killSwitchType: "option", |
| 150 | }, |
| 151 | interopthreadpage_mode: { |
| 152 | defaultValue: "previous", |
| 153 | context: "options", |
| 154 | killSwitchType: "ignore", |
| 155 | }, |
| 156 | uispacing: { |
| 157 | defaultValue: false, |
| 158 | context: "options", |
| 159 | killSwitchType: "option", |
| 160 | }, |
| 161 | flattenthreads: { |
| 162 | defaultValue: false, |
| 163 | context: "options", |
| 164 | killSwitchType: "option", |
| 165 | }, |
| 166 | |
| 167 | // Experiments: |
| 168 | workflows: { |
| 169 | defaultValue: false, |
| 170 | context: "experiments", |
| 171 | killSwitchType: "experiment", |
| 172 | }, |
| 173 | extrainfo: { |
| 174 | defaultValue: false, |
| 175 | context: "experiments", |
| 176 | killSwitchType: "experiment", |
| 177 | }, |
| 178 | nestedreplies: { |
| 179 | defaultValue: false, |
| 180 | context: "experiments", |
| 181 | killSwitchType: "experiment", |
| 182 | }, |
| 183 | |
| 184 | // Internal options: |
| 185 | ccdarktheme_switch_enabled: { |
| 186 | defaultValue: true, |
| 187 | context: "internal", |
| 188 | killSwitchType: "ignore", |
| 189 | }, |
| 190 | flattenthreads_switch_enabled: { |
| 191 | defaultValue: true, |
| 192 | context: "internal", |
| 193 | killSwitchType: "ignore", |
| 194 | }, |
| 195 | |
| 196 | // Internal kill switches: |
| 197 | killswitch_xhrproxy: { |
| 198 | context: "internal", |
| 199 | killSwitchType: "internalKillSwitch", |
| 200 | }, |
| 201 | |
| 202 | // Deprecated options: |
| 203 | escalatethreads: { |
| 204 | defaultValue: false, |
| 205 | context: "deprecated", |
| 206 | killSwitchType: "deprecated", |
| 207 | }, |
| 208 | movethreads: { |
| 209 | defaultValue: false, |
| 210 | context: "deprecated", |
| 211 | killSwitchType: "deprecated", |
| 212 | }, |
| 213 | batchduplicate: { |
| 214 | defaultValue: false, |
| 215 | context: "deprecated", |
| 216 | killSwitchType: "deprecated", |
| 217 | }, |
| 218 | smei_sortdirection: { |
| 219 | defaultValue: false, |
| 220 | context: "deprecated", |
| 221 | killSwitchType: "deprecated", |
| 222 | }, |
| 223 | forcemarkasread: { |
| 224 | defaultValue: false, |
| 225 | context: "deprecated", |
| 226 | killSwitchType: "deprecated", |
| 227 | }, |
| 228 | disableunifiedprofiles: { |
| 229 | defaultValue: false, |
| 230 | context: "deprecated", |
| 231 | killSwitchType: "deprecated", |
| 232 | }, |
| 233 | }; |