Reputation: 181
I have a little application that generates some Javascript code, what can be executed on websites. To execute this code I'm using browser console and for Firefox it works well, but I can't figure out how to make it work with the Chrome browser.
In Firefox I'm generating this Javascript code:
javascript:var els = document.getElementById('video');els.style="";var none = document.getElementById('slika'); none.style="display:none;"
I open the console (CTRL-SHIFT-K), paste it, press ENTER and then the code is doing it's job. I tried with Chrome via console (CTRL-SHIFT-J), in the address bar, but nothing happens. If I'm trying in the console all I get is this line:
"display:none;"
What does it stand for? Is there some syntax error?
If i try in the address bar, the browser redirects me to google and executes a query with the javascript code as search value :)
So I'm stuck with Chrome...
Can someone help me out, please? Thank you very much!
Upvotes: 1
Views: 10251
Reputation: 6214
You don't need the javascript:
prefix if you're entering the code in the console.
Also, I'm not sure if none.style="display:none;"
is valid. Try none.style.display="none";
if you're having problems with it.
Upvotes: 1