()
| 3105 | console.log("--- FastDork.js: DOMContentLoaded END ---"); |
| 3106 | |
| 3107 | async function saveImportListPreference() { |
| 3108 | if (!UI.importBtn || !UI.listTab2) return; |
| 3109 | |
| 3110 | const domainKey = UI.importBtn.dataset.contextKey; |
| 3111 | const selectedListKey = UI.listTab2.value; |
| 3112 | |
| 3113 | if (!domainKey) { |
| 3114 | console.warn( |
| 3115 | "[saveImportListPreference] Could not find domainKey on button." |
| 3116 | ); |
| 3117 | return; |
| 3118 | } |
| 3119 | |
| 3120 | if (selectedListKey && selectedListKey !== "0") { |
| 3121 | const storageLookupKey = `tab2Save-${domainKey}`; |
| 3122 | try { |
| 3123 | await setStorageData({ [storageLookupKey]: selectedListKey }); |
| 3124 | console.log( |
| 3125 | `[saveImportListPreference] Saved list preference for ${domainKey}: ${selectedListKey}` |
| 3126 | ); |
| 3127 | } catch (error) { |
| 3128 | console.error( |
| 3129 | `[saveImportListPreference] Error saving list preference for ${domainKey}:`, |
| 3130 | error |
| 3131 | ); |
| 3132 | } |
| 3133 | } else { |
| 3134 | console.log( |
| 3135 | `[saveImportListPreference] No valid list selected, preference not saved for ${domainKey}.` |
| 3136 | ); |
| 3137 | } |
| 3138 | } |
| 3139 | |
| 3140 | function validateDorkOptionsModal() { |
| 3141 | if ( |
no test coverage detected