• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Safari
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Safari


  • Subject: Safari
  • From: Alex Zavatone <email@hidden>
  • Date: Wed, 03 Apr 2013 12:00:45 -0400

On my Mac, Safari has proven itself time and again, to be the king of bloat and of processor hogging.

It's not Safari per se, but the individual JavaScript routines on each web page that end up not properly disposing of old variables (WHY is it using 5.56 GB of RAM?) and chugging away  at 100% on two cores while in the background.

In evaluating this situation, it becomes obvious that
1. it's in the background. Why the hell is the javascript engine still running at full blast?
2. it's in the background.  I don't need it to do anything at all.

Immediately, I think that a process to detect when the app moves to the background and disable Javascript from the Develop menu is an easy approach.

In the past, I grabbed the PIDs of the Safari and Safari Web Content processes and issued kill -SIGSTOP and kill SIGCONT to manage both processes, but this would be easier.

Looking over my old code, I see that I never found out how to detect when the app moved to the background or the foreground.

In Objective C, in an app delegate, there are these methods to detect from within an app, whether it is becoming frontmost or moving to the background:
– applicationDidEnterBackground:
– applicationWillEnterForeground:
– applicationDidBecomeActive:
– applicationWillResignActive:

Is there a method to do this from Applescript on an event basis? I'd rather get an event than poll System Events for   Is this a condition better detected from a Safari plugin?

Thanks in advance.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


  • Follow-Ups:
    • Re: Safari
      • From: Luther Fuller <email@hidden>
    • Re: Safari
      • From: Alex Zavatone <email@hidden>
  • Prev by Date: Re: Refresh Finder view?
  • Next by Date: Re: Refresh Finder view?
  • Previous by thread: Re: Refresh Finder view?
  • Next by thread: Re: Safari
  • Index(es):
    • Date
    • Thread