My code: javascript:var a="https://virustotal.com/gui/search/"; var b=a+encodeURIComponent(location.host)+encodeURIComponent(location.pathname); open(b);
When I do this, it does not encode the url in the new tab. (same thing for location.assign instead of open)
However, when I do javascript:var a="https://virustotal.com/gui/search/"; var b=a+encodeURIComponent(location.host)+encodeURIComponent(location.pathname); alert(b);
it alerts the code with the encoded slashes.
tldr: how can I make it encoded using window.open