How do you put back the locationbar and menubar from within your own page

G

Guest

Assume that this page
www.externalsite.com/anypage.html
would contain the following javascript:
window.open('www.mysite.com/mypage.html', null, 'location=no,
menubar=no');

Then I would like to do the following:
window.setMenubar(true);
window.setLocation(true);
from within my own page
www.mysite.com/mypage.html

Unfortunately these methods (setMenubar and setLocation) do not exist,
but is it possible to achieve the same things as these methods would
do (put back the menubar and locationbar) when someone else has
removed them ???
 
R

Richard Cornford

Assume that this page
www.externalsite.com/anypage.html
would contain the following javascript:
window.open('www.mysite.com/mypage.html', null, 'location=no,
menubar=no');

Then I would like to do the following:
window.setMenubar(true);
window.setLocation(true);
from within my own page
www.mysite.com/mypage.html

Unfortunately these methods (setMenubar and setLocation) do not
exist, but is it possible to achieve the same things as these
methods would do (put back the menubar and locationbar) when
someone else has removed them ???

The chrome of an existing window cannot be altered at all in most
browsers and in the few in which it can be done that action is
restricted so that it is only possible under special security
conditions.

However, if you wanted to discourage people form opening your site in
new windows you could include a script that transferred your page into
an 'opener' window (which probably would have menu and location bars),
possibly closing the chromeless pop-up along the way.

if((opener)&&(!opener.closed)&&(opener.location)){
opener.location = location.href;
if(window.close)window.close();
}

Richard.
 
R

Richard Cornford

if((opener)&&(!opener.closed)&&(opener.location)){
opener.location = location.href;
if(window.close)window.close();
}

You might also address the possibility that the 'opener' was a frame
within a frameset by using:-

opener.top.location = location.href;

-instead.

Richard.
 
T

Thomas 'PointedEars' Lahn

is it possible to achieve the same things as these methods would
do (put back the menubar and locationbar) when someone else has
removed them ???

Your `?' key is b0rken and whitespace before sentence marks (except
of `-') is a bad idea in Usenet because of automagic line-break.

The Gecko DOM allows for

window.menubar.visible = true;
window.locationbar.visible = true;

I hope for you that you did not ask the opposite of which you want to
achieve, manipulating the working area of your users without asking them.


PointedEars
 

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

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top