window.open problem in firefox

D

Dominic Tocci

I'm searching for a way to use window.open on my web page to open a window
in firefox that allows the sidebars to work (bookmarks, history, etc).

When I use the following:
var
popWindow=window.open('http://www.yahoo.com','','width=600...ebar=1,directories=1,status=1,scrollbars=1');
the sidebars are disabled. I click on the buttons for bookmarks and history
and they do nothing. I checked the DOM and it says "chromehidden =
extrachrome".

I want no chrome hidden at all. Is there any way to accomplish this with a
window.open in firefox? (target="_blank" will not work for me).

Thank you,
Dominic
 
G

Gérard Talbot

Dominic Tocci wrote :
I'm searching for a way to use window.open on my web page to open a window
in firefox that allows the sidebars to work (bookmarks, history, etc).

When I use the following:
var
popWindow=window.open('http://www.yahoo.com','','width=600...ebar=1,directories=1,status=1,scrollbars=1');
the sidebars are disabled.

Try

var popWindow = window.open("http://www.yahoo.com", "RequestedPopupWindow");

and the sidebar functionality should be there. I just tried it with Deer
Park alpha 1 rv 1.8b2 build 20050703 and it worked.

http://developer-test.mozilla.org/en/docs/window.open

I click on the buttons for bookmarks and history
and they do nothing. I checked the DOM and it says "chromehidden =
extrachrome".

For what kind of application or webpage requirements or context do you
want the secondary window to have sidebar capabilities?
I want no chrome hidden at all. Is there any way to accomplish this with a
window.open in firefox? (target="_blank" will not work for me).

By not defining the strTarget parameter, you are in fact requesting an
unnamed secondary window, just like you would with target="_blank".
Thank you,
Dominic


http://developer-test.mozilla.org/en/docs/window.open

I would make the WindowObjectReference a global variable.

Gérard
 
A

ASM

Gérard Talbot said:
By not defining the strTarget parameter, you are in fact requesting an
unnamed secondary window, just like you would with target="_blank".

hu ?
I use to do not give a target name in my window.open callings
if I don't need it for html code (<a target="something" )

accessing to the pop-p window by its JS name, example :

foo = window.open('page.htm','','width=300,height=200');
foo.blur();
with(foo.document) { open();write('hello');close();}
foo.moveTo(150,90);
foo.focus();
// and so on
http://developer-test.mozilla.org/en/docs/window.open

I would make the WindowObjectReference a global variable.

Don't understand your question

function pop(page) {
WindowObjectReference = window.open(page,'','resizable=1');
}

on pop(page) 1st call, WindowObjectReference becomes global

to avoid that you need :

function pop(page) {
var WindowObjectReference = window.open(page,'','resizable=1');
}

wich is of not real interest ...
(no more calling to the pop up window)
 
D

Dominic Tocci

My dilemma is caused by tabbed browsing and "tabbrowser preferences". I
have a chromeless window, from which I want to spawn fully functional pop-up
windows. Basically, I want to replicate the same behavior as
<a href="http://www.yahoo.com" target="_blank">click here</a>
but I always want the page in a new window, not a new tab. When something
opens in a new tab in a window without any chrome it becomes unaccessible.
Tabbrowser preferences forces the html code above to open in a new tab. The
only way I have found to override the tab functionality is by window.open
and the code I included. I can force all parts of the chrome to appear
except for the illusive "extraChrome" stuff, which apparently includes the
sidebar. (The code works in IE, but not in firefox.)

For some reason, your proposed solution does not override the common plugin
"tabbrowser preferences" at all. In your example, the new window simply
opens in a new tab for me, so I'm back to it being inaccessible. Thanks for
the suggestion though.


Dominic Tocci wrote :
I'm searching for a way to use window.open on my web page to open a window
in firefox that allows the sidebars to work (bookmarks, history, etc).

When I use the following:
var
popWindow=window.open('http://www.yahoo.com','','width=600...ebar=1,directories=1,status=1,scrollbars=1');
the sidebars are disabled.

Try

var popWindow = window.open("http://www.yahoo.com", "RequestedPopupWindow");

and the sidebar functionality should be there. I just tried it with Deer
Park alpha 1 rv 1.8b2 build 20050703 and it worked.

http://developer-test.mozilla.org/en/docs/window.open

I click on the buttons for bookmarks and history
and they do nothing. I checked the DOM and it says "chromehidden =
extrachrome".

For what kind of application or webpage requirements or context do you
want the secondary window to have sidebar capabilities?
I want no chrome hidden at all. Is there any way to accomplish this with
a window.open in firefox? (target="_blank" will not work for me).

By not defining the strTarget parameter, you are in fact requesting an
unnamed secondary window, just like you would with target="_blank".
Thank you,
Dominic


http://developer-test.mozilla.org/en/docs/window.open

I would make the WindowObjectReference a global variable.

Gérard
 
G

Gérard Talbot

ASM wrote :
hu ?
I use to do not give a target name in my window.open callings
if I don't need it for html code (<a target="something" )

accessing to the pop-p window by its JS name, example


window.open("http://browsehappy.com/", "", "resizable");
will create an unnamed secondary window, just like if you had done

<a href="http://browsehappy.com/" target="_blank">Upgrade your browser</a>

Giving a name to a secondary window has nothing to do with accessing the
secondary window. You're confusing, and this happens often, the string
name of a secondary window and its object reference.
What you refer to as "JS name" is in fact the object reference: that has
nothing to do with the string name of the window.


:
foo = window.open('page.htm','','width=300,height=200');
foo.blur();
with(foo.document) { open();write('hello');close();}
foo.moveTo(150,90);
foo.focus();
// and so on

The use of blur, moveTo and focus are certainly suspicious here. You're
using these for no reasons.
Second, you can not script a document without first making sure it is
loaded. Window and document are loaded asynchronously; the load event of
a window is distinct, separate from the load event of the document. The
window object could exist while the document object might sitll not be
scriptable.
Don't understand your question

There is no question: just a statement.
function pop(page) {
WindowObjectReference = window.open(page,'','resizable=1');
}

on pop(page) 1st call, WindowObjectReference becomes global

Variable scope should be explicit for various reasons: code maintenance,
avoiding side effects, etc. That's why there is the keyword var.

to avoid that you need :

function pop(page) {
var WindowObjectReference = window.open(page,'','resizable=1');
}

Here, it is local and such reference won't exist outside the scope of
the function.

Gérard
 
G

Gérard Talbot

Dominic Tocci wrote :
My dilemma is caused by tabbed browsing and "tabbrowser preferences". I
have a chromeless window, from which I want to spawn fully functional pop-up
windows. Basically, I want to replicate the same behavior as
<a href="http://www.yahoo.com" target="_blank">click here</a>
but I always want the page in a new window, not a new tab.

You can not force that. Already K-meleon 0.9, Mozilla 1.8b2, Firefox
Deer Park alpha 1 give (possibly) 100% control over these issues to the
users.

When something
opens in a new tab in a window without any chrome it becomes unaccessible.
Tabbrowser preferences forces the html code above to open in a new tab.


That's one reason among many others why coding of links should be
careful: nothing (at least regarding requested popups and use of
window.open) can be forced anymore and one has to evaluate accessiblity
of links. This trend won't change. You can expect MSIE 7 to implement
tab-browsing (that is already not a rumor but a solid fact).


The
only way I have found to override the tab functionality is by window.open
and the code I included.

Nope. Not true. Mozilla 1.8b2, Firefox Deer Park alpha 1 already offers
users ways to go around (almost) any window.open calls. Same thing with
k-meleon 0.9 and possibly other tab-capable browsers.

I can force all parts of the chrome to appear
except for the illusive "extraChrome" stuff, which apparently includes the
sidebar. (The code works in IE, but not in firefox.)

For some reason, your proposed solution does not override the common plugin
"tabbrowser preferences" at all.

No and my proposed solution should not override or overcome the user
settings, prefs, advanced features. My proposed solution should
sidestep/move out of the way of the users' prefs, advanced settings, etc..
On my own website, I do not try to work against the users' freedom,
preferences or try to work despite/regardless of the users' prefs,
advanced settings; I try to work in accordance to his freedome,
preferences, advanced settings. So every link that opens a new window is
clearly, explicitly identified so that the user can override such
opening mode and have/impose his own preferred mode of opening link
whatever it might be:
- in a new secondary window
- in a new tab in the same window
- in the same tab of the same window
- in the background
- not in the background (with focus transferred)

In your example, the new window simply
opens in a new tab for me, so I'm back to it being inaccessible.

It's the other way actually. If you were to create a new window by
force, your code would be considered as anti-accessible because it
removes flexibility from the user, it would go against the will of
users, against their prefs, their settings.

Gérard
 
D

Dominic Tocci

You've jumped to conclusions. I left out the unnecessary moral details for
the sake of brevity. I did not anticipate being judged.

I offer my users the flexibility to have a special page appear in a
chromeless window. I later present them with a table of rows which
highlight onmouseover. If the user clicks any part of a row (necessitating a
method calling a javascript function), they wish to open an external link.
I have two javascript choices, window.open or document.location.href, and I
must make this choice for the user. The choice is easy considering there is
no chrome in the current window. (Think about it. No tabs. No back button.
External site not designed for that.) I am attempting to restore all chrome
functionality to their new browser window for maximum flexibility. This
works in IE and almost works in Firefox. However, in Firefox the user is
left with no access to any sidebar. The associated menu buttons do nothing.
There is an unfortuate default "extraChrome=hidden" in the DOM for the new
window. I'm trying to avoid that unpleasant experience for the user.

And if the power-users who control window.open can get themselves stuck,
it's their own fault and they can find their way out of it. I'm designing
for the lowest common denominator.

Any solution would be appreciated.
 
D

Dominic Tocci

I found a solution in another newsgroup. I was simply missing the attribute
extrachrome=1. Problem solved.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,078
Latest member
MakersCBDBlood

Latest Threads

Top