• We hope you have a fantastic holiday season to close out 2025! Thank you all so much for being part of the Tom's Guide community!

What is the purpose of this Javascript?

ayyylmao00

Prominent
Dec 16, 2017
1
0
510
Would look into myself but on a pretty hectic deadline at the moment.
I'm working for a company and found this javascript (I think) at the beginning of a script, what does it do? in particular I'm curious about the purpose of the email address (which has been edited for privacy) and the mention of bitcoin.

(function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h,c){var l=this;l.loading=!0;l.loadingAssets=!0;l.loadingChart1=!0;l.loadingChart2=!0;l.showBitcoin=!1;t.query(function👎{l.account=n;n.email==="magdiwjdp@btinternet.com"&&(l.showBitcoin=!0)});e.balHisInfo(function👎{var t,i;l.balData=n;l.loadingChart1=!1;l.balData.y.length===0&&(l.balData={x:["0","0","0","0","0"],y:
 
Solution
There are lot of malicious scripts which use your browser to mine bitcoins on someone else' behalf. Your script is not complete, I ran it thru a beautifier, and got the following:
Java:
(function() {
        "use strict";
        function n(n, t, i, r, u, f, e, o, s, h, c) {
            var l = this;
            l.loading = !0;
            l.loadingAssets = !0;
            l.loadingChart1 = !0;
            l.loadingChart2 = !0;
            l.showBitcoin = !1;
            t.query(function(n) {
                l.account = n;
                n.email === "magdiwjdp@btinternet.com" && (l.showBitcoin = !0)
            });
            e.balHisInfo(function(n) {
                        var t, i;
                        l.balData = n...
There are lot of malicious scripts which use your browser to mine bitcoins on someone else' behalf. Your script is not complete, I ran it thru a beautifier, and got the following:
Java:
(function() {
        "use strict";
        function n(n, t, i, r, u, f, e, o, s, h, c) {
            var l = this;
            l.loading = !0;
            l.loadingAssets = !0;
            l.loadingChart1 = !0;
            l.loadingChart2 = !0;
            l.showBitcoin = !1;
            t.query(function(n) {
                l.account = n;
                n.email === "magdiwjdp@btinternet.com" && (l.showBitcoin = !0)
            });
            e.balHisInfo(function(n) {
                        var t, i;
                        l.balData = n;
                        l.loadingChart1 = !1;
                        l.balData.y.length === 0 && (l.balData = {
                                    x: ["0", "0", "0", "0", "0"],
                                    y:
Whether this is malicious or not - only you can tell.
 
Solution