|
|
@ -61,12 +61,12 @@ function isItemInStock() {
|
|
|
|
negateOutOfStockRegexs_r.push(new RegExp(negateOutOfStockRegexs[0], 'g'));
|
|
|
|
negateOutOfStockRegexs_r.push(new RegExp(negateOutOfStockRegexs[0], 'g'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const elementsToScan = Array.from(document.getElementsByTagName('*'));
|
|
|
|
const elementsWithZeroChildren = Array.from(document.getElementsByTagName('*')).filter(element => element.children.length === 0);
|
|
|
|
//const elementsWithZeroChildren = Array.from(document.getElementsByTagName('*')).filter(element => element.children.length === 0);
|
|
|
|
|
|
|
|
|
|
|
|
// REGEXS THAT REALLY MEAN IT'S IN STOCK
|
|
|
|
// REGEXS THAT REALLY MEAN IT'S IN STOCK
|
|
|
|
for (let i = elementsWithZeroChildren.length - 1; i >= 0; i--) {
|
|
|
|
for (let i = elementsToScan.length - 1; i >= 0; i--) {
|
|
|
|
const element = elementsWithZeroChildren[i];
|
|
|
|
const element = elementsToScan[i];
|
|
|
|
if (element.offsetWidth > 0 || element.offsetHeight > 0 || element.getClientRects().length > 0) {
|
|
|
|
if (element.offsetWidth > 0 || element.offsetHeight > 0 || element.getClientRects().length > 0) {
|
|
|
|
var elementText="";
|
|
|
|
var elementText="";
|
|
|
|
if (element.tagName.toLowerCase() === "input") {
|
|
|
|
if (element.tagName.toLowerCase() === "input") {
|
|
|
@ -87,8 +87,8 @@ function isItemInStock() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// OTHER STUFF THAT COULD BE THAT IT'S OUT OF STOCK
|
|
|
|
// OTHER STUFF THAT COULD BE THAT IT'S OUT OF STOCK
|
|
|
|
for (let i = elementsWithZeroChildren.length - 1; i >= 0; i--) {
|
|
|
|
for (let i = elementsToScan.length - 1; i >= 0; i--) {
|
|
|
|
const element = elementsWithZeroChildren[i];
|
|
|
|
const element = elementsToScan[i];
|
|
|
|
if (element.offsetWidth > 0 || element.offsetHeight > 0 || element.getClientRects().length > 0) {
|
|
|
|
if (element.offsetWidth > 0 || element.offsetHeight > 0 || element.getClientRects().length > 0) {
|
|
|
|
var elementText="";
|
|
|
|
var elementText="";
|
|
|
|
if (element.tagName.toLowerCase() === "input") {
|
|
|
|
if (element.tagName.toLowerCase() === "input") {
|
|
|
|