Skip to content

Instantly share code, notes, and snippets.

@justdanpo
Created November 27, 2022 13:54
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 justdanpo/f5ec673039aea17540b2529a68976749 to your computer and use it in GitHub Desktop.
Save justdanpo/f5ec673039aea17540b2529a68976749 to your computer and use it in GitHub Desktop.
instagram-redirect-to-following
// ==UserScript==
// @name instagram-redirect-to-following
// @namespace https://gist.github.com/justdanpo
// @version 0.1
// @description instagram-redirect-to-following
// @author den_po
// @match https://*.instagram.com/*
// @run-at document-end
// @grant none
// ==/UserScript==
(function () {
function checkRedirect() {
if (window.location.href == 'https://www.instagram.com/') {
window.location.replace('https://www.instagram.com/?variant=following')
}
}
const observer = new MutationObserver(function (mutations) {
if (mutations.length) checkRedirect()
})
observer.observe(document.querySelector("body"), { childList: true, subtree: false })
checkRedirect()
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment