Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lancehilliard/1353475392345d30cd20f53e6ee8bc61 to your computer and use it in GitHub Desktop.
Save lancehilliard/1353475392345d30cd20f53e6ee8bc61 to your computer and use it in GitHub Desktop.
[userscript] Change how certain Kroger products are displayed to make ClickList shopping easier
// ==UserScript==
// @name Kroger ClickList Products Display Changer
// @namespace cc.digitalcreations.kroger
// @version 0.1
// @downloadURL https://gist.github.com/lancehilliard/1353475392345d30cd20f53e6ee8bc61#file-kroger_clicklist_products_display_changer.js
// @description Change how certain Kroger products are displayed to make ClickList shopping easier
// @author lancehilliard
// @match https://www.kroger.com/products/*
// @grant none
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
(function() {
'use strict';
var productLinksToIgnore = [
'https://www.kroger.com/add/links/here/containing/thirteen-digit/UPCs/like/#############'
];
var scanForItems;
scanForItems = function() {
for (var i = 0; i < productLinksToIgnore.length; i++) {
var productLinkToIgnore = productLinksToIgnore[i];
var upc = productLinkToIgnore.match(/\d{13}/);
var $upcLink = $('a[href$="'+upc+'"]:not([upc_processed]');
if ($upcLink.length > 0) {
var $gridCell = $upcLink.closest('div.GridCell');
if ($gridCell.length > 0) {
$gridCell.find('div.ProductCard').css('border', '1px solid red');
$gridCell.parent().append($gridCell);
$upcLink.attr('upc_processed','true');
}
}
}
setTimeout(scanForItems, 1000);
};
scanForItems();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment