🏠 返回首頁 

MetaFilter highlight selected comment

On MetaFilter.com, adds a border to the selected comment to make it stand out visually, and adds "selected comment" to the small text to make it easy to search if you lose your place.

These are versions of this script where the code was updated. Show all versions.

  • v14 2023-01-18

    Updated to work with a change to MetaFilter's HTML. Used to use

    divToHighlight.lastChild.innerHTML += '<span class=\'tehhundUserScriptCommentCount\'>Comment ' + (i+1) + ' of ' + allCommentDivs.length + '. </span>';

    now uses

    divToHighlight.querySelector('.smallcopy').innerHTML += '<span class=\'tehhundUserScriptCommentCount\'>Comment ' + (i+1) + ' of ' + allCommentDivs.length + '. </span>';

  • v13 2020-03-15 Removing @run-at as it's not guaranteed to work, and @locale because Greasemonkey's editor thinks it's erroneous.
  • v12 2019-09-04 Making the script more efficient by using the HashChangeEvent API to target only the comment divs that are affected by the URL hash change instead of iterating over all the comment Divs.
  • v11 2019-08-21 Changing @match to a single pattern.
  • v10 2019-08-21 Adding an explicit @run-at document-idle, and fixing some code formatting.
  • v9 2019-08-12
  • v8 2019-08-12
  • v7 2019-08-12
  • v6 2019-08-09
  • v5 2019-08-09
  • v4 2019-08-09
  • v3 2019-08-09
  • v2 2019-08-09
  • v1 2019-08-09