How to exclude iframe in Greasemonkey or Tampermonkey?

I put this at the top of my scripts to avoid running on frames or iframes:

if (window.top != window.self)  //don't run on frames or iframes
    return;

Leave a Comment