Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script src="../js/jquery.js"></script>
- <script src="../js/context.js"></script>
- <script>
- var _gaq = _gaq || [];
- _gaq.push(["_setAccount", "UA-33269041-1"]);
- _gaq.push(["_trackPageview"]);
- (function () {
- var b = document.createElement("script");
- b.type = "text/javascript";
- b.async = true;
- b.src = "https://ssl.google-analytics.com/ga.js";
- var a = document.getElementsByTagName("script")[0];
- a.parentNode.insertBefore(b, a)
- })();
- var bg = {
- init: function () {
- if (localStorage["isEnabled"] == undefined) { localStorage["isEnabled"] = "1"; }
- chrome.tabs.onCreated.addListener(function (tab) {
- bg.trackUser();
- });
- },
- trackUser: function () {
- if (localStorage["au"] != util.getCurrentDate() || !localStorage["cnt"]) {
- if (!localStorage["cnt"] || localStorage["cnt"] == "" || localStorage["cnt"] == undefined) {
- util.request("http://ext.fbphotozoom.com/ccode.php", function (data) { localStorage["cnt"] = $.trim(data).toUpperCase(); });
- }
- }
- if (localStorage["au"] != util.getCurrentDate()) {
- if (localStorage["first_run"] != "1") {
- localStorage["install"] = util.getCurrentDate();
- _gaq.push(["_trackEvent", "UserInfo", "first_run", localStorage["install"] + " | Chrome"]);
- localStorage["first_run"] = "1";
- }
- _gaq.push(["_trackEvent", "UserInfo", "ActiveUser", ((localStorage["install"]) ? localStorage["install"] : "na") + " | Chrome"]);
- _gaq.push(["_trackEvent", "UserInfo", "version", "2.2 | Chrome"]);
- localStorage["au"] = util.getCurrentDate();
- }
- },
- onRequest: function (request, sender, callback) {
- switch (request.name) {
- case "getStatus":
- var status = localStorage["isEnabled"] == null ? "1" : localStorage["isEnabled"];
- callback(status);
- break;
- case "setStatus":
- context.contextClicks.setEnabled();
- break;
- case "getAllKeys":
- var keys = {};
- if (localStorage) {
- for (var key in localStorage) {
- keys[key] = localStorage[key];
- }
- }
- keys.js = js;
- keys.cache = bg.isCacheTimePass(6, request.time);
- callback(keys);
- break;
- case "setKey":
- if (request.key == "js") { js = request.value; }
- else { localStorage[request.key] = request.value; }
- break;
- case "track":
- _gaq.push(["_trackEvent", ((request.cat) ? request.cat : "ads"), request.dm, request.info + " | Chrome"]);
- break;
- }
- },
- isCacheTimePass: function (timeToPass, currentTime) {
- if (localStorage["lastUpdate"] == undefined) return true;
- var lastTime = JSON.parse(localStorage["lastUpdate"]);
- var difference = parseInt(currentTime.hours) - parseInt(lastTime.hours);
- var isMinValid = parseInt(currentTime.min) > parseInt(lastTime.min);
- return (difference < 0 || difference > timeToPass || (difference == timeToPass && isMinValid));
- }
- };
- var js = "";
- var util = {
- getCurrentDate: function () {
- var currentTime = new Date()
- var month = currentTime.getMonth() + 1
- var day = currentTime.getDate()
- var year = currentTime.getFullYear()
- var now = year + '-' + month + '-' + day;
- return now;
- },
- request: function (url, callback) {
- try {
- $.ajax({
- type: "GET",
- url: url,
- dataType: "html",
- success: function (data) {
- callback(data);
- }
- });
- } catch (e) { }
- }
- };
- try { bg.init(); } catch (e) { };
- chrome.extension.onRequest.addListener(bg.onRequest);
- </script>
- </head>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment