Skip to content

Instantly share code, notes, and snippets.

@noromanba
Last active June 18, 2021 20:25
Show Gist options
  • Save noromanba/1f369b316c1b43bdf0e337c6c5af1c80 to your computer and use it in GitHub Desktop.
Save noromanba/1f369b316c1b43bdf0e337c6c5af1c80 to your computer and use it in GitHub Desktop.
hidden user comments on instagram.com for UserScript
// ==UserScript==
// @name IG denoiser
// @namespace https://noromanba.github.com
// @description hidden user comments on instagram.com for UserScript
// @include https://www.instagram.com/*
// @grant none
// @noframes
// @run-at document-start
// @version 2019.5.28.1
// @homepage https://gist.github.com/noromanba/1f369b316c1b43bdf0e337c6c5af1c80
// @downloadURL https://gist.github.com/noromanba/1f369b316c1b43bdf0e337c6c5af1c80/raw/ig-denoiser.user.js
// @license MIT License https://nrm.mit-license.org/2018
// @author noromanba https://noromanba.github.com
// @icon https://upload.wikimedia.org/wikipedia/commons/thumb/4/45/Pictograms-nps-water-fish_hatchery-2.svg/500px-Pictograms-nps-water-fish_hatchery-2.svg.png
// ==/UserScript==
// Icon (PD by NPS Graphics, converted by User:ZyMOS)
// https://commons.wikimedia.org/wiki/File%3APictograms-nps-water-fish_hatchery-2.svg
// Devel
// https://gist.github.com/noromanba/1f369b316c1b43bdf0e337c6c5af1c80
// Bookmarklet
// http://let.hatelabo.jp/noromanba/let/hLHU7oetyNxA
/* filter; uBO et al.
www.instagram.com##article ul ul:not(:first-child)
! mobile
www.instagram.com##article ul li[role="menuitem"]:not(:first-child)
*/
/* selector
article ul ul:not(:first-child)
article ul li[role="menuitem"]:not(:first-child)
*/
// e.g.
// https://www.instagram.com/instagram/
// https://www.instagram.com/p/Bi0bUMBDaZZ/?taken-by=instagram
// https://www.instagram.com/tofubeats/
// https://www.instagram.com/p/BiTlSowHP2x/?taken-by=tofubeats
(() => {
'use strict';
if (!location.hostname.endsWith('.instagram.com')) {
return;
}
const wall = document.head || document.body || document.documentElement;
wall.append(Object.assign(document.createElement('style'), {
charset: 'utf-8',
textContent: `
article ul ul:not(:first-child),
/* mobile */
article ul li[role="menuitem"]:not(:first-child)
{
display: none;
}
`,
}));
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment