How to disable the url address bar using javascript or jquery - javascript

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!

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

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.

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 ...

You can make location bar readonly only if you are using window.open.
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.

Related

How to hide Address bar of a responsive webapp when opening through mobile browser?

I have a responsive webApp which is accessible from both Web Browser and Mobile browser. I want to hide the address bar once the application loads and this will continue in every other page of the application so that it feels like an APP. Can it be achieved through Javascript?
Well if you are planning to add some extra config in your responsive web app, then you can do it. Take a look at Progressive Web App. In this type user have the option to "Add to homescreen" for any mobile device. Then the address bar will be hidden for this kind of app.
The main thing you have to add in the Manifest.
Hope this helps.
If by 'address bar' you mean the top bar where you enter the website url, then no: you cannot modify the appearance of the browser just by javascript.
You used to be able to open a window without the address bar through javascript, but for security reasons that is no longer possible as users should be able to see on what domain they're on.
Most mobile browsers already have this kind of behaviour by the way, where they hide the address bar once you're scrolling the web page...
You can set your website in full screen mode using this method your address bar will hide automatically.
You can set browser as full width using JQuery OR Meta Tags, Please refer this link.
It will help you.
Thanks

To hide the address bar in popup window by setting disable_window_feature.location value to false

I need to Hide address bar in Pop up window(Security reasons). i used
window.open(“res.html”,“mywindow”,location=0,menubar=0,status=0,scrollbars=0,width=100,height100″);
in my JavaScript Which is working fine. But, for mozilla we need to set Dom.disable_window_open_feature.location value.
In Web application how can i set this in users firfox browser? Is there any way to set this using java script. I want setDom.disable_window_open_feature.location value using JavaScript before i use window.open. How can i do this?
You can't hide it, and even if you could, this would almost certainly provide no security for your application as it could be simply overridden.
The reason any up to date browser will not allow you to hide the address bar, is actually for security/anti-phishing reasons itself. If the address bar was hidden, and you included a popup window (for example to a bank's customer page), and you made a site that looked like the banks login page to capture their customers details. Since the address bar is forced to always be shown, the end user would instantly see the domain was not from their bank.
If you give some more information as to why you have a security requirement to hide the address bar, maybe we can provide an alternative method to help you.
Intelekshual gives a good explanation in the post here, but note this will only work for your local machine, and not other web users:
Firefox 3.0 and higher have disabled setting location by default.
resizable and status are also disabled by default. You can verify this
by typing `about:config' in your address bar and filtering by "dom".
The items of interest are:
dom.disable_window_open_feature.location
dom.disable_window_open_feature.resizable
dom.disable_window_open_feature.status
Also have a look at the Mozilla documentation for window.open to get the official information.
In Firefox 3, dom.disable_window_open_feature.location now defaults to
true, forcing the presence of the Location Bar much like in IE7. See
bug 337344 for more information.

disabling URL (not to be copied) in firefox using Javascript

I want to ask that how could i restrict the user not to copy the URL displayed in firefox. One option is to Disable the URL not to be shown to the user
other one is to Disable the address bar so that the URL can be seen but cant be copied.
But i dont know how to achieve any of these using javascript.
Any help along with code snippet would be highly appreciated.
Thanks in advance
You have absolutely no control over that portion of browser UI.
This cannot be done. Not via javascript, and probably not through any other legitimate means, either.
You can open a new window without the address bar using the window.open method.
But
certain browsers (think mobile...) don't support hiding the address bar
users can possibly disable this feature in their browser settings
there is always more than one way to copy the URL, not only from the address bar

How do you change the URL in the address bar without reloading the page?

How does Shopify do this? Go to their website, click on the Features link and you'll see that the URL in your browser's address bar says:
http://www.shopify.com/tour/sell-online
Then click on any of the sub links and you'll see that the URL in the address bar changes without using a hash and there is no page flip.
I don't think they are using ajax to change the content because it all appears to be included in hidden divs on the page, but regardless, you can apparently change the URL using client side tricks. Your help is appreciated?
You use the new HTML5 history API to push a new state.
Here's the MDN documentation and a good tutorial.
Beware that doing this is often painful (you have to manage correctly the state of your application) and it doesn't work with IE9. It's almost always combined with ajax : it's the solution to let dynamically loaded content be bookmarkable even while the whole page isn't reloaded or changed.
Look into pushState, but be aware it's not supported in all browsers.

Hide the status bar in Firefox

I would like to hide the status bar in Firefox when the mouse is over a link. Here is what the status bar is :
http://support.mozilla.com/en-US/kb/what-happened-status-bar
I already tried window.status with javascript but it doesn't work even if I set dom.disable_window_status_change to false. I didn't find any add-ons ever.
Does someone have a solution ?
NB : this is only for a web application which won't be published on the Internet, my goal is not to hide a target link :)
Thank you.
This won't be possible / allowed by the browser for security reasons.
If this is an absolute requirement, is specific to Firefox, and you control the web browsers for the users that will be using this application, you could write your own Firefox extension to do this for your specific site.
This will not work because this is built in for safety reasons.
To prevent phishing for example or other bad things you can do.
I mean I'm not sure but what you could do is leave the a href ="" tag attribute empty or just insert href="#" and add some javascript which redirects the user to the page you want when he clicks that link. But I'm really not sure if this would work in the way you want it !
You can't hide it when it is over a link, but one way to get around it would be to attach click events to span elements that change the window location. So they would act like links, but there wouldn't be a href attribute to show in the status.

Categories