AdguardTeam / AdGuardForSafari

AdGuard for Safari app extension
GNU General Public License v3.0
1.03k stars 72 forks source link

Run and close AdGuard with Safari #765

Open tommyrot10 opened 1 year ago

tommyrot10 commented 1 year ago

Dear AdGuard team,

Much as I appreciate AdGuard, I find it cumbersome activating it. The options to the user are for – automatically run it on login

I don't want the app running when I'm not using Safari. Manually enabling/disabling it is no terrible hardship, but it is tedious. Why can't it just run and close with Safari? Could you please work on that?

Thank you.

DanieleMagri commented 1 year ago

This is something I never understood, do we really need a separate app? Can't it be integrated into the extension itself? Why does it always have to be in background? It's a suspicious approach, is it collecting in background information about the device and its use and send it to the company?

ghost commented 7 months ago

Until the day this is or isn't implemented, below is an Apple Script that launches and quits both Safari and AdGuard for Safari at the same time.

tell application "System Events"
    set isRunning to count (every process whose name is "Safari")
end tell

if isRunning > 0 then
    tell application "Safari"
        quit
    end tell
    tell application "AdGuard for Safari"
        quit
    end tell
else
    tell application "Safari"
        activate
    end tell
    tell application "AdGuard for Safari"
        activate
    end tell
end if

Below is the application form of the above script, to use in place of running the script in Script Editor.

Safari + AdGuard for Safari.app.zip

ajholzbach commented 1 month ago

Another option for automating this would be to use macOS Shortcuts with a shortcut automation tool like Shortery. You can create two Shortcuts, one for launching AdGuard and one for quitting AdGuard, and two corresponding automations with Shortery that trigger the shortcuts when launching and quitting Safari.

Screenshot 2024-07-18 at 4 48 06 PM Screenshot 2024-07-18 at 4 42 25 PM

The main downside is that you need to install and use a third-party application like Shortery to get this to work, at least until Apple decides to add iOS-like Shortcut Automation to macOS. So far, this option seems to work quite well and utilizes only free features in Shortery.