About
This Greasemonkey script enables you to hide questions you don't want to see. At the moment Stack Overflow gives you the option to "dim" or hide questions with ignored-tags but doesn't allow you to tag individual questions in your lists. This plugin does just that.
Download
userscript-mirror.org - screenshots also available from this link.
Screenshot / Code Snippet
Full code, screenshots, usage and description available here
try {
if(!(hiddenQuestions=JSON.parse(GM_getValue('so-hidden-questions','[]'))))
throw 'Invalid store questions: '+hiddenQuestions;
console.log(hiddenQuestions);
} catch(e) {
console.log(e);
GM_setValue('so-hidden-questions',JSON.stringify([]));
}
if( $('#question').length ) {
$('#hmenus .mainnavs ul').append('<li><a href="#" id="nav-hidden-hide">Hide</a></li>');
$('#nav-hidden-hide').click(function(){
hiddenQuestions.push($('#question').attr('data-questionid'));
setTimeout(function(){GM_setValue('so-hidden-questions',JSON.stringify(hiddenQuestions))},0);
window.location = document.referrer;
return false;
});
//...
}
License
Distributed under the BSD License
Platform
Tested on Windows 7, Firefox 21.0, Greasemonkey 1.9
Contact
Created & maintained by Precastic. Contact me through my Stack Overflow profile.
Code
Written in javascript, using jQuery, running in Greasemonkey. All contributions are welcome. Please contact me for more info.
This is my first Greasemonkey script and I struggled a bit with the limitations of the standbox, so have probably used questionable code in some places like unsafeWindow.jQuery
. This will be updated as needed in the coming versions.
Future Enhancements
- I would like to implement an "ignored-on" timestamp so that old questions can be flushed without clearing all hidden questions when the user clears their hidden questions. This will help with performance without needing the user to start he/her list over.
- I would like to align this better with the look & feel of SO's ignore tags functionality, giving it a more Stack Overflow-like feel.