Greasy Fork is available in English.

Instagram - naviguer non-identifié

Retire les message et dialogue d'inscription. Débloque tous les liens de la page.

Version au 2020-05-13 18:43:33 UTC. Voir la dernière version.

// ==UserScript==
// @name         Instagram - browse not logged
// @name:fr      Instagram - naviguer non-identifié
// @namespace    https://github.com/Procyon-b
// @version      0.2
// @description  Remove message and popup. Unlock all links on the page.
// @description:fr  Retire les message et dialogue d'inscription. Débloque tous les liens de la page.
// @author       Achernar
// @match        https://www.instagram.com/*
// @grant        none
// ==/UserScript==

(function() {
"use strict";

// find newly added links
var obs=new MutationObserver(function(muts){
  for (let mut of muts) {
    for (let n of mut.addedNodes) {
      if (n.classList.contains('Nnq7C')) fixLinks(n);
      }
    }
  });

obs.observe(document.body, {attributes: false, childList: true, subtree: true});

function openLink(ev) {
  this.cloneNode(false).dispatchEvent(new MouseEvent('click',ev));
}

function fixLinks(r) {
  (r || document.body).querySelectorAll(':scope a[href^="/"]').forEach(function(e){
    if (!e.sclk) {
      e.sclk=true;
      e.addEventListener('click',openLink);
      }
    });
  }

// fix links already on page
setTimeout(fixLinks,2000);
// page lazy to load?
setTimeout(fixLinks,10000);
setTimeout(fixLinks,20000);

// hide message & popup
var st=document.createElement("style");
st.textContent='[style="width: 100%;"][class*="         "] {display: none;} body[style*="overflow"] {overflow: initial !important;} body[style*="overflow"] > div[role="presentation"] {display: none;}@keyframes hidestart{from {width: 0;} to {width: ;} }body>div[role="presentation"] {animation-name: hidestart;animation-timing-function: step-end;animation-duration: 1s;}';
document.head.appendChild(st);

})();