Skip to content

Instantly share code, notes, and snippets.

@PhilipDukhov
Created August 29, 2021 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PhilipDukhov/c65c7d590d73ec26d80a0d1d620b5a22 to your computer and use it in GitHub Desktop.
Save PhilipDukhov/c65c7d590d73ec26d80a0d1d620b5a22 to your computer and use it in GitHub Desktop.
UserScript
// ==UserScript==
// @name Stackoverflow visited status links fix
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @include /^https:\/\/.*stackoverflow\.com\/(search|questions\/tagged).+$/
// @icon https://www.google.com/s2/favicons?domain=stackoverflow.com
// @grant none
// @require http://code.jquery.com/jquery-3.x-git.min.js
// ==/UserScript==
/* globals $ */
$('.js-search-results .question-hyperlink, .js-search-results .answer-hyperlink').each(function() {
const $this = $(this);
const newHref = $this.attr('href').replace(/\?[^#]*/, '$1');
$this.attr('href', newHref).attr('data-searchsession', newHref);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment