Created
November 27, 2022 13:54
-
-
Save justdanpo/f5ec673039aea17540b2529a68976749 to your computer and use it in GitHub Desktop.
instagram-redirect-to-following
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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