View Instagram Without Login

View Instagram without login via imginn.com

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         View Instagram Without Login
// @namespace    bitst0rm
// @version      0.0.3
// @description  View Instagram without login via imginn.com
// @author       bitst0rm
// @license      WTFPL
// @icon         https://github.com/bitst0rm-pub/View-Instagram/raw/master/logo.png
// @match        https://www.instagram.com/*
// @match        http://www.instagram.com/*
// @run-at       document-start
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    if (window.document.cookie.indexOf("ds_user_id") == -1) {
        var go = function() {
            var p = window.location.pathname.split("/");
            if (/^((?!(accounts|developer|about|legal|explore|directory|stories|reel)).)*$/.test(p[1]) && p.length > 2 && p[1] !== "p") {
                window.location.replace("https://imginn.com/" + p[1] + "/?lang=" + window.navigator.languages[0].split("-")[0]);
            }
            if (p[1] == "p") {
                window.location.replace("https://imginn.com" + window.location.pathname)
            }
        };

        (function(old) {
            window.history.pushState = function() {
                old.apply(window.history, arguments);
                go();
            };
        })(window.history.pushState);

        go();
    }
})();