Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

With Chrome 15 one is now able to sync search engines (finally). I had a few that executed JavaScript, but they no longer work in the new version because I am not able to execute scripts from the address bar (Omnibar). I understand that this is a security enhancement, but is there a flag somewhere that I can change to enable JavaScript injection?

share|improve this question
    
You must manually type javascript: then write your javascript injection. –  RandomDuck.NET Jul 1 '12 at 4:32
    
I didn't understand. Are you using the search engines feature to run JS functions with some parameters (which'd be cool BTW)? –  YatharthROCK Sep 19 '12 at 11:53
add comment

1 Answer

No, unfortunately the devs have decided to remove the ability to execute JavaScript from the Omnibar (like you can with other browsers) or custom search engines. (This is one reason that I refuse to update Chrome because I have gotten used to running JavaScript utilities like url-decoding or base64-encoding strings from the Omnibar—they won’t even let you make a (static) custom engine without forcibly including a typed string.)

They propose that you use the console instead (yes it’s a lot less convenient, but it works). Like you said, the excuse is for security issues (the devs have taken it upon themselves to unconditionally protect the world from itself no matter what). Despite objections and pleas, there is no flag or setting that can enable it, and begging or starring issues will not change their minds (the devs are obstinate and intend to turn Chrome into a Fisher-Price browser safe enough for even the “noobiest noob”).

However, there is a loop-hole. I wish I could say that it was intentionally left open for people who purposely intend to run JavaScript from the Omnibar, but it is ostensibly just an oversight. As such, it may eventually be closed, but for now, (it works in version 28), you can do it by pre-pending a simple space. Instead of typing this into the Omnibar (which simply empties the Omnibar and does nothing):

javascript:alert('Woot!');

Add a space to the beginning:

␣javascript:alert('Woot!');
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.