@ -75,6 +75,7 @@ function isItemInStock() {
'vergriffen' ,
'vorbestellen' ,
'vorbestellung ist bald möglich' ,
'we don\'t currently have any' ,
'we couldn\'t find any products that match' ,
'we do not currently have an estimate of when this product will be back in stock.' ,
'we don\'t know when or if this item will be back in stock.' ,
@ -173,7 +174,7 @@ function isItemInStock() {
const element = elementsToScan [ i ] ;
// outside the 'fold' or some weird text in the heading area
// .getBoundingClientRect() was causing a crash in chrome 119, can only be run on contentVisibility != hidden
if ( element . getBoundingClientRect ( ) . top + window . scrollY >= vh + 1 50 || element . getBoundingClientRect ( ) . top + window . scrollY <= 1 00) {
if ( element . getBoundingClientRect ( ) . top + window . scrollY >= vh + 2 50 || element . getBoundingClientRect ( ) . top + window . scrollY <= 2 00) {
continue
}
elementText = "" ;
@ -187,7 +188,7 @@ function isItemInStock() {
// and these mean its out of stock
for ( const outOfStockText of outOfStockTexts ) {
if ( elementText . includes ( outOfStockText ) ) {
console . log ( ` Selected 'Out of Stock' - found text " ${ outOfStockText } " - " ${ elementText } " ` )
console . log ( ` Selected 'Out of Stock' - found text " ${ outOfStockText } " - " ${ elementText } " - offset top ${ element . getBoundingClientRect ( ) . top } , page height is ${ vh } ` )
return outOfStockText ; // item is out of stock
}
}