Last active
September 27, 2016 15:08
-
-
Save flavioso16/f0e27e3bac52083b9b60ac52d1bc2164 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var script = document.createElement('script'); | |
script.src = 'https://apps.argos4.me/tool/scripts/chrome.js?v=1'; | |
script.onload = function () { | |
var message = 'Aproveite e faça a compra do seguro agora mesmo para o seu ' + getCookie('modeloCotacao'); | |
argosChromeShare.init | |
({ | |
chromeAppID: 11, | |
authKey: '5brc93ur4tj1nhfr', | |
serviceWorkerURI: 'https://www.seguroautofacil.com.br/service-worker.min.js', | |
manifestURI: 'https://www.seguroautofacil.com.br/manifest.json', | |
welcomeMeta: { | |
title: 'Cotação feita com sucesso!', | |
logoURI: 'https://www.seguroautofacil.com.br/imagem/logo.png', | |
message: message | |
} | |
}); | |
argosChromeShare.optin({ | |
segmentacao: 'ChromeGeral', | |
email: getCookie('emailCotacao'), | |
callbackSuccess: onSucessOptin, | |
callbackError: onErrorOptin | |
}); | |
function onSucessOptin(response) { | |
console.log('Optin success: ', response) | |
} | |
function onErrorOptin() { | |
console.log('Optin error'); | |
} | |
function getCookie(cname) { | |
var name = cname + "="; | |
var ca = document.cookie.split(';'); | |
for (var i = 0; i < ca.length; i++) { | |
var c = ca[i]; | |
while (c.charAt(0) == ' ') c = c.substring(1); | |
if (c.indexOf(name) == 0) return c.substring(name.length, c.length); | |
} | |
return ""; | |
} | |
}; | |
document.head.appendChild(script); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment