Browse Instagram Without Logging In (Removes login/register Pop-up and opens up links)

Removes annoying login/register popup when scrolling down a profile by adding an [ X ] button on the popup and allows you to see posts without logging on.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Browse Instagram Without Logging In (Removes login/register Pop-up and opens up links)
// @namespace    https://github.com/dankdave69
// @version      1.0
// @description  Removes annoying login/register popup when scrolling down a profile by adding an [ X ] button on the popup and allows you to see posts without logging on.
// @author       dankdave69
// @match        https://www.instagram.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var body = document.getElementsByTagName("body")[0];
    var popUp = document.getElementsByClassName("RnEpo  _Yhr4");
    var button = document.createElement('button');

    setInterval(function openLinks() {
        var list = document.querySelectorAll("a");
        for (var i = 0; i < list.length; i++) {
            list.item(i).onclick = function() {
                if (this.href.includes("/p/")){
                    location.href = this.href;
                }
            };
        };
    }, 0);

    function remove() {
        body.style.overflow = "visible";
        popUp[0].remove();
    };

    function appendButton() {
        var winX = document.documentElement.clientWidth;
        var winY = document.documentElement.clientHeight;
        var buttonX = (winX / 2) + 200 - 45;
        var buttonY = (winY / 2) - 235.5 + 18.5;

        button.style = "position:fixed; top:" + buttonY + "px; left:" + buttonX + "px; background-color: white; border: none; color: #8e8e8e; padding: 0px 0px; text-align: center; text-decoration: none; font-family: ; display: inline-block; font-size: 20px; margin: 0px 0px; cursor: pointer; width: 30px; height: 30px";
        button.innerHTML = "&#10006;"
        button.onclick = function() {
            remove();
        }

        popUp[0].appendChild(button);
    }

    function checkExist() {
        if (popUp.length > 0) {
            appendButton();
            window.addEventListener('resize', appendButton);
        };
    };

    setInterval(checkExist, 500);

})();