MacOS – Turn off WiFi if there is no user initiated network access

automationmacoswifi

I'd like to limit my exposure to the WiFi signal of my laptop while it is sitting on my belly or lower while being in bed.

Is there a way to auto-turn off the WiFi directly after a website has finished loading? And to only turn it back on when I click another link?

Best Answer

This is neither practical nor feasible.

Not practical.

So, in your scenario, the WiFi connection drops as soon as you load your webpage and theoretically, the computer is now waiting for you to click on something to reconnect. Here are just two (off the top of my head) problems with that scenario:

Auto Refresh A small piece of code embedded within the meta tags of the HTML code will auto refresh that page:

<meta http-equiv="refresh" content="5" >

This is equivalent to hitting refresh. How is the OS supposed to distinguish between a user generated refresh and one generated in meta? That's a lot of keyboard trapping.

HTTP Sessions. Depending on the website you visit, they may be employing the use of cookies that track user sessions - especially so if you log in. Once you disconnect from the network, your session will expire requiring a new login. There is no "trapping" on the client side for this because it's a server generated session/cookie.


Not feasible.

For all intents and purposes your network settings and your browser session are "sandboxed" from each other. Could you imagine the chaos you could cause by having an app or (worse) a browser's extension with the ability to affect the state of hardware based on what you click? This would be an attacker's dream scenario.

Additionally, WiFi (and Bluetooth) antennas are in the LCD enclosure, not the bottom of the laptop. So, unless you are wearing shorts made of lead or lined with a highly reflective material (reflecting out, of course), you are fully exposed to WiFi signals since they are omni directional.