diff --git a/src/app/page.tsx b/src/app/page.tsx index d2aa757..7962e73 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -807,6 +807,11 @@ export default function Home() { }} profile={currentProfileForCamoufoxConfig} onSave={handleSaveCamoufoxConfig} + isRunning={ + currentProfileForCamoufoxConfig + ? runningProfiles.has(currentProfileForCamoufoxConfig.id) + : false + } /> void; profile: BrowserProfile | null; onSave: (profile: BrowserProfile, config: CamoufoxConfig) => Promise; + isRunning?: boolean; } export function CamoufoxConfigDialog({ @@ -26,6 +27,7 @@ export function CamoufoxConfigDialog({ onClose, profile, onSave, + isRunning = false, }: CamoufoxConfigDialogProps) { const [config, setConfig] = useState({ geoip: true, @@ -101,33 +103,37 @@ export function CamoufoxConfigDialog({ return ( - + - Configure Fingerprint Settings - {profile.name} + {isRunning ? "View" : "Configure"} Fingerprint Settings -{" "} + {profile.name} - +
- + - Cancel + {isRunning ? "Close" : "Cancel"} - - Save - + {!isRunning && ( + + Save + + )}
diff --git a/src/components/profile-data-table.tsx b/src/components/profile-data-table.tsx index 51fff9f..48e5cbb 100644 --- a/src/components/profile-data-table.tsx +++ b/src/components/profile-data-table.tsx @@ -1556,9 +1556,8 @@ export function ProfilesDataTable({ onClick={() => { meta.onConfigureCamoufox?.(profile); }} - disabled={isDisabled} > - Configure Fingerprint + Change Fingerprint )} | undefined; onChange: (value: Record | undefined) => void; title: string; + readOnly?: boolean; } -function ObjectEditor({ value, onChange, title }: ObjectEditorProps) { +function ObjectEditor({ + value, + onChange, + title, + readOnly = false, +}: ObjectEditorProps) { const [jsonString, setJsonString] = useState(""); useEffect(() => { @@ -45,6 +52,7 @@ function ObjectEditor({ value, onChange, title }: ObjectEditorProps) { }, [value]); const handleChange = (newValue: string) => { + if (readOnly) return; setJsonString(newValue); try { if (newValue.trim() === "" || newValue.trim() === "{}") { @@ -75,6 +83,7 @@ function ObjectEditor({ value, onChange, title }: ObjectEditorProps) { placeholder={`Enter ${title} as JSON`} className="font-mono text-sm" rows={6} + disabled={readOnly} /> ); @@ -86,6 +95,7 @@ export function SharedCamoufoxConfigForm({ className = "", isCreating = false, forceAdvanced = false, + readOnly = false, }: SharedCamoufoxConfigFormProps) { const [activeTab, setActiveTab] = useState( forceAdvanced ? "manual" : "automatic", @@ -174,7 +184,7 @@ export function SharedCamoufoxConfigForm({ } }; - const isEditingDisabled = isFingerprintEditingDisabled(config); + const isEditingDisabled = isFingerprintEditingDisabled(config) || readOnly; const renderAdvancedForm = () => (
@@ -187,6 +197,7 @@ export function SharedCamoufoxConfigForm({ onCheckedChange={(checked) => onConfigChange("randomize_fingerprint_on_launch", checked) } + disabled={readOnly} />
@@ -743,6 +755,7 @@ export function SharedCamoufoxConfigForm({ updateFingerprintConfig("webGl2:parameters", value) } title="WebGL2 Parameters" + readOnly={readOnly} /> @@ -759,6 +772,7 @@ export function SharedCamoufoxConfigForm({ updateFingerprintConfig("webGl:shaderPrecisionFormats", value) } title="WebGL Shader Precision Formats" + readOnly={readOnly} /> @@ -775,6 +789,7 @@ export function SharedCamoufoxConfigForm({ updateFingerprintConfig("webGl2:shaderPrecisionFormats", value) } title="WebGL2 Shader Precision Formats" + readOnly={readOnly} /> @@ -876,10 +891,18 @@ export function SharedCamoufoxConfigForm({ // Advanced mode only (for editing) renderAdvancedForm() ) : ( - + - Automatic - Manual + + Automatic + + + Manual + @@ -892,6 +915,7 @@ export function SharedCamoufoxConfigForm({ onCheckedChange={(checked) => onConfigChange("randomize_fingerprint_on_launch", checked) } + disabled={readOnly} />