Skip to content

Commit

Permalink
Update Instagram_-_visible_images_counter.user.js
Browse files Browse the repository at this point in the history
Updated 'hrefselems' selector.
  • Loading branch information
darkred committed Feb 23, 2024
1 parent 518f5bc commit dce253e
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name Instagram - visible images counter
// @namespace darkred
// @version 2023.9.27
// @version 2024.2.23
// @description Shows in instagram profile pages how many images out of total (as a number and as a percentage) are currently visible, as you scroll down the page.
// @author darkred
// @license MIT
Expand Down Expand Up @@ -56,7 +56,8 @@ function showCounter() {

// hrefselems = document.querySelectorAll(`a[href*='taken-by']`);
// hrefselems = document.querySelectorAll(`._aabd._aa8k._aanf > a`);
hrefselems = document.querySelectorAll(`._aabd._aa8k._al3l > a`);
// hrefselems = document.querySelectorAll(`._aabd._aa8k._al3l > a`);
hrefselems = document.querySelectorAll(`._aabd._aa8k.x2pgyrj > a`);
$.each(hrefselems, function(index, value) {
// hrefs.indexOf(String(value)) === -1 ? hrefs.push(String(value)) : console.log("This item already exists"); // https://stackoverflow.com/a/36683363
if (hrefs.indexOf(String(value)) === -1) { // hrefs.count -below- serves as a counter for the newly added displayed images (on each infinite scrolling event)
Expand Down Expand Up @@ -139,10 +140,12 @@ var observer;
// var avatarSelector = 'h1.rhpdm'; // the profile name element
// var avatarSelector = 'span.-nal3'; // the 'posts' count element, e.g. 683 posts
// var avatarSelector = 'ul.k9GMp'; // the profile's 3 counters container element
// var avatarSelector = '.eC4Dz'; // the profile's username container element
// var avatarSelector = '._aa_m'; // the profile's username container element
// var avatarSelector = '._aa_c'; // the profile's username container element
var avatarSelector = '.x1q0g3np.x2lah0s.x8j4wrb'; // the profile's username container element
// var avatarSelector = '.eC4Dz'; // the profile's username container element
// var avatarSelector = '._aa_m'; // the profile's username container element
// var avatarSelector = '._aa_c'; // the profile's username container element
// var avatarSelector = 'main > article > header > section > div._ienqf > div > button'; // the 3-dots icon
// var avatarSelector = 'div[style="flex-direction: column; padding-bottom: 0px; padding-top: 0px;"]'; // the 3-dots icon
var avatarSelector = '.x1q0g3np.x2lah0s.x8j4wrb'; // the 3-dots icon



Expand Down

0 comments on commit dce253e

Please sign in to comment.