Skip to content

Instantly share code, notes, and snippets.

Created January 17, 2018 08:04
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Filter Refurb Macs by GB and SSD: Small function to remove all refurbished macs that does not match the defined GB and SSD size
// paste and execute it into the browser console. You can define ( GB, SSD [, index-of-box-content-class ] )
// eventually there is a header then you can test the param index-of-box-content-class = 1
((_gb, _ssd, content_idx) => { const _wrp = document.getElementsByClassName("box-content")[ content_idx || 0];Array.from(document.getElementsByClassName("specs")).forEach((el) =>{if (!(el.innerHTML.indexOf(_gb.toString() + " GB") > 0 && el.innerHTML.indexOf(_ssd.toString() + " GB") > 0)) {_wrp.removeChild(el.parentNode.parentNode.parentNode)}})})(16,512)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment