6

If someone messages me on Facebook while I'm reading in another tab, the Facebook title will keep flashing back and forth. It is distracting for me. I don't object to changing the title, I just prefer to make it static. Does anybody know how to disable this feature?

I found a question in Stack Overflow asking how to make it dynamic: How to create flashing page title effect like facebook?

2
  • Break the Facebook tab into its own window and minimise the window?
    – MrWhite
    Commented Mar 11, 2015 at 0:25
  • 1
    Not convenience. I'll return to it anyway, when I decide to do so. I just don't want it distracting me.
    – Ooker
    Commented Mar 11, 2015 at 0:33

1 Answer 1

3

I know, this is extremely annoying.

You can try this on Chrome. This worked for me (with a pinned tab), in February 2017.

Create folder somewhere on your hard drive and create these two files in it:

manifest.json

{
  "manifest_version": 2,
  "name": "Pinned Tab Flashing",
  "version": "1.0",
  "description": "Disable pinned tabs flashing",
  "content_scripts": [{
    "matches": ["https://www.messenger.com/*"],
    "js": ["content.js"]
  }]
}

content.js

function titleModified() {
  var text = document.getElementsByTagName('title')[0].text;
  if (text != 'Messenger') {
    document.getElementsByTagName('title')[0].text = 'Messenger';
  }
}

window.onload = function() {
  var titleEl = document.getElementsByTagName("title")[0];
  var docEl = document.documentElement;

  if (docEl && docEl.addEventListener) {
    docEl.addEventListener("DOMSubtreeModified", function(evt) {
      var t = evt.target;
      if (t === titleEl || (t.parentNode && t.parentNode === titleEl)) {
        titleModified();
      }
    }, false);
  } else {
    document.onpropertychange = function() {
      if (window.event.propertyName == "title") {
        titleModified();
      }
    };
  }
};

Navigate to chrome://extensions/, click on Load unpacked extension and choose the folder you created. Then refresh your Messenger page.

3
  • 1
    could this work on Firefox too?
    – Ooker
    Commented Feb 25, 2017 at 12:42
  • Yes most certainly. The code will likely work as-is, but you'll have to look up and follow how to make a Firefox extension. Commented Mar 6, 2017 at 1:19
  • The content.js can be made as an userscript. How to make this works in Facebook.com too?
    – Ooker
    Commented May 25, 2017 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.