Write-Host "=== MOZILLA FIREFOX NOTIFICATION RESTORATION SCRIPT ===" -ForegroundColor Cyan # 1. Remove Firefox Enterprise Registry Policy (Restores user control over prompts) Write-Host "[+] Removing Registry Policies to unblock notification settings..." -ForegroundColor Windows $RegistryPaths = @( "HKLM:\SOFTWARE\Policies\Mozilla\Firefox\Permissions\Notifications", "HKCU:\SOFTWARE\Policies\Mozilla\Firefox\Permissions\Notifications" ) foreach ($RegPath in $RegistryPaths) { if (Test-Path $RegPath) { # Check if the specific configuration value exists if (Get-ItemProperty -Path $RegPath -Name "BlockNewRequests" -ErrorAction SilentlyContinue) { Remove-ItemProperty -Path $RegPath -Name "BlockNewRequests" -Force -ErrorAction SilentlyContinue Write-Host " -> Removed 'BlockNewRequests' policy from: $RegPath" -ForegroundColor Green } # Clean up empty parent policy keys recursively if they contain no other enterprise settings $CurrentPath = $RegPath while ($CurrentPath -ne "HKLM:\SOFTWARE\Policies" -and $CurrentPath -ne "HKCU:\SOFTWARE\Policies") { if (Test-Path $CurrentPath) { $SubKeys = Get-ChildItem -Path $CurrentPath -ErrorAction SilentlyContinue $Values = Get-ItemProperty -Path $CurrentPath -ErrorAction SilentlyContinue | Get-Member -MemberType NoteProperty if (-not $SubKeys -and -not $Values) { Remove-Item -Path $CurrentPath -Force -ErrorAction SilentlyContinue # Move up one level to see if the parent is now also empty $CurrentPath = Split-Path $CurrentPath } else { break } } else { break } } } } # 2. Close running Firefox processes to ensure settings apply cleanly Write-Host "`n[+] Terminating running Mozilla Firefox instances to apply changes..." -ForegroundColor Windows $FFProcesses = Get-Process -Name "firefox" -ErrorAction SilentlyContinue if ($FFProcesses) { Stop-Process -Name "firefox" -Force Start-Sleep -Seconds 2 Write-Host " -> Firefox processes closed." -ForegroundColor Yellow } Write-Host "`n=== RECONFIG COMPLETE ===" -ForegroundColor Cyan Write-Host "The global notification block has been removed. Firefox will now default back to asking the user for notification permissions." -ForegroundColor Green