mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-09-24 02:10:49 +02:00
refactor: don\'t allow camoufox to open links inside running instances
This commit is contained in:
@@ -239,8 +239,6 @@ export function ProfileSelectorDialog({
|
|||||||
<SelectContent>
|
<SelectContent>
|
||||||
{profiles.map((profile) => {
|
{profiles.map((profile) => {
|
||||||
const isRunning = runningProfiles.has(profile.name);
|
const isRunning = runningProfiles.has(profile.name);
|
||||||
const isLaunching = launchingProfiles.has(profile.name);
|
|
||||||
const isStopping = stoppingProfiles.has(profile.name);
|
|
||||||
const canUseForLinks =
|
const canUseForLinks =
|
||||||
browserState.canUseProfileForLinks(profile);
|
browserState.canUseProfileForLinks(profile);
|
||||||
const tooltipContent = getProfileTooltipContent(profile);
|
const tooltipContent = getProfileTooltipContent(profile);
|
||||||
@@ -289,16 +287,6 @@ export function ProfileSelectorDialog({
|
|||||||
Running
|
Running
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
{isLaunching && (
|
|
||||||
<Badge variant="outline" className="text-xs">
|
|
||||||
Launching
|
|
||||||
</Badge>
|
|
||||||
)}
|
|
||||||
{isStopping && (
|
|
||||||
<Badge variant="outline" className="text-xs">
|
|
||||||
Stopping
|
|
||||||
</Badge>
|
|
||||||
)}
|
|
||||||
{!canUseForLinks && (
|
{!canUseForLinks && (
|
||||||
<Badge
|
<Badge
|
||||||
variant="destructive"
|
variant="destructive"
|
||||||
|
|||||||
@@ -117,6 +117,10 @@ export function useBrowserState(
|
|||||||
return isRunning;
|
return isRunning;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (profile.browser === "camoufox" && isRunning) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// For other browsers, any profile can be used
|
// For other browsers, any profile can be used
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
@@ -220,6 +224,7 @@ export function useBrowserState(
|
|||||||
|
|
||||||
if (canUseForLinks) return null;
|
if (canUseForLinks) return null;
|
||||||
|
|
||||||
|
const isRunning = runningProfiles.has(profile.name);
|
||||||
const isLaunching = launchingProfiles?.has(profile.name) ?? false;
|
const isLaunching = launchingProfiles?.has(profile.name) ?? false;
|
||||||
const isStopping = stoppingProfiles?.has(profile.name) ?? false;
|
const isStopping = stoppingProfiles?.has(profile.name) ?? false;
|
||||||
const isBrowserUpdating = isUpdating?.(profile.browser) ?? false;
|
const isBrowserUpdating = isUpdating?.(profile.browser) ?? false;
|
||||||
@@ -251,6 +256,10 @@ export function useBrowserState(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (profile.browser === "camoufox" && isRunning) {
|
||||||
|
return "Anti-detect profiles can only open links on first launch";
|
||||||
|
}
|
||||||
|
|
||||||
return "This profile cannot be used for opening links right now.";
|
return "This profile cannot be used for opening links right now.";
|
||||||
},
|
},
|
||||||
[
|
[
|
||||||
|
|||||||
Reference in New Issue
Block a user