Stack Exchange Network
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
The best answers are voted up and rise to the top
Userscript to set 'Activity' tab on profile as default tab
When the new profile page design was released, there was a feature request to make 'Activity' the default tab. Because this got declined, I built a userscript that redirects you to the 'Activity' tab if you have not yet manually selected a tab.
asked Apr 18, 2015 at 12:44
43133 silver badges1010 bronze badges
The following performs better:
@match is much less resource intensive than regex includes.
- Not all platforms support regex includes.
- Run at doc start so that don't have to wait for most of the page to load before redirecting.
location.replace so that browser history is not filled with junk pages and back button works as expected.
- All SE sites are matched. The redirect appears to do no harm on sites that don't have the new profile pages yet.
- Runs on Stack Overflow for Teams.
// @name Stack Exchange, 'Activity' tab as default
// @description A userscript that automatically shows the Activity tab as default on profile pages
// @match *://*.askubuntu.com/users/*
// @match *://*.mathoverflow.net/users/*
// @match *://*.serverfault.com/users/*
// @match *://*.stackapps.com/users/*
// @match *://*.stackexchange.com/users/*
// @match *://*.stackoverflow.com/users/*
// @match *://*.superuser.com/users/*
// @match *://*.stackoverflow.com/c/*/users/*
// @exclude *://*/review
// @exclude *://api.stackexchange.com/*
// @exclude *://blog.*.com/*
// @exclude *://chat.*.com/*
// @exclude *://data.stackexchange.com/*
// @exclude *://elections.stackexchange.com/*
// @exclude *://openid.stackexchange.com/*
// @exclude *://stackexchange.com/*
// @grant none
// @run-at document-start
// @version 2.0
// @history 2.0 Added support for Stack Overflow teams
// @author ProgramFOX and Brock Adams
// @homepage https://stackapps.com/q/6267/7653
/* eslint-disable no-multi-spaces */
if ( ! location.search &&
! location.hash &&
! /^chat\./.test (location.host) &&
! /\/users\/edit\/|\/login\b|\/flag-summary/.test (location.pathname)
location.replace (location.href + "?tab=topactivity");
answered Apr 18, 2015 at 14:13
Brock AdamsBrock Adams
12.8k55 gold badges3535 silver badges6262 bronze badges
You must log in to answer this question.
Not the answer you're looking for? Browse other questions tagged