PageSourceSearch

https://www.mahico.com/wp-content/themes/listify-child/whatsapp-button.js

js mahico.com collected 2026-10-05 21:33:40 UTC 1,743 bytes, 36 lines download raw bytes

1function addWhatsAppButton() {
2    // Obtener la hora actual
3    var fechaActual = new Date();
4    var hora = fechaActual.getHours();
5    var dia = fechaActual.getDay(); // 0 es domingo, 1 es lunes, ..., 6 es sábado
6    
7    // Verificar si la hora actual está entre las 9:00 y las 17:00 y si es un día laborable (de lunes a viernes)
8    if (hora >= 9 && hora < 17 && dia >= 1 && dia <= 5) {
9        // Buscar la cadena 'tel:' en el contenido de la página
10        if (document.body.innerHTML.includes("tel:")) {
11            // Crear el enlace de WhatsApp
12            var whatsappLink = document.createElement('a');
13            whatsappLink.href = 'https://wa.me/34677620001?text=Hola,%20he%20visto%20tu%20web%20y%20quiero%20'; // Reemplaza con tu número de WhatsApp
14            whatsappLink.target = '_blank';
15            whatsappLink.style.position = 'fixed';
16            whatsappLink.style.bottom = '20%';
17            whatsappLink.style.right = '20px';
18            whatsappLink.style.zIndex = '1000';
19
20            // Crear el ícono de WhatsApp
21            var whatsappIcon = document.createElement('img');
22            whatsappIcon.src = 'https://rawcdn.githack.com/rafaelbotazini/floating-whatsapp/3d18b26d5c7d430a1ab0b664f8ca6b69014aed68/whatsapp.svg'; // Reemplaza con la ruta de tu icono
23            whatsappIcon.alt = 'WhatsApp';
24            whatsappIcon.style.width = '60px'; // Ajusta el tamaño según necesites
25
26            // Añadir el ícono al enlace
27            whatsappLink.appendChild(whatsappIcon);
28
29            // Añadir el enlace al cuerpo del documento
30            document.body.appendChild(whatsappLink);
31        }
32    }
33}
34
35// Llamar a la función cuando la página haya cargado
36window.onload = addWhatsAppButton;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.