Skip to content

Instantly share code, notes, and snippets.

@aldrinleal
Created June 1, 2014 17:31
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aldrinleal/e4f407c46ce15f80eda3 to your computer and use it in GitHub Desktop.
Save aldrinleal/e4f407c46ce15f80eda3 to your computer and use it in GitHub Desktop.
Fonte do Plugin Chrome do "Guardião Itaú"
"function" != typeof String.prototype.a && (String.prototype.a = function (a) {
return this.slice(0, a.length) == a
});
var c = 0,
d = 1;
function e() {
var a = document.getElementById("sf");
document.body.removeChild(a);
a = document.createElement("object");
a.setAttribute("id", "sf");
a.setAttribute("type", "application/gas-events-uni");
document.body.appendChild(a)
}
function f(a, b) {
setTimeout(function () {
chrome.tabs.executeScript(a.id, {
file: "pta.js",
allFrames: !1
});
chrome.tabs.executeScript(a.id, {
file: "dc.js",
allFrames: !1
})
}, b);
0 < c && c <= d && --c
}
chrome.contentSettings && chrome.contentSettings.plugins.set({
primaryPattern: "<all_urls>",
resourceIdentifier: {
id: "npsf_uni.dll"
},
setting: "allow"
});
chrome.webRequest.onBeforeRequest.addListener(function (a) {
try {
if (-1 != a.tabId && !sf.sl(a.url)) return {
cancel: !0
}
} catch (b) {
b instanceof TypeError && e()
}
}, {
urls: ["<all_urls>"],
types: ["main_frame", "sub_frame"]
}, ["blocking"]);
chrome.webRequest.onResponseStarted.addListener(function (a) {
try {
-1 != a.tabId && (sf.bn(a.url) || chrome.tabs.reload(a.tabId, {
bypassCache: !0
}), sf.scu(a.url))
} catch (b) {
b instanceof TypeError && e()
}
}, {
urls: ["<all_urls>"],
types: ["main_frame"]
});
chrome.webRequest.onCompleted.addListener(function (a) {
if (-1 != a.tabId) {
try {
if (sf.sab(a.url) && chrome.tabs.executeScript(a.tabId, {
file: "bio.js",
allFrames: !1
}), !sf.spdc(a.url)) return
} catch (b) {
b instanceof TypeError && e()
}
chrome.tabs.get(a.tabId, function (a) {
a.pinned || (a.active && c < d ? (++c, f(a, 200)) : sessionStorage.setItem(a.id.toString(), ""))
})
}
}, {
urls: ["<all_urls>"],
types: ["main_frame"]
});
chrome.tabs.onActivated.addListener(function (a) {
var b = a.tabId.toString();
if (null !== sessionStorage.getItem(b)) {
if (c >= d) return;
++c;
sessionStorage.removeItem(b);
chrome.tabs.get(a.tabId, function (a) {
a.pinned || f(a, 50)
})
}
chrome.tabs.get(a.tabId, function (a) {
try {
a.url && sf.scu(a.url)
} catch (b) {
b instanceof TypeError && e()
}
})
});
chrome.tabs.onRemoved.addListener(function () {
0 < c && c <= d && --c
});
chrome.runtime.onMessage.addListener(function (a, b, g) {
if ("screenshot" == a) return chrome.tabs.captureVisibleTab(b.tab.windowId, {
format: "png"
}, g), !0;
if ("dcd" == a) return 0 < c && c <= d && --c, chrome.tabs.query({
active: !0,
pinned: !1,
windowId: b.tab.windowId
}, function (a) {
0 < a.length && (a = a[0], c < d ? null !== sessionStorage.getItem(a.id.toString()) && (++c, f(a, 200)) : sessionStorage.setItem(a.id.toString(), ""))
}), !0;
if (a.a("http")) chrome.tabs.update(b.tab.id, {
url: a
});
else try {
sf.ab(a, b.tab.url, function () {
chrome.tabs.update(b.tab.id, {
url: b.tab.url
})
})
} catch (h) {
h instanceof TypeError && e()
}
});
setTimeout(function () {
try {
sf.sl("about:blank")
} catch (a) {
a instanceof TypeError && e()
}
setTimeout(function () {
chrome.browsingData.remove({
since: (new Date).getTime() - 2E3
}, {
history: !0,
cache: !0
})
}, 150 * Math.random() + 200)
}, 40 * Math.random() + 80);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment