3

The following simple script reverts the most significant one of the inbox ‘improvements’: it marks all inbox messages as read as soon as the inbox is closed.

// ==UserScript==
// @name     Stack Exchange: Automark as read
// @grant    none
// @match    https://*.stackexchange.com/*
// @match    https://*.superuser.com/*
// @match    https://*.stackoverflow.com/*
// @match    https://*.mathoverflow.net/*
// @match    https://*.serverfault.com/*
// @match    https://*.askubuntu.com/*
// @match    https://stackapps.com/*
// @exclude  https://chat.stackexchange.com/*
// @exclude  https://api.stackexchange.com/*
// @exclude  https://data.stackexchange.com/*
// @exclude  https://openid.stackexchange.com/*
// @exclude  https://area51.stackexchange.com/*
// @exclude  https://stackexchange.com/*
// @exclude  https://contests.stackoverflow.com/*
// @exclude  /^https?:\/\/winterbash\d{4,}\.stackexchange\.com\//
// ==/UserScript==

document.querySelector('.js-inbox-button').addEventListener('click', ev => {
  const target = ev.target.closest('.js-inbox-button');
  if (target.getAttribute('aria-expanded') === 'false')
    return;
  const markButton = document.querySelector('.js-mark-all-as-read');
  if (markButton.disabled)
    return;
  markButton.click();
}, true);

0

You must log in to answer this question.

Browse other questions tagged .