2

I'm not javascript developer, but i got exceptionally a mission about it. But there is something i can't understand.

<a onclick="return false;" href="javascript:(function(){const%20d=document,n='bmletAWPlus';if(window.bmletLoader===undefined){const%20e=d.createElement('script');e.src=

It's const%20d and const%20e, i can't find any info about it on the web. I guess it's const %20d and was looking for ascii or html value. But i still don't understand what this is really doing.

Can someone explain ?

Thanks

Hearner
  • 2,711
  • 3
  • 17
  • 34
Benjamin K
  • 296
  • 1
  • 2
  • 15
  • 7
    It's a URL-encoded space character. – deceze Jul 18 '18 at 08:47
  • 2
    `const%20d=document` is URLEncoded value for `const d=document` – Vasyl Moskalov Jul 18 '18 at 08:47
  • Simply that lol... Thanks. I knew %20 was the space char. But probably because it was in the javascript i was only seeing "%20d" as one block in my mind. Thanks. – Benjamin K Jul 18 '18 at 09:06
  • If you *were* a javascript developer, you would know [not to use `javascript:` "links"](https://stackoverflow.com/q/2479557/1048572) :-) – Bergi Jul 18 '18 at 09:38
  • It's not my code but the existing one. And I guess you would have right if it was not my situation (but thanks for the link). The javascript is executed from bookmarks for inject code in the current webpage and do some operations (not really good idea for maintainability in my opinion, but whatever). – Benjamin K Jul 18 '18 at 14:32

3 Answers3

3

The JavaScript Encoding replaces most punctuation symbols with the equivalent hex-codes

%20 is the encoding for space (0x20 being space's ASCII code).

Encoding normally replaces a space with a plus (+) sign or with %20.

https://www.the-art-of-web.com/html/character-codes/

Roy G
  • 901
  • 10
  • 25
  • @Vasyl Moskalov answer made me realize how simple it was. As i said earlier, i was seeing "%20d" as one block, probably because i'm not used to see it in the code. Tough morning – Benjamin K Jul 18 '18 at 09:10
1

const%20d stands for const and a space character

Timothy
  • 3,213
  • 2
  • 21
  • 34
1

The %20 token is a ASCII URL encoded value for a space. It is usually visible in URLs that have spaces in them.

Info on all the other characters here: https://www.eso.org/~ndelmott/url_encode.html

Alen Genzić
  • 1,398
  • 10
  • 17