@echo off title Limpeza de Permissões de Notificações - Navegadores color 0A :menu cls echo ================================================ echo LIMPAR PERMISSOES DE NOTIFICACOES echo ================================================ echo. echo Selecione o navegador: echo. echo 1 - Google Chrome echo 2 - Microsoft Edge echo 3 - Mozilla Firefox echo 4 - Limpar TODOS echo 0 - Sair echo. set /p opcao=Digite a opcao desejada: if "%opcao%"=="1" goto chrome if "%opcao%"=="2" goto edge if "%opcao%"=="3" goto firefox if "%opcao%"=="4" goto todos if "%opcao%"=="0" exit goto menu :: ============================ :: LIMPAR GOOGLE CHROME :: ============================ :chrome echo. echo Fechando Chrome... taskkill /IM chrome.exe /F >nul 2>&1 set pref_file=%LOCALAPPDATA%\Google\Chrome\User Data\Default\Preferences call :limpar_chromium "%pref_file%" pause goto menu :: ============================ :: LIMPAR MICROSOFT EDGE :: ============================ :edge echo. echo Fechando Edge... taskkill /IM msedge.exe /F >nul 2>&1 set pref_file=%LOCALAPPDATA%\Microsoft\Edge\User Data\Default\Preferences call :limpar_chromium "%pref_file%" pause goto menu :: ============================ :: LIMPAR MOZILLA FIREFOX :: ============================ :firefox echo. echo Fechando Firefox... taskkill /IM firefox.exe /F >nul 2>&1 set firefox_dir=%APPDATA%\Mozilla\Firefox\Profiles for /d %%a in ("%firefox_dir%\*") do ( if exist "%%a\permissions.sqlite" ( echo Perfil encontrado: %%a set ffdb="%%a\permissions.sqlite" where sqlite3 >nul 2>&1 if %errorlevel%==0 ( echo Removendo permissoes via sqlite3... sqlite3 %ffdb% "DELETE FROM permissions WHERE type='desktop-notification';" ) else ( echo sqlite3 nao encontrado. Removendo arquivo permissions.sqlite... del /f /q %%a\permissions.sqlite ) ) ) echo Firefox limpo. pause goto menu :: ============================ :: LIMPAR TODOS :: ============================ :todos call :chrome call :edge call :firefox goto menu :: ============================ :: FUNCAO LIMPAR CHROMIUM :: ============================ :limpar_chromium set pref_file=%~1 if exist "%pref_file%" ( echo Limpando notificacoes em: %pref_file% powershell -NoLogo -NoProfile -Command ^ "$file = '%pref_file%';" ^ "$json = Get-Content $file -Raw | ConvertFrom-Json;" ^ "if (-not $json.profile) { $json | ConvertTo-Json -Depth 100 | Set-Content $file -Encoding UTF8; exit }" ^ "if (-not $json.profile.content_settings) { $json.profile | Add-Member -Name content_settings -Value @{exceptions=@{notifications=@{}}} -MemberType NoteProperty }" ^ "if (-not $json.profile.content_settings.exceptions) { $json.profile.content_settings | Add-Member -Name exceptions -Value @{notifications=@{}} -MemberType NoteProperty }" ^ "$json.profile.content_settings.exceptions.notifications = @{};" ^ "$json | ConvertTo-Json -Depth 100 | Set-Content $file -Encoding UTF8" ) else ( echo Arquivo nao encontrado: %pref_file% ) exit /b