0

I'm working on a Safari extension, and I'd like to detect when <applet>s are going to load (the onbeforeload event) on a page. However, there seems to be no such event for these.

How should I do it? Transform all <applet> tags to <object> tags and then intercept their onbeforeload events? I think it would break the document.applets collection, so it's not a very cool solution. Is there a better way?

zneak
  • 134,922
  • 42
  • 253
  • 328

2 Answers2

2

You can check that using JavaScript. The applet element in HTML DOM has an isActive() property. You can test that on intervals. You can find several basic examples here.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Hm, I realize I didn't ask for the right thing. The event I really want is `onbeforeload` rather than `onload`. Thanks though. Have this +1 anyways. – zneak Jun 11 '10 at 02:33
0

Since <applet> is not very subtle, I just hook on DOMContentLoaded and DOMNodeInserted to catch <applet>s as soon as I can. It's butchy but I don't think I can do any better.

zneak
  • 134,922
  • 42
  • 253
  • 328