Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensão #11

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,23 @@ No WhatsApp Web abra o console do Browser
Cole o código no console e aperte Enter

Pronto

## Plugin

A extensão habilita um novo botão no seu whats web o abrir o chat que deseja enviar e clicar.

![imagem plugin no whats](./extension/imagem/print_whatsapp.png)

Para ultilizar a extensão siga os seguintes passos:

1. Faça download do projeto em zip e descompacte.

![Download](./extension/imagem/download.png)

2. Acesse no seu navegador Chrome o endereço: [chrome://extensions/](chrome://extensions/) e marque a caixa do **Modo desenvolvedor** no canto superior direito.

3. *Click* em **Carregar sem compactação** e selecione a pasta descompactada da sua extensão para instalá-la.

![Carregar sem compactação](./extension/imagem/csc.png)

Pronto. Divirta-se
Binary file added extension/imagem/csc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extension/imagem/download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extension/imagem/print_whatsapp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions extension/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

function load () {
return new Promise((resolve) => {
const fr = setInterval(() => {
console.log("Buscando...")

const navActions = document.querySelector("div._3HQNh._1un-p")
if (navActions) {
clearInterval(fr)
// console.log("ACHO..")
// console.log('minha extensao.......',navActions)
resolve(true)
}

},500)
})
}

function getRoadmap () {
const objMovies = {}
const movies = Object.keys(roadmap)

let str = "Qual roteiro deseja deseja enviar ?\n"
let i = 1;
for (const movie of movies) {
str += i +" - "+ movie +"\n"
objMovies[i] = movie
i++;
}
const op = prompt(str)
return roadmap[objMovies[op]]
}

function start() {
console.log('Start..')
const header = document.querySelector("._1QVfy._3UaCz")
const btn = document.createElement("button")

btn.id = "buttonSend"
btn.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" color="gray"><path fill="currentColor" d="M1.101 21.757L23.8 12.028 1.101 2.3l.011 7.912 13.623 1.816-13.623 1.817-.011 7.912z"></path></svg>`

btn.addEventListener('click',() => {
const roadmap = getRoadmap()
send(roadmap)
})
header.appendChild(btn)
}

load().then(start)



14 changes: 14 additions & 0 deletions extension/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "Send Message Whatsapp",
"version": "1.0",
"description": "Envia mensagem Whatsapp",

"content_scripts": [
{
"matches": ["https://web.whatsapp.com/"],
"css": ["style.css"],
"js": ["index.js", "roadmap.js", "send.js"]
}
],
"manifest_version": 2
}
Loading