From 2329cdec0bebb77b9ff1fbec948c6505a7bce6e6 Mon Sep 17 00:00:00 2001 From: izidorio Date: Thu, 23 Dec 2021 15:17:15 -0300 Subject: [PATCH] fix modal --- README.md | 2 +- manifest.json | 2 +- src/js/models/scraping.js | 22 ++++++++++++++-------- src/js/models/setButtons.js | 3 ++- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 4b91894..ef8fc1a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Uma extensão para o navegador Chrome que baixa em .csv ou copia para a área de ### Para instalar a extensão -1. Baixe o arquivo [addon-zappul.zip clicando aqui neste link](https://github.com/izidorio/addon-zappull/releases/download/0.5.4/addon-zappull.zip) +1. Baixe o arquivo [addon-zappul.zip clicando aqui neste link](https://github.com/izidorio/addon-zappull/releases/download/0.5.6/addon-zappull.zip) 2. Descompacte o arquivo baixado. diff --git a/manifest.json b/manifest.json index 01301ff..4e047af 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "ZapPull", - "version": "0.5.4", + "version": "0.5.6", "description": "Extensão que baixa em .csv ou copia para a área de transferência os participantes dos Grupos do WhatsApp. https://github.com/izidorio/addon-zappull", "author": "Izidorio Bento ", "icons": { diff --git a/src/js/models/scraping.js b/src/js/models/scraping.js index b632b67..87156dc 100644 --- a/src/js/models/scraping.js +++ b/src/js/models/scraping.js @@ -17,13 +17,21 @@ export function nameGroup() { export function dateCreatedGroup() { try { // span com a data de criação do grupo - const span_date_group = document.querySelector('._37Hn4._1AJnI._29Iga'); - return span_date_group.textContent; + const span_name_group = document.querySelector('._3Bg5b.VWPRY._1lF7t').firstChild; + return span_name_group.textContent; } catch (error) { return 'error-data-grupo' } +} - +export function getTotalMembers() { + try { + // span com a data de criação do grupo + const span_name_group = document.querySelector('._3Bg5b.VWPRY._1lF7t').firstChild; + return span_name_group.textContent; + } catch (error) { + return 'error-data-grupo' + } } export async function readGroup() { @@ -34,16 +42,14 @@ export async function readGroup() { setTimeout( () => { // div que envolve o avatar e os dados dos participantes do grupo - // let elements = document.querySelectorAll('._2nY6U._3A-iD'); - let elements = document.querySelectorAll('._2nY6U'); - console.log({elements}); + const box = document.querySelector('.nBIOd.tm2tP') + let elements = box.querySelectorAll('._2nY6U'); let contacts = []; for (let item of elements){ // wrappers: avatar e conteúdo - console.log({item}); const [div_wrapper_avatar, div_wrapper_content] = item.childNodes; // wrapper image < flex < div_wrapper_avatar @@ -111,4 +117,4 @@ export function readListParticipants(){ } -// _2nY6U \ No newline at end of file +// i5tg98hk f9ovudaz przvwfww gx1rr48f shdiholb phqmzxqs gtscxtjd ajgl1lbb thr4l2wc cc8mgx9x eta5aym1 d9802myq e4xiuwjv \ No newline at end of file diff --git a/src/js/models/setButtons.js b/src/js/models/setButtons.js index 7ef07d4..a220336 100644 --- a/src/js/models/setButtons.js +++ b/src/js/models/setButtons.js @@ -1,7 +1,7 @@ const btnCopy = ``; const btnDown = ``; const btnPrt = ``; -const btnPrtModal = ``; +const btnPrtModal = ``; import { saveCsv, preview, contactsToClipboard } from './handle.js'; @@ -54,6 +54,7 @@ const setButtons = setInterval( () => { container.setAttribute("style", "display: flex; gap: 8px;"); //clearInterval(getElement) + const btnCSV = document.createElement("div") btnCSV.addEventListener("click", saveCsv ); btnCSV.innerHTML = `${btnDown}`;