New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 4 users

Issue metadata

Status: Fixed
Last visit > 30 days ago
Closed: Jan 2010
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature

  • Only users with Commit permission may comment.

Sign in to add a comment

Issue 2238: Add search engine dialog doesn't allow "{" (open curly brace); can interfere with javascript

Reported by, Sep 13 2008

Issue description

Product Version      : (build 1798)
URLs (if applicable) :
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
    Firefox 3: OK

What steps will reproduce the problem?
1. Right click Omnibox -> Edit search engines... -> Add
2. set Name to 'test'; Keyword: blank; 
3. set URL to 'javascript:alert("test");' (Note "OK" button is active)
4. set URL to 'javascript:alert("test");{};' (Note "OK" button is inactive)

What is the expected result?

Should be able to create new search engine that is a "javascript:" URL containing a "{"

What happens instead?

Cannot save new search engine (can't click "OK")

Please provide any additional information below. Attach a screenshot if possible.

This happens with any "{" character in the Add Search Engine dialog, e.g. "{" 
also fails.

This only happens in the Add Search Engine dialog.  'javascript:alert("test");{};' works in a 
bookmark or when typed into the Omnibox.  (Suspect it conflicts with the use of "{google:baseURL}" 
strings in Search Engines?)

Seems to work for historically imported bookmarklets.  It worked for my existing reddit 
bookmarklets (which had a keyword in Firefox) and failed when I tried to upgrade.  The URL is:

javascript:function b(){var u=encodeURIComponent(location.href);var 

There are other strange combinations that can't be saved:

ok:   http://1
fail: http://1~
ok:   http://1~@
ok    http://1/~
fail: http://1%
ok:   http://1%@
ok:   http://1/%

Comment 1 by, Sep 15 2008

We're using the OSDD syntax, and must be treating characters between {} as bogus. 
Getting the parser to work correctly with javascript here might be tricky.

Comment 2 by, Sep 30 2008

Labels: -area-unknown Area-Misc

Comment 3 by, May 20 2009

Labels: -Type-Bug -Area-Misc Type-Feature Area-BrowserUI
Status: Untriaged

Comment 4 by, Jun 9 2009

Labels: Mstone-X HelpWanted
Status: Available

Comment 5 by, Oct 2 2009

Labels: Feature-Omnibox

Comment 6 by, Dec 3 2009

 Issue 29308  has been merged into this issue.

Comment 7 by, Dec 18 2009

Labels: -Area-BrowserUI Area-UI-Features
Area-UI-Features label replaces Area-BrowserUI label

Comment 8 by, Jan 19 2010

Status: Started

Comment 9 by, Jan 21 2010

The following revision refers to this bug: 

r36743 | | 2010-01-21 01:58:47 -0800 (Thu, 21 Jan 2010) | 7 lines
Changed paths:

Removed restriction for {} so that javascript blocks can be used in the url.
Added unittests for TemplateURLRef::ParseParameter and TemplateURLRef::ParseURL methods.

BUG= 2238 
TEST=Try adding urls with different combinations of {}, they all should work.

Review URL:

Comment 10 by, Jan 21 2010

Status: Fixed

Comment 11 by, Oct 12 2012

Project Member
Labels: Restrict-AddIssueComment-Commit
This issue has been closed for some time. No one will pay attention to new comments.
If you are seeing this bug or have new data, please click New Issue to start a new bug.

Comment 12 by, Mar 11 2013

Project Member
Labels: -Feature-Omnibox Cr-UI-Browser-Omnibox

Sign in to add a comment