[chromium-discuss] window.open() issue?

119 views
Skip to first unread message

bjh

unread,
May 9, 2010, 3:01:11 PM5/9/10
to Chromium-discuss
I'm wanting to use a browser in maybe a slightly non-standard way,
essentially as a delivery vehicle for an application. I don't have to
worry about page load times, or local storage, or "what the user
wants", or anything else. What I need is a way to create new browser
windows with only the specific decorations that I allow for.

I'm very new to this stuff, but everything I can find says that this
is what I want to do to get a "bare bones" window:

var paramString =
'left=300,top=300,height=300,width=300';
var newWindow = window.open('newWindow.html', 'newWindow',
paramString);

Then I set the onclick handler of something to a function that wraps
that, etc.

Everything I read says that because I have named some window features,
everything I *don't* name won't appear. And the resulting window from
this doesn't have the toolbar, etc. However, it does have a location
bar that can't be edited (although the text can be selected). If I
change my paramString to include location=0, location=no,
location=false, location=1, location=yes, or location=true, I get the
same behavior. It appears that it can't be controlled at all.

Am I missing something? Is there a document somewhere describing
things?

--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

Joe andrieu

unread,
May 9, 2010, 3:09:22 PM5/9/10
to bria...@gmail.com, Chromium-discuss
Brian,

I don't think you'll be able to do what you want in pure javascript in Chrome. The new window's location bar is there for security reasons.

However, you can make your own browser-based application (on Windows using C code and javascript) with the Chromium Embedded Framework.

http://code.google.com/p/chromiumembedded/

Perhaps that will work for you.

-j


On 5/9/2010 12:01 PM, bjh wrote:
I'm wanting to use a browser in maybe a slightly non-standard way,
essentially as a delivery vehicle for an application.  I don't have to
worry about page load times, or local storage, or "what the user
wants", or anything else.  What I need is a way to create new browser
windows with only the specific decorations that I allow for.

I'm very new to this stuff, but everything I can find says that this
is what I want to do to get a "bare bones" window:

var paramString =
            'left=300,top=300,height=300,width=300';
var newWindow = window.open('newWindow.html', 'newWindow',
paramString);

Then I set the onclick handler of something to a function that wraps
that, etc.

Everything I read says that because I have named some window features,
everything I *don't* name won't appear.  And the resulting window from
this doesn't have the toolbar, etc.  However, it does have a location
bar that can't be edited (although the text can be selected).  If I
change my paramString to include location=0, location=no,
location=false, location=1, location=yes, or location=true, I get the
same behavior.  It appears that it can't be controlled at all.

Am I missing something?  Is there a document somewhere describing
things?

  

PhistucK

unread,
May 10, 2010, 12:24:27 AM5/10/10
to bria...@gmail.com, Chromium-discuss
You cannot do it with JavaScript, but executing your URL with Chrome in this way -
"path/to/chrome/chrome.exe" --app "http://www.google.com" will make almost everything go away automatically.
However, if someone uses the keyboard shortcut or the application menu to open a new tab, it will open a new tab.
To overcome this, you can build an extension that will 'not let you get out of a certain range of domains', using the tabs API and the windows API. You can also check whether there is more than one open window or tab and close them. However, you cannot know whether the window\tab that is currently opened is in app mode (no location bar and the rest) or not, I think.

☆PhistucK
Reply all
Reply to author
Forward
0 new messages