1

I would like to stop a pop-up box from appearing on a webpage. Not a alertbox, but an actual box that pops up on mouseover. Take Gmail for example, if you hover over someones name a box would pop up with some information about that user. Using Gmail as an example, how would such a box be prevented from popping up? I have tried hiding the elements, but of course on mouseover they are unhidden anyway.

ComputerLocus
  • 3,448
  • 10
  • 47
  • 96
  • 1
    There is no one way! What you call a pop-up box can be implemented in several different ways and the approach to stopping it can be very page specific. **Give us a *specific* example** at a minimum. – Brock Adams Aug 07 '13 at 03:42
  • @BrockAdams There is an example case. – ComputerLocus Aug 07 '13 at 03:55
  • There is no example. Read the [faq], complete [this checklist Q&A](http://meta.stackexchange.com/questions/156810/stack-overflow-question-checklist) and edit your question. – Brock Adams Aug 07 '13 at 03:58

1 Answers1

1

A Greasemonkey question is probably better asked over at userscripts.org

Anyways... it seems like you just want to hide elements. CSS is probably the best way. There's a cool extension called Stylish that does this really well. Just use normal FF tools or Firebug to inspect what element pops up and try, using CSS rules, to hide it with Stylish. It's better that way, because dealing with Gmail using JavaScript could be really frustrating.

Joe Simmons
  • 1,828
  • 2
  • 12
  • 9
  • Did not answer the question I was asking. This may be a Greasemonkey question but the answer is about the Javascript to do this. – ComputerLocus Aug 07 '13 at 00:32
  • Well I suggested a better way to achieve your goal. – Joe Simmons Aug 07 '13 at 01:23
  • I understand there may be different/better ways of doing what I am trying to do, but I am not looking to use a different extension here. – ComputerLocus Aug 07 '13 at 01:33
  • Actually, the *Stylish* idea is an excellent approach -- especially for any of Google's sites (On FF. If using Chrome, you're probably SOL). Google uses "wooly" JS and a crap ton of iframes. For Stylish, you will have to employ the `!important` keyword for most cases. – Brock Adams Aug 07 '13 at 03:46
  • Ok, I understand. Well, there aren't any great ways to achieve this goal with JavaScript. 1) Add an interval to check if the elements you want to hide become visible again, which isn't a great method. 2) Have some sort of event listener to listen when your target element becomes visible again and hide it. Also not a great method, very laggy. 3) GM_addStyle, but this will only work if the element you wish to hide has some unique attribute that you can filter out with CSS selectors. Please understand that I'm trying to help, but also trying to suggest the easiest/most sane option. – Joe Simmons Aug 07 '13 at 03:48
  • I could help you more over at userscripts.org. If you pm me (JoeSimmons) there, we can have a better discussion. I still say Stylish is the best way, but GM_addStyle is basically the same thing, just a little delayed since user scripts run a little later than Stylish. I've been working with Greasemonkey since 2006, so I'm definitely familiar with it. – Joe Simmons Aug 07 '13 at 03:51