1

I've got a spring mvc framework and I want to disable the url address bar when the page loads! (It's not a public web application) How can I achieve this using javascript or jquery.

Update :

Guys, If I can make the url bar read only that would be okay too!

Imesh Chandrasiri
  • 5,558
  • 15
  • 60
  • 103
  • 2
    You could create your own browser that allows this to happen. Otherwise, no. – Ian May 03 '13 at 03:48
  • c'mon guys, we can be creative. You can instruct the user to go full screen? You could write a browser extension? You could contact the IT guys and block all outgoing connections? – Kavi Siegel May 03 '13 at 03:50
  • @KaviSiegel - Since when does jQuery make the IT guys block outgoing connections? – Justin Helgerson May 03 '13 at 03:51
  • @Ek0nomik Hey, I'm just shooting off ideas. He's working on an internal-only application and wants to disable the users from going outside of the app. I mentioned some methods. – Kavi Siegel May 03 '13 at 03:53
  • 2
    opening a new *popup* window with `window.open` can set location (address bar) to read only...see: http://stackoverflow.com/questions/2909645/open-new-popup-window-without-address-bars-in-firefox-ie – MikeM May 03 '13 at 03:53
  • @mdmullinax That might've worked 10-15 years ago, but I doubt any browser still allows that. A lot of those `window.open` options aren't enforced – Ian May 03 '13 at 04:00
  • actually mdmullinax has a good method! I checked it and works fine with chrome & firefox – Imesh Chandrasiri May 03 '13 at 04:05
  • You can't do this, and for good reason. – Justin Helgerson May 03 '13 at 03:47

4 Answers4

1

One potential workaround is to create a simple WPF app that hosts a web browser control that fills up the entire form. The web browser control does not have the url address bar,so you can simulate what you're describing using this approach. Might work since you said it's an internal application.

Note: The browser control will behave like IE

TGH
  • 38,769
  • 12
  • 102
  • 135
0

You cannot hide the address bar in your browser programmatically.

You can hide the address bar in browser windows opened by your javascript code, although I think some browsers are even overriding this now too.

Ken Herbert
  • 5,205
  • 5
  • 28
  • 37
0

I am afraid this is mission Impossible. You can't hide something that is directing you. The link on webpages are all visible. The concept to hide url is to making them non understandable. Encrypt the certain portion of the url like id, slug ...

hsuk
  • 6,770
  • 13
  • 50
  • 80
-1
  1. You can make location bar readonly only if you are using window.open.
  2. In case of IE, we can change the setting of browser for this. But this may not be good idea.

so for just disabling location bar by using window.open, the code is as follows:

subwin = window.open(url,"dummyname",'width=635px,resizable=no, height=535px, menubar=no, toolbar=no, location=no, scrollbars=no'); 

In the example above, location=no disables the location bar. You can change the value of size,scrollbars, menubar etc. as your choice.

Thank you.

Milan
  • 245
  • 3
  • 11