Untitled

mail@pastecode.io avatar
unknown
javascript
7 months ago
820 B
4
Indexable
Never
function isKosher(obj) {
	try {
	  	return obj.ariaLabel.includes("כשר") || 
			obj.text.includes("כשר") || 
			obj.ariaLabel.toLowerCase().includes("kosher") || 
			obj.text.toLowerCase().includes("kosher");
	} catch (error) {
	  	return true;
	}

}

function setBorders(){
	restaurants = document.querySelectorAll('[href*="/restaurant/"]');
	restaurants.forEach((item) => {
		if (!isKosher(item)) {
			item.style.borderStyle = "solid";
			item.style.borderColor = "gold";
			item.style.borderWidth = "10px";
			item.style.borderRadius = "15px";
		}
	});
}


addEventListener("scroll", (event) => {
	setBorders();
});

window.addEventListener('load', function () {
 	setBorders();
 	setTimeout(setBorders, 1000);
 	setTimeout(setBorders, 2000);
 	setTimeout(setBorders, 5000);
 	setTimeout(setBorders, 10000);
});