Escolar Documentos
Profissional Documentos
Cultura Documentos
importCDNSnackBar();
let currentURL = window.location.hostname;
const CURRENT_VERSION = '155';
function main()
{
if(currentURL.includes("folha.uol.com.br")){
saveDataForDashboard(1);
blockPaywallRequest("*://paywall.folha.uol.com.br/*");
}else if(currentURL.includes("estadao.com.br")){
saveDataForDashboard(2);
blockPaywallRequest("*://acesso.estadao.com.br/paywall*");
function modifyAPPRESPAI()
{
mainUnlockFunction();
enableUrlChangeDetect();
checkButtonCreation();
changeLockedIcons();
removeReactModalOverlay();
enableBodyOverflow();
window.addEventListener('locationchange',()=>{
mainUnlockFunction();
checkButtonCreation();
removeReactModalOverlay();
enableBodyOverflow();
});
/**
* Nested function (funcao aninhada)
* Funcao principal de desbloqueio de conteudo
*/
function mainUnlockFunction(){
if(window.location.href.includes('app.respondeai.com.br/aprender') &&
window.location.href.includes('/teoria/')){
importRequiredCDN();
setTheoryLinksAction();
enableBodyOverflow();
removeReactModalOverlay();
removeDexterBlock();
removeBlurPage();
unlockTeoria();
incrementaConteudoAPI();
verificaAtualizacaoVersao();
}
else if(window.location.href.includes('app.respondeai.com.br/aprender') &&
window.location.href.includes('/exercicio/')){
importRequiredCDN();
setTheoryLinksAction();
enableBodyOverflow();
removeReactModalOverlay();
removeDexterBlock();
removeBlurPage();
unlockFixationExercise();
incrementaConteudoAPI();
verificaAtualizacaoVersao();
}
else if((window.location.href.includes('app.respondeai.com.br/aprender') ||
window.location.href.includes('app.respondeai.com.br/praticar')) &&
window.location.href.includes('/exercicio-lista/')){
importRequiredCDN();
setTheoryLinksAction();
enableBodyOverflow();
removeReactModalOverlay();
removeDexterBlock();
removeBlurPage();
unlockListExercise();
incrementaConteudoAPI();
verificaAtualizacaoVersao();
}
}
}
function changeLockedIcons()
{
setInterval(()=>{
let svgIcons = document.querySelectorAll(".MuiSvgIcon-root");
svgIcons.forEach(icon => {
icon.innerHTML = `<svg aria-hidden="true" focusable="false" data-
prefix="far" data-icon="square" class="svg-inline--fa fa-square sc-lgsYow gFYkCv
logged" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path
fill="currentColor" d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48
48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-6 400H54c-3.3 0-6-2.7-6-
6V86c0-3.3 2.7-6 6-6h340c3.3 0 6 2.7 6 6v340c0 3.3-2.7 6-6 6z"></path></svg>`
});
},800);
}
function unlockListExercise()
{
let r = setInterval(()=>{
let divs = document.querySelectorAll('div');
for(let i=0; i<divs.length; i++){
if(divs[i].hasAttribute('data-cy') && divs[i].getAttribute('data-cy')
== 'exercise-show-answer-button'){
clearInterval(r);
answerDiv.innerHTML = setLoadingPageAnimation();
let s = setInterval(()=>{
if(typeof(axios) == 'function' && token != null &&
listExerciseId != null){
clearInterval(s);
axios({
method: "POST",
url:
`https://possoler.tech/API/responde_ai/signedUser/index.php?
action=getListExercise`,
timeout: 30000,
data: JSON.stringify({
token: token,
listExerciseId: listExerciseId
})
}).then((resp)=>{
if(resp.data.status == 'failed') throw new
Error(resp.data.message);
if(j==0){
answerDiv.innerHTML += `<h1 style="color:
rgb(54, 170, 173); font-size: 1.7em; font-family:Droid Serif, serif; font-weight:
inherit; margin: 50px 0px 30px 0px">V�deo Tutorial</h1>`;
}
answerDiv.innerHTML += `
<div data-cy="video-iframe"
allowfullscreen="" frameborder="0" style="width: 100%; height: $
{(SINGLE_VIDEO_SIZE+SPACE_BETWEEN_VIDEOS)*resp.data.videos.length}px;">
<div style="width: 100%; height: $
{SINGLE_VIDEO_SIZE}px;">
<iframe frameborder="0"
allowfullscreen="1" allow="accelerometer; autoplay; clipboard-write; encrypted-
media; gyroscope; picture-in-picture" title="YouTube video player" width="100%"
height="100%" src="https://www.youtube.com/embed/${resp.data.videos[j].providerId}?
autoplay=0&mute=0&controls=1&origin=https%3A%2F
%2Fapp.respondeai.com.br&playsinline=1&showinfo=0&rel=0&iv_load_pol
icy=3&modestbranding=1&enablejsapi=1&widgetid=1"></iframe>
</div>
</div>
<div style="height: $
{SPACE_BETWEEN_VIDEOS}px !important"></div>`
}
}
}).catch((erro)=>{
sweetAlert(
'error',
'Erro',
`Ops, tivemos um pequeno problema!<br>Por favor,
tente novamente mais tarde.<br><br><spam style='font-weight: bold !
important;'>C�digo do erro: </spam>${erro.toString()}`
);
});
}
},800);
break;
}
}
},800);
}
function unlockFixationExercise()
{
//Remove format toogle
let k = setInterval(()=>{
let divs = document.querySelectorAll('div');
for(let i=0; i<divs.length; i++){
if(divs[i].hasAttribute('data-cy') && divs[i].getAttribute('data-cy')
== 'content-format-toggle'){
clearInterval(k);
divs[i].style.display = "none";
break;
}
}
},800);
let r = setInterval(()=>{
let divs = document.querySelectorAll('div');
for(let i=0; i<divs.length; i++){
if(
(divs[i].hasAttribute('data-cy') && divs[i].getAttribute('data-cy')
== 'exercise-show-answer-button') ||
(divs[i].hasAttribute('data-cy') && divs[i].getAttribute('data-cy')
== 'exercise-statement')
){
clearInterval(r);
let answerDiv;
if(divs[i].getAttribute('data-cy') == 'exercise-statement'){
divs[i].innerHTML += `<div id="tmpAnswer"></div>`;
answerDiv = document.getElementById("tmpAnswer");
answerDiv.innerHTML = setLoadingPageAnimation();
let s = setInterval(()=>{
if(typeof(axios) == 'function' && token != null && exerciseId !
= null){
clearInterval(s);
axios({
method: "POST",
url:
`https://possoler.tech/API/responde_ai/signedUser/index.php?
action=getFixationExercise`,
timeout: 30000,
data: JSON.stringify({
token: token,
exerciseId: exerciseId
})
}).then((resp)=>{
if(resp.data.status == 'failed') throw new
Error(resp.data.message);
console.log(resp.data);
//Renderiza solu��o na tela - Teoria
for(let i=0; i<resp.data.lightSolution.length; i++){
if(i==0){
answerDiv.innerHTML = `<h1 style="color:
rgb(247, 172, 60); font-size: 1.7em; font-family:Droid Serif, serif; font-weight:
inherit; margin: 50px 0px 30px 0px">Resposta</h1>`;
}
answerDiv.innerHTML += resp.data.lightSolution[i];
MathJax.typeset();
}
if(j==0){
answerDiv.innerHTML += `<h1 style="color:
rgb(247, 172, 60); font-size: 1.7em; font-family:Droid Serif, serif; font-weight:
inherit; margin: 50px 0px 30px 0px">V�deo Tutorial</h1>`;
}
answerDiv.innerHTML += `
<div data-cy="video-iframe"
allowfullscreen="" frameborder="0" style="width: 100%; height: $
{(SINGLE_VIDEO_SIZE+SPACE_BETWEEN_VIDEOS)*resp.data.videos.length}px;">
<div style="width: 100%; height: $
{SINGLE_VIDEO_SIZE}px;">
<iframe frameborder="0"
allowfullscreen="1" allow="accelerometer; autoplay; clipboard-write; encrypted-
media; gyroscope; picture-in-picture" title="YouTube video player" width="100%"
height="100%" src="https://www.youtube.com/embed/${resp.data.videos[j].providerId}?
autoplay=0&mute=0&controls=1&origin=https%3A%2F
%2Fapp.respondeai.com.br&playsinline=1&showinfo=0&rel=0&iv_load_pol
icy=3&modestbranding=1&enablejsapi=1&widgetid=1"></iframe>
</div>
</div>
<div style="height: $
{SPACE_BETWEEN_VIDEOS}px !important"></div>`
}
}
}).catch((erro)=>{
sweetAlert(
'error',
'Erro',
`Ops, tivemos um pequeno problema!<br>Por favor,
tente novamente mais tarde.<br><br><spam style='font-weight: bold !
important;'>C�digo do erro: </spam>${erro.toString()}`
);
});
}
},800);
break;
}
}
},800);
}
function unlockTeoria()
{
let r = setInterval(()=>{
let divs = document.querySelectorAll('div');
for(let i=0; i<divs.length; i++){
if(divs[i].hasAttribute('data-cy') && divs[i].getAttribute('data-cy')
== 'content-format-toggle'){
clearInterval(r);
divStepsContainer.children[0].isEqualNode(divStepsContainer.children[1]) &&
divStepsContainer.children[1].isEqualNode(divStepsContainer.children[2]) &&
divStepsContainer.children[2].isEqualNode(divStepsContainer.children[3]) &&
divStepsContainer.children[3].isEqualNode(divStepsContainer.children[4]) &&
divStepsContainer.children[4].isEqualNode(divStepsContainer.children[5])
){
//SETTA MSG DE LOADING
divsSteps[j].innerHTML =
setLoadingPageAnimation();
}
break;
}
}
},800);
let divStepsContainer =
divsSteps[j].children[0].children[0];
try{
if(
divStepsContainer.children[0].isEqualNode(divStepsContainer.children[1]) &&
divStepsContainer.children[1].isEqualNode(divStepsContainer.children[2]) &&
divStepsContainer.children[2].isEqualNode(divStepsContainer.children[3]) &&
divStepsContainer.children[3].isEqualNode(divStepsContainer.children[4]) &&
divStepsContainer.children[4].isEqualNode(divStepsContainer.children[5])
){
divsSteps[j].innerHTML =
setLoadingPageAnimation();
callAPITheoryUnlocked("texto");
break;
}
}catch(erro){
}
}
}
},800);
break;
}
if(nodes[i].nodeName == 'P' && nodes[i].textContent ==
'Alternar para video >>'){
callAPITheoryUnlocked("video");
if(verificaElemento("#msgLottieDesbloqueio")){
document.getElementById("msgLottieDesbloqueio").innerHTML = `
<p class="lead">Aguarde um
momento...<br>Estamos removendo os bloqueios para voc�...</p>`
}
break;
}
}
});
break;
}else{
//PROCURA DIV PARA RECEBER CONTEUDO
let s = setInterval(()=>{
let divsSteps = document.querySelectorAll('div');
for(let j=0; j<divsSteps.length; j++){
if(divsSteps[j].hasAttribute('data-cy') &&
divsSteps[j].getAttribute('data-cy') == 'theory-text-content'){
clearInterval(s);
let divStepsContainer =
divsSteps[j].children[0].children[0];
try{
if(
divStepsContainer.children[0].isEqualNode(divStepsContainer.children[1]) &&
divStepsContainer.children[1].isEqualNode(divStepsContainer.children[2]) &&
divStepsContainer.children[2].isEqualNode(divStepsContainer.children[3]) &&
divStepsContainer.children[3].isEqualNode(divStepsContainer.children[4]) &&
divStepsContainer.children[4].isEqualNode(divStepsContainer.children[5])
){
divsSteps[j].innerHTML =
setLoadingPageAnimation();
callAPITheoryUnlocked("texto");
break;
}
}catch(erro){
}
}
}
},800);
}
}
},800);
}
function setLoadingPageAnimation()
{
return `
<div id="containerLootieLoading" class="container text-center">
<lottie-player
src="https://assets7.lottiefiles.com/packages/lf20_4bzh2jhs.json"
background="transparent" speed="1" style="height: 300px;" loop
autoplay></lottie-player>
<center id="msgLottieDesbloqueio">
<p class="lead">Aguarde um momento...<br>Estamos removendo os
bloqueios para voc�...</p>
</center>
</div>`
}
function importRequiredCDN()
{
let r = setInterval(()=>{
if(verificaElemento('head')){
clearInterval(r);
if(!customElements.get("lottie-player")){
let lottieJS = document.createElement('script');
lottieJS.setAttribute('src','https://unpkg.com/@lottiefiles/lottie-
player@latest/dist/lottie-player.js');
document.querySelector('head').appendChild(lottieJS);
}
}
},800);
}
/**
* Faz chamada para API e popula p�gina de acordo com o parametro typeContent
* @param {*} typeContent
*/
function callAPITheoryUnlocked(typeContent)
{
let token = getCookie('user_jwt');
let topicId = getTopicId();
let r = setInterval(()=>{
if(typeof(axios) == 'function' && token != null && topicId != null){
clearInterval(r);
axios({
method: "POST",
url: `https://possoler.tech/API/responde_ai/signedUser/index.php?
action=getTheory`,
timeout: 30000,
data: JSON.stringify({
token: token,
topicId: topicId
})
}).then((resp)=>{
if(resp.data.status == 'failed')
throw new Error(resp.data.message);
if(typeContent == 'texto'){
let r = setInterval(()=>{
let divs = document.querySelectorAll('div');
for(let i=0; i<divs.length; i++){
if(divs[i].hasAttribute('data-cy') &&
divs[i].getAttribute('data-cy') == 'theory-text-content' && typeof(MathJax) ==
"object"){
clearInterval(r);
divs[i].innerHTML = `
<div class="sc-jTzLTM fFEUnb rendered">
<div>${resp.data.lightBody}</div>
</div>`;
MathJax.typeset();
return;
}
}
},800);
}
else if(typeContent == 'video'){
const SINGLE_VIDEO_SIZE = 450;
const SPACE_BETWEEN_VIDEOS = 50;
let r = setInterval(()=>{
let divs = document.querySelectorAll('div');
for(let i=0; i<divs.length; i++){
if(divs[i].hasAttribute('data-cy') &&
divs[i].getAttribute('data-cy') == 'theory-video-content'){
clearInterval(r);
if(divs[i].children[0].id ==
"containerLootieLoading")
{
if(resp.data.hasOwnProperty('videos'))
{
//REMOVE ANIMACAO DE CARREGAMENTO
document.getElementById("containerLootieLoading").remove();
/**
* Pega e retorna topicId da URL
* @returns String
*/
function getTopicId()
{
let url = window.location.href;
let params = url.split("/");
return params[params.length-1];
}
/**
* Sobrescreve acao padrao dos botoes
*/
function setTheoryLinksAction()
{
let r = setInterval(()=>{
let divs = document.querySelectorAll('div');
for(let i=0; i<divs.length; i++){
if(divs[i].hasAttribute('data-cy') && divs[i].getAttribute('data-cy')
== 'side-menu'){
clearInterval(r);
setTimeout(()=>{
let links = document.querySelectorAll("a");
for(let i=0; i<links.length; i++){
if(
links[i].getAttribute("href").includes("/aprender") &&
links[i].getAttribute("href").includes("/topico") &&
links[i].getAttribute("href").includes("/teoria") &&
links[i].getAttribute("href").includes("/exercicio/")
){
links[i].addEventListener("click", (event)=>{
event.preventDefault();
window.location.assign(`https://$
{window.location.hostname}${links[i].getAttribute("href")}`);
});
}
}
},2000);
break;
}
}
},800);
}
/**
* Remove blur da pagina
*/
function removeBlurPage()
{
let r = setInterval(()=>{
let blurElements = document.querySelectorAll(".blur");
if(blurElements.length>0){
clearInterval(r);
for (let i=0; i<blurElements.length; i++){
blurElements[i].classList.remove("blur");
blurElements[i].style.filter = 'none';
}
}
},800);
}
/**
* Habilita scroll da pagina
*/
function enableBodyOverflow()
{
let r = setInterval(()=>{
if(verificaElemento(".ReactModal__Body--open")){
clearInterval(r);
document.body.style.overflow = "auto"
}
},800);
}
function removeReactModalOverlay()
{
let r = setInterval(()=>{
let reactModalOverlay = document.querySelectorAll(".ReactModal__Overlay");
if(reactModalOverlay.length > 0){
clearInterval(r);
for(let i=0; i<reactModalOverlay.length; i++){
reactModalOverlay[i].remove();
}
}
},800);
}
/**
* Remove bloqueio do dexter
*/
function removeDexterBlock()
{
let r = setInterval(()=>{
let divs = document.querySelectorAll('div');
for(let i=0; i<divs.length; i++){
if(divs[i].hasAttribute('data-cy') && divs[i].getAttribute('data-cy')
== 'no-access-dexter-overlay'){
clearInterval(r);
divs[i].remove();
}
}
},800);
}
function modifyOPOVO()
{
if(window.location.href == "https://mais.opovo.com.br/"){
window.location.assign("https://mais.opovo.com.br/home");
}
verificaAtualizacaoVersao();
}
function modyfyJORNALCOMERCIO()
{
if((window.location.href).includes("https://impresso.jc.ne10.uol.com.br/")){
if(window.location.href == "https://impresso.jc.ne10.uol.com.br/"){
window.location.replace("https://impresso.jc.ne10.uol.com.br/index.php?
id=/txt.php");
}
let r = setInterval(()=>{
if(verificaElemento('#preloader-jconline')){
clearInterval(r);
document.getElementById("preloader-jconline").remove();
blockPaywallRequest("*://me.jsuol.com.br/*");
}
},800);
}
else{
blockPaywallRequest("*://s3.amazonaws.com/sdk-signin-wall-production/
bundle.js*");
}
}
function modifyOTEMPO()
{
if(new URLSearchParams(window.location.search).get('aId') == null) {
let r = setInterval(()=>{
let paywallBlock = document.querySelector('.reset-overlay');
if(paywallBlock != null){
clearInterval(r);
paywallBlock.remove();
}
},800);
}else{
let r = setInterval(()=>{
if(verificaElemento('#div-paywall-element')){
clearInterval(r);
//MONTA SWEET ALERT DE DESBLOQUEIO
let s = setInterval(()=>{
if(typeof(Swal) == 'function'){
clearInterval(s);
console.log('ACHEI SWALL');
const TOKEN_DECODED =
polopoly.base64.decode(TOKEN_ENCODED);
const GUID = getArticleGuid();
axios({
method: 'GET',
url:
`${window.location.origin}/rest-services/emotion-service/noticia?guid=$
{GUID}&token=${TOKEN_DECODED}`,
timeout: 30000,
headers: {'accept':
'application/json'}
}).then((resp)=>{
//GET NOTAS
if(resp.data[i].hasOwnProperty('notas')){
for(let n=0;
n<resp.data[i].notas.length; n++){
if(resp.data[i].hasOwnProperty('title')){
conteudoMateria +=
`<h4 style="font-size: 18px !important; font-weight: 700 !important;">$
{resp.data[i].notas[n].title}</h4>`;
}
if(resp.data[i].notas[n].hasOwnProperty('content')){
conteudoMateria +=
resp.data[i].notas[n].content;
}
}
}
}
let waitConteudoMateria =
setInterval(()=>{
if(conteudoMateria != null){
clearInterval(waitConteudoMateria);
try{
document.querySelector('.artigo-conteudo-article').innerHTML += conteudoMateria;
sweetAlert(
'success',
'Sucesso',
'�timo! Conte�do
desbloqueado!'
);
incrementaConteudoAPI();
verificaAtualizacaoVersao();
removePaywallBanner();
restoreImgs();
}catch(erro){
sweetAlert(
'error',
'Erro',
`Ops, tivemos um
pequeno problema!<br>Por favor, tente novamente mais tarde.<br><br><spam
style='font-weight: bold !important;'>C�digo do erro: </spam>${erro.toString()}`
);
}
}
},800);
}).catch((erro)=>{
sweetAlert(
'error',
'Erro',
`Ops, tivemos um pequeno
problema!<br>Por favor, tente novamente mais tarde.<br><br><spam style='font-
weight: bold !important;'>C�digo do erro: </spam>[O Tempo Request] $
{erro.toString()}`
);
});
}
},800);
}
},800);
}).catch((erro)=>{
sweetAlert(
'error',
'Erro',
`Ops, tivemos um pequeno problema!<br>Por favor,
tente novamente mais tarde.<br><br><spam style='font-weight: bold !
important;'>C�digo do erro: </spam>[Internal API Request] ${erro.toString()}`
);
});
}
},800);
}
},800);
}
}
function getArticleGuid() {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get('aId');
}
function removePaywallBanner()
{
if(verificaElemento('.reset-overlay')) document.querySelector('.reset-
overlay').remove();
}
function restoreImgs()
{
let imgs = document.querySelectorAll('img');
function modifyDIARIOSM()
{
//ADD JQUERY JS
let jqueryJS = document.createElement('script');
jqueryJS.setAttribute('src', 'https://code.jquery.com/jquery-3.6.0.min.js');
document.body.appendChild(jqueryJS);
let r = setInterval(()=>{
if(verificaElemento('.row-bloqueio') && typeof($) == 'function' &&
findPaywallText()){
clearInterval(r);
try{
let base64ParsedBody = CryptoJS.enc.Base64.parse(parsedBody);
let cryptoKey =
CryptoJS.enc.Base64.parse('u/Gu5posvwDsXUnV5Zaq4g==');
let cryptoIv =
CryptoJS.enc.Base64.parse('5D9r9ZVzEYYgha93/aUK2w==');
$(".suita-artigo .row-conteudo").show();
$(".suita-artigo .videos").show();
$(".suita-artigo .imagens").show();
$(".suita-artigo .elementos").show();
$(".suita-artigo .row-loading").hide();
let u = setInterval(()=>{
if(typeof(twttr) == 'object'){
clearInterval(u);
twttr.widgets.load();
}
},800);
document.querySelector('.row-bloqueio').remove();
incrementaConteudoAPI();
verificaAtualizacaoVersao();
}catch(erro){
if(typeof(Swal) == 'function'){
sweetAlert(
'error',
'Erro',
`Ops, tivemos um pequeno problema!<br>Por favor, tente
novamente mais tarde.<br><br><spam style='font-weight: bold !important;'>C�digo do
erro: </spam>${erro.toString()}`
);
}else{
alert(erro.toString());
}
}
}
},800);
}
function findPaywallText()
{
let h1 = document.querySelectorAll('h1');
for(let i=0; i<h1.length; i++){
if(h1[i].textContent.includes("Conte�do exclusivo!")){
return true;
}
}
return false;
}
function modifyOPOPULAR()
{
if(window.location.hostname == "opopular.com.br"){
let y = setInterval(()=>{
if(verificaElemento('.locked-news') && articlesIsRemoved &&
typeof(axios) == 'function' && verificaElemento('#styleSnack')){
clearInterval(y);
mountSweetAlert(
'info',
'Aguarde um momento...',
'Estamos removendo os bloqueios para voc�...<br><br>'
);
if(resp.data.hasOwnProperty("content")){
let cacheSourceCode = new
DOMParser().parseFromString(resp.data.content, "text/html");
let blocoNoticia =
getArticleBodyPOPULAR(cacheSourceCode);
let blocoOriginal =
getArticleBodyPOPULAR(document);
let u = setInterval(()=>{
if(blocoNoticia != null && blocoOriginal !=
null){
clearInterval(u);
console.log(`CODE CACHE = $
{blocoNoticia.outerHTML}`);
console.log(`CODE ORIGINAL = $
{blocoOriginal.outerHTML}`);
blocoOriginal.innerHTML =
blocoNoticia.outerHTML;
sweetAlert(
'success',
'Sucesso',
'�timo! Conte�do desbloqueado!'
);
incrementaConteudoAPI();
verificaAtualizacaoVersao();
}else{
sweetAlert(
'warning',
'Aten��o',
'Ops, ainda n�o � poss�vel
desbloquear essa p�gina. <br>Por favor, tente acessar a noticia mais
tarde.<br><br>'
);
return;
}
}
},800);
}else{
setTimeout(()=>{
window.location.assign(`https://webcache.googleusercontent.com/search?q=cache:$
{window.location.href}`);
},1500);
}
}).catch((erro)=>{
if(erro.toString().includes('timeout')){
SwalTimeout(
'error',
'Erro',
`Ops, tivemos um pequeno problema!<br>Por
favor, tente novamente utilizando uma conex�o mais r�pida.<br><br><spam
style='font-weight: bold !important;'>C�digo do erro: </spam>${erro}`,
'https://opopular.com.br'
);
}else{
sweetAlert(
'warning',
'Aten��o',
`Ops, tivemos um pequeno problema!<br> Por
favor, recarregue a p�gina para tentar novamente.<spam style='font-weight: bold !
important;'>C�digo do erro: [API FAILED REQUEST TO RESPONSE FILE] - </spam>`
);
}
});
}
},800);
}
},800);
}else{
//TRECHO DO C�DIGO RESPONS�VEL POR PEGAR CACHE DA P�GINA
mountSweetAlert(
'info',
'Aguarde mais um momento...',
'Estamos removendo os bloqueios para voc�...<br><br>'
);
//FAZ GET PARA PR�PRIA PAGINA PARA PEGAR C�DIGO FONTE DELA
fetch(document.location.href)
.then((response) => {
if(response.status == 200){
response.text().then(pageSource => {
pageSource = new
DOMParser().parseFromString(pageSource, 'text/html');
let article = getArticleBodyPOPULAR(pageSource);
let blocoNoticia = (article != false) ?
article.outerHTML : pageSource.outerHTML;
console.clear();
let l = setInterval(()=>{
try{
console.log(`KEY = ${key}`);
console.log(`PAGE SOURCE = ${pageSource !=
null}`);
console.log(`BLOCO NOTICIA = $
{blocoNoticia.outerHTML}`);
}catch(erro){
}
if((key != null || key != undefined) && (pageSource
!= null || pageSource != undefined) && (blocoNoticia != null || blocoNoticia !=
undefined)){
clearInterval(l);
function getArticleBodyPOPULAR(scope)
{
let articles = scope.querySelectorAll('section');
return false;
}
function hideKeepReadingChildren()
{
let keepReadingChildren;
if(verificaElemento("#keep-reading")){
keepReadingChildren = document.getElementById("keep-reading").children;
for(let i=0; i<keepReadingChildren.length; i++){
if(i==0) continue;
keepReadingChildren[i].style.display = 'none';
}
if(verificaElemento('.for-top-news')){
document.querySelector('.for-top-news').remove();
}
}
return false;
}
function removeLockedNewsContainers()
{
let lockedNews = document.querySelectorAll('.locked-news');
for(let i=0; i<lockedNews.length; i++){
lockedNews[i].remove();
}
}
function removeArticles()
{
let allArticles = document.querySelectorAll('article');
for(let i=0; i<allArticles.length; i++){
if(i==0) continue;
allArticles[i].remove();
}
return true;
}
function removeAdBetweenArticles()
{
let allAdBetweenArticles = document.querySelectorAll('.ad-between-articles');
for(let i=0; i<allAdBetweenArticles.length; i++){
allAdBetweenArticles[i].remove();
}
}
function fixVideoRender()
{
if(window.location.href.includes('/videos')){
let iframes = document.querySelectorAll('iframe');
for(let i=0; i<iframes.length; i++){
if(iframes[i].hasAttribute('src')){
let currentSrc = iframes[i].getAttribute('src');
iframes[i].removeAttribute('src');
iframes[i].setAttribute('src', currentSrc);
}
}
}
}
function removeCommentDiv()
{
if(verificaElemento('.comment')){
document.querySelector('.comment').remove();
}
}
function modifyVLRECON()
{
if(window.location.hostname == "valor.globo.com"){
let rotina = setInterval(()=>{
if(verificaElemento('.paywall-cpt') || verificaElemento(".barber-
barrier-cpnt") || verificaElemento(".paywall")){
clearInterval(rotina);
if(resp.data.hasOwnProperty("content")){
let cacheSourceCode = new
DOMParser().parseFromString(resp.data.content, "text/html");
let blocoNoticia = getArticle(cacheSourceCode);
let blocoOriginal = getArticle(document);
let u = setInterval(()=>{
if(blocoNoticia != null && blocoOriginal !=
null){
clearInterval(u);
console.log(`CODE CACHE = $
{blocoNoticia.outerHTML}`);
console.log(`CODE ORIGINAL = $
{blocoOriginal.outerHTML}`);
blocoOriginal.innerHTML =
blocoNoticia.outerHTML;
sweetAlert(
'success',
'Sucesso',
'�timo! Conte�do desbloqueado!'
);
setTimeout(()=>{
removeAds();
corrigeImgsCache();
},3000);
removeBlockCelularVLRECON();
}
}
},800);
}else{
sweetAlert(
'warning',
'Aten��o',
'Ops, ainda n�o � poss�vel
desbloquear essa p�gina. <br>Por favor, tente acessar a noticia mais
tarde.<br><br>'
);
return;
}
}
},800);
}else{
setTimeout(()=>{
window.location.assign(`https://webcache.googleusercontent.com/search?q=cache:$
{window.location.href}`);
},1500);
}
}).catch((erro)=>{
if(erro.toString().includes('timeout')){
SwalTimeout(
'error',
'Erro',
`Ops, tivemos um pequeno problema!<br>Por
favor, tente novamente utilizando uma conex�o mais r�pida.<br><br><spam
style='font-weight: bold !important;'>C�digo do erro: </spam>${erro}`,
'https://valor.globo.com'
);
}else{
sweetAlert(
'error',
'Erro',
`Ops, tivemos um pequeno problema!<br><spam
style='font-weight: bold !important;'>C�digo do erro: </spam>${erro}`
);
}
});
}
},800);
}
},800);
}else{
//TRECHO DO C�DIGO RESPONS�VEL POR PEGAR CACHE DA P�GINA
mountSweetAlert(
'info',
'Aguarde mais um momento...',
'Estamos removendo os bloqueios para voc�...<br><br>'
);
//FAZ GET PARA PR�PRIA PAGINA PARA PEGAR C�DIGO FONTE DELA
fetch(document.location.href)
.then((response) => {
if(response.status == 200){
response.text().then(pageSource => {
pageSource = new
DOMParser().parseFromString(pageSource, 'text/html');
let article = getArticle(pageSource);
let blocoNoticia = (article != false) ?
article.outerHTML : pageSource.outerHTML;
let l = setInterval(()=>{
if((key != null || key != undefined) && (pageSource
!= null || pageSource != undefined) && (blocoNoticia != null || blocoNoticia !=
undefined)){
clearInterval(l);
Swal.fire({
icon: icon,
title: title,
html: msg,
allowEscapeKey: false,
allowOutsideClick: false,
showConfirmButton: true,
confirmButtonText: `Tentar novamente`,
showCancelButton: true,
cancelButtonText: `Voltar para ${homeLink}`,
backdrop: 'rgba(8, 8, 8, 0.92)',
customClass: {
popup: 'snackZ-index',
container: 'snackZ-index'
}
}).then((result) => {
if(result.isConfirmed) window.location.reload();
else window.location.replace(homeLink);
});
}
},800);
}
function SwalGotoHome(icon, title, msg, homeLink)
{
let r = setInterval(()=>{
if(typeof(Swal) == 'function'){
clearInterval(r);
Swal.fire({
icon: icon,
title: title,
html: msg,
allowEscapeKey: false,
allowOutsideClick: false,
showConfirmButton: true,
confirmButtonText: `Voltar para ${homeLink}`,
//showDenyButton: true,
//denyButtonText: `Fechar guia`,
backdrop: 'rgba(8, 8, 8, 0.92)',
customClass: {
popup: 'snackZ-index',
container: 'snackZ-index'
}
}).then((result) => {
if(result.isConfirmed) window.location.replace(homeLink);
/* else if(result.isDenied) window.close(); */
});
}
},800);
}
function genHashKey()
{
let url = window.location.href;
let part2 = url.split("cache:");
let uri = part2[part2.length-1];
return (uri.includes('valor.globo.com'))
? {hash: `/${uri.split('valor.globo.com/')[1]}`, url: uri}
: {hash: `/${uri.split('opopular.com.br/')[1]}`, url: uri};
}
function corrigeImgsCache()
{
let divs = document.querySelectorAll('div');
function removeBlockCelularVLRECON()
{
try{
let block = document.querySelector(".barber-barrier-cpnt");
backdropColor = (
window.location.href.includes("webcache.googleusercontent.com/search?
q=cache:https://opopular.com.br") ||
window.location.href.includes("webcache.googleusercontent.com/search?
q=cache:https://valor.globo.com")
)
? 'rgba(8, 8, 8, 0.92)' : '';
if(icon == 'success'){
Swal.fire({
icon: icon,
title: title,
html: msg,
allowEscapeKey: false,
allowOutsideClick: false,
showConfirmButton: opt,
timer: 7000,
timerProgressBar: true,
customClass: {
popup: 'snackZ-index',
container: 'snackZ-index'
}
});
window.stop();
return;
}
Swal.fire({
icon: icon,
title: title,
html: msg,
allowEscapeKey: false,
allowOutsideClick: false,
showConfirmButton: opt,
backdrop: backdropColor,
customClass: {
popup: 'snackZ-index',
container: 'snackZ-index'
}
});
}
function getArticle(scope)
{
let articles = scope.querySelectorAll('article');
return false;
}
function removeAds()
{
let divs = document.querySelectorAll('div');
function modifyBRAINLY()
{
let r = setInterval(()=>{
if(verificaElemento('.brn-qpage-next-answer-box-content') &&
verificaElemento('.js-react-bottom-banner')){
clearInterval(r);
if(typeof(axios) == 'function'){
axios({
method: METHOD_REQUEST,
url: `${URL_REQUEST}${window.location.href}`,
timeout: 30000
}).then((resp)=>{
if(resp.data.hasOwnProperty('erro')){
sweetAlert(
'error',
'Erro',
`Ops, tivemos um pequeno problema!<br><spam
style='font-weight: bold !important;'>C�digo do erro: </spam>${resp.data.erro}`
);
return;
}
removeBrainlyBlocks();
expandAnswerDiv();
let u = setInterval(()=>{
if(verificaElemento("#styleSnack")){
clearInterval(u);
for(let i=0; i<resp.data.answers.length; i++){
allAnswersBlocks[i].innerHTML =
resp.data.answers[i];
if(i == (resp.data.answers.length)-1){
Swal.fire({
icon: 'success',
title: 'Sucesso',
html: '�timo! Conte�do desbloqueado!',
allowEscapeKey: false,
allowOutsideClick: false,
showConfirmButton: true,
timer: 7000,
timerProgressBar: true,
customClass: {
popup: 'snackZ-index',
container: 'snackZ-index'
}
});
observerResposta(resp.data.answers);
incrementaConteudoAPI();
verificaAtualizacaoVersao();
//setActionBtnVerRespostaBrainly();
}
}
}
},800);
}).catch((erro)=>{
if(erro.toString().includes('timeout')){
sweetAlert(
'error',
'Erro',
`Ops, tivemos um pequeno problema!<br>Por favor, tente
novamente utilizando uma conex�o mais r�pida.<br><br><spam style='font-weight: bold
!important;'>C�digo do erro: </spam>${erro}`
);
}else{
sweetAlert(
'error',
'Erro',
`Ops, tivemos um pequeno problema!<br><spam
style='font-weight: bold !important;'>C�digo do erro: </spam>${erro}`
);
}
});
}else{
fetch(`${URL_REQUEST}${window.location.href}`,
{
method: METHOD_REQUEST
}).then(function(res){ return res.json(); })
.then(function(resp){
if(resp.hasOwnProperty('erro')){
sweetAlert(
'error',
'Erro',
`Ops, tivemos um pequeno problema!<br><spam
style='font-weight: bold !important;'>C�digo do erro: </spam>${resp.erro}`
);
return;
}
removeBrainlyBlocks();
expandAnswerDiv();
function observerResposta(answers)
{
setInterval(()=>{
let btns = document.querySelectorAll("button");
for(let i=0; i<btns.length; i++){
let childNodesBtn = btns[i].childNodes;
for(let j=0; j<childNodesBtn.length; j++){
if(childNodesBtn[j].textContent == 'Desbloquear'){
let answersBlocks_1 = document.querySelectorAll('.brn-qpage-
next-answer-box-content');
let answersBlocks_2 = document.querySelectorAll('.brn-qpage-
next-dummy-unlock-section');
let allAnswersBlocks =
[...answersBlocks_1, ...answersBlocks_2];
function expandAnswerDiv()
{
//TIRA MAX-HEIGHT DAS DIVS DE RESPOSTA
let r = setInterval(()=>{
if(verificaElemento('.brn-qpage-next-answer-box__content--blocked')){
clearInterval(r);
let answersBlocks = document.querySelectorAll('.brn-qpage-next-answer-
box__content--blocked');
for(let i=0; i<answersBlocks.length; i++){
answersBlocks[i].style.maxHeight = 'unset';
answersBlocks[i].style.position = 'unset';
}
}
},800);
}
function setActionBtnVerRespostaBrainly()
{
let f1 = findBtnVerResposta();
let f2 = findFlag();
let r = setInterval(()=>{
if(f1 != false && f2 != false){
clearInterval(r);
try{
document.getElementById('btnResposta').addEventListener('click',
(event)=>{
event.preventDefault();
window.location.href = '#FLAG_AQUI';
});
}catch(e){
console.log('Erro ao setar action no bot�o');
}
}
},800);
}
function findFlag()
{
let flag = document.querySelector('.js-react-question-box-comments');
flag.setAttribute('id', 'FLAG_AQUI');
document.querySelector('html').style.cssText += 'scroll-behavior: smooth;';
return flag;
}
function findBtnVerResposta()
{
let btns = document.querySelectorAll('button');
return false;
}
function removeBrainlyBlocks()
{
//REMOVE BLOQUEIO DE CIMA DAS DIVS
let r = setInterval(()=>{
let bannerBlock = document.querySelectorAll('div');
for(let i=0; i<bannerBlock.length; i++){
if(bannerBlock[i].hasAttribute('data-testid')){
if(bannerBlock[i].getAttribute('data-testid') ==
'unlock_section_wrapper'){
clearInterval(r);
bannerBlock[i].remove();
}
}
}
},800);
let z = setInterval(()=>{
if(verificaElemento('.js-register-toplayer')){
clearInterval(z);
document.querySelector('.js-register-toplayer').remove();
}
},800);
}
function modifyGZH()
{
enableUrlChangeDetect();
GM_webRequest([
{"selector":"https://www.rbsonline.com.br/cdn/scripts/paywall.min.js*","action":"ca
ncel"},
{"selector":"https://www.rbsonline.com.br/cdn/scripts/special-
paywall.min.js*","action":"cancel"},
{"selector":"https://api.clicrbs.com.br/paywall-api/*","action":"cancel"}
], function(info, message, details) {
console.log('PAYWALL BLOQUEADO');
incrementaConteudoAPI();
saveDataForDashboard(22);
});
window.addEventListener('locationchange', ()=>{
console.log('MUDEI URL');
verificaAtualizacaoVersao();
});
}
/* Obrigado Stackoverflow -
https://stackoverflow.com/questions/6390341/how-to-detect-if-url-has-changed-after-
hash-in-javascript */
function enableUrlChangeDetect()
{
history.pushState = ( f => function pushState(){
var ret = f.apply(this, arguments);
window.dispatchEvent(new Event('pushstate'));
window.dispatchEvent(new Event('locationchange'));
return ret;
})(history.pushState);
window.addEventListener('popstate',()=>{
window.dispatchEvent(new Event('locationchange'))
});
}
function modifyELPAIS()
{
verificaAtualizacaoVersao();
let r = setInterval(() => {
if(verificaElemento('#ctn_freemium_article')){
clearInterval(r);
document.querySelector('#ctn_freemium_article').remove();
}
},800);
setInterval(()=>{
if(document.getElementById("elpais_gpt-INTEXT") != null){
document.getElementById("elpais_gpt-INTEXT").style.height = "unset";
}
},800);
}
function modifyNYTIMES()
{
let r = setInterval(()=>{
if(verificaElemento("#gateway-content")){
clearInterval(r);
document.querySelector("#gateway-content").remove();
incrementaConteudoAPI();
verificaAtualizacaoVersao();
}
}, 800);
}
function modifyJOTA()
{
let rotina = setInterval(()=>{
if(verificaElemento("head")) {
clearInterval(rotina);
if(links[i].getAttribute("href").includes("https://www.jota.info/wp-json/wp/v2/
posts/"))
{
linkJSON = links[i].getAttribute("href");
getJsonConteudoNoticia(linkJSON);
break;
}
}
removeBloqueioPaywallJOTA();
verificaAtualizacaoVersao();
}
},800);
}
function getJsonConteudoNoticia(link)
{
let rotina = setInterval(()=>{
if(typeof(axios) == 'function') {
clearInterval(rotina);
axios({
method: "GET",
url: link,
timeout: 15000
}).then((resp)=>{
let respFunction =
setNoticiaContainerJOTA(resp.data.content.rendered);
}).catch((erro)=>{
console.error(erro);
});
}
},800)
}
function setNoticiaContainerJOTA(noticia)
{
let childrenContainer = document.querySelector(".jota-
article__content").children;
let arrayPossibleAttributes = ["style", "data-amp-original-style"];
if(childrenContainer[i].getAttribute(arrayPossibleAttributes[j]).includes("font-
weight:400"))
{
childrenContainer[i].innerHTML = `${noticia}`;
incrementaConteudoAPI();
return 1;
}
}
}
}
return 0;
}
function removeBloqueioPaywallJOTA()
{
let rotina = setInterval(()=>{
if(verificaElemento(".jota-paywall__wrap"))
{
clearInterval(rotina);
document.querySelector(".jota-paywall__wrap").remove();
}
},800);
}
function removeBannerProJOTA()
{
let links = document.querySelectorAll("a");
function modifyPossoLer()
{
const codigo =
`if(typeof(VERSAO_ATUAL) == 'undefined')
{
var VERSAO_ATUAL = '${CURRENT_VERSION}';
}`;
try{
script.appendChild(document.createTextNode(codigo));
}catch(e){
script.text = codigo;
}finally{
document.head.appendChild(script);
}
}
function modifyEXAME()
{
verificaAtualizacaoVersao();
if(document.querySelector(".xm-paywall") != null){
try{
let unlockedContent = "";
(__NEXT_DATA__.props.pageProps.postData).forEach((data)=>{
unlockedContent += (data.hasOwnProperty("content")) ?
data.content : "";
});
document.getElementById("news-body").innerHTML = unlockedContent;
incrementaConteudoAPI();
document.querySelector(".xm-paywall").remove();
}catch(erro){
let s = setInterval(()=>{
if(typeof(Swal) == 'function'){
clearInterval(s);
console.log('ACHEI SWALL');
if(Swal.isVisible() == false){
sweetAlert(
'info',
'Aguarde um momento...',
'Estamos removendo os bloqueios para voc�...<br><br>'
);
}
}
},800);
let r = setInterval(()=>{
let paywallBlock = document.querySelector(".xm-paywall");
if(paywallBlock != undefined && paywallBlock != null &&
typeof(axios) == 'function'){
clearInterval(r);
axios({
method: 'GET',
url: document.location.href,
timeout: 20000
}).then((resp)=>{
let codigoFonte = new
DOMParser().parseFromString(resp.data, 'text/html');
let newsBlock = codigoFonte.getElementById("news-body");
let u = setInterval(()=>{
if(newsBlock != null && newsBlock != undefined){
clearInterval(u);
if(newsBlock != ''){
sweetAlert(
'success',
'Sucesso',
'�timo! Conte�do desbloqueado!'
);
document.getElementById("news-body").innerHTML
= newsBlock.outerHTML;
paywallBlock.remove();
incrementaConteudoAPI();
}else{
sweetAlert(
'error',
'Erro',
`Ops, tivemos um pequeno problema!<br>Por
favor, tente novamente mais tarde.<br><br><spam style='font-weight: bold !
important;'>C�digo do erro: </spam>Erro ao montar newsBlock `
);
}
}
},800);
}).catch((erro)=>{
sweetAlert(
'error',
'Erro',
`Ops, tivemos um pequeno problema!<br>Por favor, tente
novamente mais tarde.<br><br><spam style='font-weight: bold !important;'>C�digo do
erro: </spam>${erro.toString()}`
);
});
}
},800);
}
}
}
function modifyRESPAI()
{
enableUrlChangeDetect();
checkButtonCreation();
window.addEventListener('locationchange',()=>{
checkButtonCreation();
});
unlockPaidContent();
window.addEventListener('load', ()=>{
try{
verificaAtualizacaoVersao();
metodoOriginal();
metodoAlternativo();
}catch(erro){
alert(erro.toString());
}
});
}
function metodoOriginal()
{
const TIMEOUT = 3000;
setTimeout(()=>{
let codigoSemBloqueio = document.querySelector("html");
let scripts = codigoSemBloqueio.querySelectorAll("script");
removeScriptObserver(scripts, codigoSemBloqueio);
},TIMEOUT);
}
function setSelectableArea()
{
let divs = document.querySelectorAll('div');
divs.forEach((div)=>{
let cssProperties = getComputedStyle(div);
if(cssProperties.inset == '0px' && cssProperties.cursor == 'pointer')
div.style.cssText += 'inset: unset !important;';
});
}
/* function removeVideoBlockingAulao()
{
if((window.location.href).includes('/aulao-')){
let blockVideo = document.querySelectorAll('.video-overlay');
for(let i=0; i<blockVideo.length; i++){
blockVideo[i].remove();
}
let chat = document.querySelector('.chat-container');
if(chat != null) chat.remove();
}
} */
function removeBloqueioExercicioLivro()
{
let keys = [false, false, false];
let divBlock = document.querySelectorAll(".ReactModalPortal");
let body = document.querySelectorAll(".ReactModal__Body--open");
let containerBlock = document.querySelectorAll(".NoAccessDisclaimer__Container-
sc-6er3z1-0");
body.forEach((b)=>{
b.classList.remove("ReactModal__Body--open");
keys[0] = true;
});
divBlock.forEach((div)=>{
div.remove();
keys[1] = true;
});
containerBlock.forEach((container)=>{
container.remove();
keys[2] = true;
});
function removeHeaderLogin()
{
let headers =
document.querySelectorAll(".global_menu__fixed_header__login_container");
headers.forEach((header)=>{
header.remove();
});
}
function removeBlur()
{
let blurElements = document.querySelectorAll(".blur");
if(blurElements.length>0){
blurElements.forEach((blurElement)=>{
blurElement.classList.remove("blur");
blurElement.style.filter = 'none';
});
incrementaConteudoAPI();
}
}
function removeAllBtnShowSolucao()
{
let btnSolucaoCompleta = document.querySelectorAll("#exercise-expand-button");
let btns = document.querySelectorAll(".exercise-theory-expand-button");
let buttons = document.querySelectorAll('button');
btnSolucaoCompleta.forEach((btn)=>{btn.remove();});
btns.forEach((btn)=>{btn.remove()});
buttons.forEach((button)=>{button.remove();})
}
function removeBloqueioTeoria()
{
let elementosPaywall = document.querySelectorAll(".paywall");
let elementosTheory = document.querySelectorAll(".theory-container");
let btnExpandir = document.querySelectorAll(".expand-overlay");
elementosPaywall.forEach((elem)=>{elem.classList.remove("paywall");});
elementosTheory.forEach((elem)=>{elem.classList.remove("theory-container");});
btnExpandir.forEach((elem)=>{elem.remove();});
}
function removeBloqueioConteudoExclusivo()
{
let bloqueioOverlay = false;
let bloqueioWrapper = false;
function unlockPaidContent()
{
setInterval(()=>{
if(typeof(_current_user) != 'undefined' && _current_user != null)
{
if(_current_user.hasAccess == false)
{
try{
_current_user.hasAccess = true;
document.getElementById("body-wrapper").click()
}catch(e){
console.log("ERRO ATUALIZA FRAME CADEADOS AFTER UNLOCK");
}
finally{
incrementaConteudoAPI();
}
}
}
},800);
}
function metodoAlternativo()
{
let r = setInterval(()=>{
try{
expandContent();
removeExpandButtons();
removeShowCompleteSolutionButtons();
removeAllBlurFilter();
incrementaConteudoAPI();
}catch(e){
clearInterval(r);
console.log(`ERRO DESBLOQUEIO RESP AI => ${e.toString()}`);
sweetAlert(
'error',
'Erro',
`Ops, tivemos um pequeno problema!<br>Por favor, tente novamente
mais tarde.<br><br><spam style='font-weight: bold !important;'>C�digo do erro:
</spam>${e.toString()}`
);
}
},800);
}
function expandContent()
{
let sections = document.querySelectorAll('section');
sections.forEach((section)=>{
if(section.offsetHeight == 300){
section.style.height = 'unset';
}
});
}
function removeExpandButtons()
{
let btn = document.querySelectorAll('button');
btn.forEach((button)=>{
if((button.textContent).includes('Expandir')){
button.parentElement.remove();
}
});
}
function removeShowCompleteSolutionButtons()
{
let btn = document.querySelectorAll('button');
btn.forEach((button)=>{
if((button.textContent).includes('Mostrar Solu��o Completa')){
button.parentElement.remove();
}
});
}
function removeAllBlurFilter()
{
//TIRA BLUR TEORIA E EXERCICIOS
if(verificaElemento('body')){
let r = setInterval(()=>{
if(verificaElemento('.paywall-content')){
clearInterval(r);
document.body.innerHTML += '<style>.paywall-content{filter: unset !
important;}</style>';
}
},800);
let u = setInterval(()=>{
if(verificaElemento("#exercicios-resolvidos")){
clearInterval(u);
document.body.innerHTML += '<style>#exercicios-resolvidos
div{filter: unset !important;}</style>';
}
},800);
}
}
/*
===================================================================================
=================== */
function createButtonResposta()
{
let r = setInterval(()=>{
if(document.body != null && document.body != undefined && typeof(Swal) ==
'function'){
clearInterval(r);
if(document.getElementById('btnResposta') == null ||
document.getElementById('btnResposta') == undefined){
let btnResposta = document.createElement('button');
btnResposta.setAttribute('id','btnResposta');
btnResposta.setAttribute('title','Ver Resolu��o');
btnResposta.innerText = 'Ver resolu��o do exerc�cio';
document.body.appendChild(btnResposta);
function showSolution()
{
let JWT_TOKEN = getCookie('user_jwt');
let ID_EXERCICIO = getExerciseId();
Swal.fire({
title: 'Resolu��o Completa',
html: `<iframe
src="https://possoler.tech/API/responde_ai/index.php?userToken=$
{JWT_TOKEN}&exerciseId=${ID_EXERCICIO}" style='width: 100%; height: 100% !
important; border: none;'></iframe>`,
showCloseButton: true,
allowEscapeKey: false,
allowOutsideClick: false,
showConfirmButton: false,
customClass: {
popup: 'respai',
content: 'contentSolution',
htmlContainer: 'contentSolution',
header: 'headerPopup'
}
});
}
},800);
}
function getCookie(cname)
{
let name = cname + "=";
let decodedCookie = decodeURIComponent(document.cookie);
let ca = decodedCookie.split(';');
for(let i = 0; i <ca.length; i++) {
let c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return null;
}
function getExerciseId()
{
let fullURL = document.location.href;
let urlParts = fullURL.split("/");
return urlParts[urlParts.length-1];
}
function importCDNSnackBar()
{
let i = setInterval(()=>{
if(verificaElemento("head")){
clearInterval(i);
//ADD SWEETALERT JS
let sweetAlertJS = document.createElement('script');
sweetAlertJS.setAttribute('src',
'https://cdn.jsdelivr.net/npm/sweetalert2@10');
document.head.appendChild(sweetAlertJS);
}
},800);
}
function verificaAtualizacaoVersao()
{
if(window.location.href.includes('possoler.tech')) return;
axios({
method: 'get',
url: URL_API_UPDATE,
timeout: 20000,
}).then((resposta)=>{
let updateVersion = resposta.data.update.currentVersion;
let msgUpdate = resposta.data.params.msg;
let tituloBtn = resposta.data.params.btnMgs;
let tempo = resposta.data.params.time;
if(CURRENT_VERSION<updateVersion){
tempoAwait = 12;
let options = configSnackBar(msgUpdate,tituloBtn,tempo);
Snackbar.show(options);
}
verificaMensagensAPI(tempoAwait);
}).catch((erro)=>{
console.error(erro);
verificaMensagensAPI(tempoAwait);
});
}
}, 800);
}
function verificaMensagensAPI(time)
{
const URL_MESSAGES = 'https://possoler.tech/API/searchMessages.php';
let r = setInterval(()=>{
if(typeof(axios) == 'function'){
clearInterval(r);
axios({
method: 'GET',
url: URL_MESSAGES,
timeout: 40000,
}).then((resposta)=>{
if(resposta.data.messages.length>0){
setTimeout(()=>{
let qtdMessages = resposta.data.messages.length;
showSnackMessages(resposta, qtdMessages);
}, time*1000);
}
}).catch((erro)=>{
console.error(erro);
});
}
},800);
}
let options = {
text: resposta.data.messages[contMessageIndex].msg,
actionTextColor: '#a1ff00',
showAction: true,
actionText: 'OK',
pos: 'top-right',
duration: tempoMensagemAPI*1000,
customClass: 'snackBarMsg',
};
Snackbar.show(options);
contMessageIndex++;
tempoMensagemAPI++;
setTimeout(()=>{
if(contMessageIndex>=qtdMessages) return;
showSnackMessages(resposta, qtdMessages);
}, tempoMensagemAPI*1000);
}
function incrementaConteudoAPI()
{
const ENDPOINT_INCREMENTVIEWS =
'https://possoler.tech/API/incrementViewsConteudos.php';
if(typeof(axios) == 'function'){
axios({
method: 'post',
url: ENDPOINT_INCREMENTVIEWS,
timeout: 60000
}).then((resposta)=>{
console.log('Contabilizar noticia API = ' + resposta.data.status);
}).catch((erro)=>{
console.log('ERRO Contabilizar noticia API');
console.log(erro);
});
}else if(self.fetch){
fetch(ENDPOINT_INCREMENTVIEWS)
.then(response => response.text())
.then(pageSource => {
console.log('Contabilizar noticia API = SUCESSO');
}).catch((erro)=>{
console.log('ERRO Contabilizar noticia API');
console.log(erro);
});
}else{
console.log('[INCREMENT API FAIL]');
}
}
function getCurrentDate()
{
let today = new Date();
let dd = String(today.getDate()).padStart(2, '0');
let mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
let yyyy = today.getFullYear();
today = `${yyyy}-${mm}-${dd}`;
return today;
}
function getCurrentTime()
{
let today = new Date();
let hh = String(today.getHours()).padStart(2, '0');
let mm = String(today.getMinutes()).padStart(2, '0');
let ss = String(today.getSeconds()).padStart(2, '0');
today = `${hh}:${mm}:${ss}`;
return today;
}
function saveDataForDashboard(codigoSite)
{
let currentData = getCurrentDate();
let currentTime = getCurrentTime();
const ENDPOINT_DASHBOARD =
'https://possoler.tech/API/acessos/insertDadosAcesso.php';
let r = setInterval(()=>{
if(currentData != null && currentTime != null){
clearInterval(r);
if(typeof(axios) == 'function'){
axios({
method: 'POST',
url: ENDPOINT_DASHBOARD,
timeout: 30000,
data: JSON.stringify({
codigo_site: codigoSite,
data: currentData,
horario: currentTime
})
}).then((resp)=>{
if(resp.data.STATUS == 'Sucesso ao executar query!'){
console.log('[AXIOS] DASHBOARD DATA OK!');
}else{
console.log('[AXIOS] DASHBOARD DATA ERROR!');
}
}).catch((erro)=>{
console.log('[AXIOS] FALHA DASHBOARD!', erro.toString());
});
}else if(self.fetch){
fetch(ENDPOINT_DASHBOARD,
{
method: 'POST',
body: JSON.stringify({
codigo_site: codigoSite,
data: currentData,
horario: currentTime
})
}).then(function(res){ return res.json(); })
.then(function(resp){
if(resp.STATUS == 'Sucesso ao executar query!'){
console.log('[FETCH] DASHBOARD DATA OK!');
}else{
console.log('[FETCH] DASHBOARD DATA ERROR!');
}
}).catch((erro)=>{
console.log('[FETCH] FALHA DASHBOARD!', erro.toString());
});
}else{
console.log('SEM AXIOS E FETCH DASHBOARD');
}
}
},800);
}
let r = setInterval(()=>{
if(typeof(Swal) == 'function'){
clearInterval(r);
Swal.fire({
html: CODE,
allowEscapeKey: false,
allowOutsideClick: false,
showConfirmButton: true,
showCancelButton: true,
confirmButtonText: "Enviar Log",
cancelButtonText: "N�o, obrigado",
input: 'checkbox',
inputValue: 0,
inputPlaceholder: "Sempre reportar logs de erros dessa p�gina",
customClass: {
popup: 'logReport',
content: 'contentLogReport',
htmlContainer: 'contentLogReport',
actions: 'marginTop',
container: 'zIndex'
},
inputValidator: (result) => {
let response = (result) ? "true" : "false";
localStorage.setItem('sendLog', response);
},
}).then((result)=>{
if(result.isConfirmed){
sendLogRequest(msgErro, siteErro);
}
});
}
},800);
}else{
sendLogRequest(msgErro, siteErro);
}
}
axios({
method: 'POST',
url: 'https://possoler.tech/API/log_report/',
timeout: 30000,
data:{
msg: msgErro,
site: siteErro
}
}).then((resp)=>{
if(resp.data == "sucesso"){
console.log('LOG CRIADO COM SUCESSO');
return;
}
console.log(`FALHA AO CRIAR LOG - ${resp.data}`);
}).catch((erro)=>{
console.log(`FALHA AO CRIAR LOG - ${erro.toString()}`);
});
}
},800);
}
var contMessageIndex=0;
function verificaElemento(elemento)
{
return (document.querySelector(elemento)!=null) ? true : false;
}
function blockPaywallRequest(urlBlock)
{
const BLOCKED_URL_REQUEST = urlBlock;
GM_webRequest([
{"selector": BLOCKED_URL_REQUEST, "action": "cancel"},
], function(info, message, details) {
console.log('PAYWALL BLOQUEADO');
});
if(typeof(axios) == 'function'){
axios({
method: 'GET',
url: BLOCKED_URL_REQUEST,
timeout: 10000
}).then((resp)=>{
console.log('SUCESSO REQUEST AXIOS');
}).catch((erro)=>{
console.log('FALHA REQUEST AXIOS');
incrementaConteudoAPI();
});
} else if(self.fetch){
fetch(BLOCKED_URL_REQUEST)
.then(response => response.text())
.then(pageSource => {
console.log('SUCESSO REQUEST FETCH');
}).catch((erro)=>{
console.log('FALHA REQUEST FETCH');
incrementaConteudoAPI();
});
}
let r = setInterval(()=>{
if(typeof(axios) == 'function'){
clearInterval(r);
verificaAtualizacaoVersao();
}
},800);
}
/*
=> DETECTA MUDAN�A NA ARVORE DE ELEMENTOS DA DOM
document.addEventListener("DOMSubtreeModified", ()=>{
});
*/