What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 130 Stack Exchange communities.

How do I disable all the popups appearing on the top of Stack Exchange sites? It's those bars saying stuff like: You've earned "Student" and 1 other badge. See your profile.

This doesn't seem to work:

// ==UserScript==
// @name          Hide popups
// @include       http://*stackoverflow.com/*
// @include       http://*superuser.com/*
// @include       http://*serverfault.com/*
// @include       http://*stackapps.com/*
// @include       http://*stackexchange.com/*
// @include       http://*askubuntu.com/*
// @version       1.0
// @namespace     hide popups
// ==/UserScript==
var style = document.createElement("style");
style.type = "text/css";
style.textContent = "#notify--1 { visibility: hidden !important; }";
document.body.appendChild(style);

I think this adblock filter doesn't work: meta.stackoverflow.com##[id*="notify-"]

share|improve this question
    
How about Stylish or AdBlock? Also, define Popup. –  Time Traveling Bobby Dec 28 '11 at 8:28
5  
note that once you earn 100+ rep many of these (simple bronze badges mostly) are suppressed network wide. –  Jeff Atwood Dec 28 '11 at 9:09
3  
These are more accurately notifications, generally it's only called a pop up if it opens another window –  Ben Brocka Dec 28 '11 at 14:36
2  
I thought these were toasts. –  jwiscarson Dec 28 '11 at 16:44

1 Answer 1

up vote 2 down vote accepted

User Script

I have just received a notification message, and constructed a script that visually hides these messages. At the top of the script, I have also added code to mark the message as read.

The code utilises jQuery, which is embedded on each page at the Stack Exchange.

// ==UserScript==
// @name          Hide notification messages
// @description   Hide notification messages at the Stack Exchange network
// @match         http://stackoverflow.com/*
// @match         http://meta.stackoverflow.com/*
// @match         http://superuser.com/*
// @match         http://meta.superuser.com/*
// @match         http://serverfault.com/*
// @match         http://meta.serverfault.com/*
// @match         http://askubuntu.com/*
// @match         http://meta.askubuntu.com/*
// @match         http://*.stackexchange.com/*
// @match         http://answers.onstartups.com/*
// @match         http://meta.answers.onstartups.com/*
// @match         http://stackapps.com/*
// @version       3.0
// @namespace     Rob W
// ==/UserScript==

var $ = unsafeWindow.jQuery;
if ($) {
    // This part will mark the message as read
    $("a[href*=mark-as-read]").each(function(){
        $.ajax(this.href);
    });

    // Remove the notification message
    $("#notify-container").hide().closest('body').css('marginTop',0);
}

User Style (Stylish)

The Stylish extension is more useful for this purpose. Create a new User Style, and add the following code:

@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document domain("stackoverflow.com"),
               domain("superuser.com"),
               domain("serverfault.com"),
               domain("stackapps.com"),
               domain("stackexchange.com"),
               domain("askubuntu.com"),
               domain("answers.onstartups.com") {
  body {
      margin-top: 0 !important;
  }
  #notify-container {
      display: none !important;
  }
}
share|improve this answer
1  
They both don't work. They might be working on some other of my firefox installations, but on these few they don't. Have you tested it? –  nnn Apr 24 '12 at 16:55
    
@nnn Thanks for the notice. I've updated and tested both versions, they work now. –  Rob W Apr 24 '12 at 20:28
    
You may want to post this script on GitHub Gist and add a StackApps page for it (see this comment thread ). This way users can one-click install. –  Manishearth May 11 '12 at 6:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .