HTML: A way to prevent showing href in bottom left Google Chrome - javascript

Is there a way to prevent this to show up at the bottom left of a Google Chrome browser when hovering a with a href?
http://puu.sh/4lQDA.jpg

This is one of those things designed to protect users, it cant be controlled by the page being viewed as it would defeat the purpose. A similar question on super user suggests that it is not possible.

I am not sure if it solves your purpose .. but you could use javascript to redirect you to new page instead of using href if you dont want user to see link on statusbar.
<p onclick="go2URL('http://puu.sh/4lQDA.jpg')">click here</p>
<script>
function go2URL(url)
{
var win=window.open(url, '_blank');
win.focus();
}
</script>
Obviously u can use onclick even on any other html container as well .. this is just an example.
I dont think there is any direct way to disable status bar functioning.

Related

iPhone Safari browser, change # hash URL and then Javascript alert message box stop working

I run a web page in iPhone Safari. The page has a button. on clicking it, will show an alert message box. This is OK. Then, I change or add # hash URL by typing in the address bar, then, alert message box stop working. I click the button, and nothing happens. No javascript error but no alert message box.
Is this iOS Safari known issue?
Please share your thoughts and the solution you have come up with. Many Thanks!
$(".button").click(function () {
alert('Hello');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.2.3/jquery.min.js"></script>
<input class="button" type="button" value="alert" />
Note:
This is not quite due to my code. I have also tested at
Here
I have tested in the most recent iOS versions.
Javascript itself is working
Not JQuery issue, plain JS code also does not work
An alert box is working in iPhone Chrome or other browsers
Could be related to Alert, confirm, and prompt not working after using History API on Safari, iOS and https://forums.developer.apple.com/thread/65054
It seems that alert() becomes undefined. A suggested workaround is to use custom popups instead.
Never used a # inside a url other than as a reference to an anchor, but i'm not 100% sure about this...
I think that adding a # to the url and pressing enter won't reload the page. The #abc in the url does tell the browser to jump to an anchor named abc and so this will never reload the page or trigger some javascript. If you don't want to jump/scroll to some anchor insite your actual page, don't use # within the url. That should solve your problem.
The # in a url is a fragment identifier. It is expecting something to be after the url example: www.yourpage.com/foo.html#bar. This leaves it looking for the bar fragment in your page. The page will not be reloaded.
This might help w3 fragments
Well, this might be due to the fact that you're not making another http request and instead instructing the browser to go to that said hash of (an example) #abc.
If you had an element of some sorts like this with that id, it would jump to that section of the page.
Example:
click to jump down to my section
<p id="abc">my section</p>
I'm assuming when you type #abc in the url, it will be looking for that. Which isn't there, of course.
Other than that, I'm not entirely sure.

Can you make the browser detect Javascript links on elements other than <a>

On medium.com they have a clickable link on an h3 element, however the browser seems to know the URL that it will take you to and shows it in the bottom left side of the screen.
When I inspect element I see that this link is only an h3 element. It has a name attribute, an id and a class on it. There is no element and there is no href.
I assume that they listen to the click event of this element and then redirect the user to the correct page, but what I don't understand is how google chrome knows that this is a link and even shows the url it will take you to.
Is this something the browser now supports? Is there a specific way of forcing the browser to show it?
Yes, there is a <a> element, just further up the line:
This would have been visible in your screenshot too, in the selector bar at the bottom:
(Link to the page, if anyone is interested.)
Yep, it can be done through a simple listener, eg in jQuery:
<h3 id="link1">Link1</h3>
And the codebehind:
$("#link1").click(function () {
window.location.href = "http://www.google.com";
});
Should work in any modern browser, but I'd say they'd all interpret it differently. I'm not sure we really need to know why it works, just that it does - you could get in to asking how anything works in a browser. Presumably they quickly parse all of the code as it is loaded so they know all of the possible events. Something like this might help.
But if not Siguza finde <a href>. I think chrom count dependecis and show redirect page or function. Status bar you can just turn off or on. Or change by "wrong" redirect like can you show "Im the best" take
test
show : localhost34567/Im the Best! ---> ok not perfect :D but you can play with it and have better results.
https://superuser.com/questions/239202/turn-off-the-link-hover-statusbar-in-google-chrome

preventing external page from redirecting MY (parent) page

Using the latest version of Chrome on Mac OS 10.7.
I assume it is some clever javascript that is enabling the folks at this webpage:
http://www.chairworks.com/
...to close my (the parent) page which opened their (chairworks.com) page in the first place.
I did not open them with javascript, but with an <a> tag with the target="_blank" attribute.
If I disable javascript, then the behavior stops.
www.chairworks.com
I would expect the page at chairworks.com/ to simply open in another tab/window... but what I find is that as soon as the new browser tab opens, it closes, and then my page (the parent tab/window) gets redirected to the chairworks.com page.
Kinda rude.
Can someone point me to what code enables them to do that? And how do I prevent it? (Assuming I want a link to behave as expected, such as in my demo page.)
I believe the proper thing to do is set corresponding link type attribute so the browser doesn't provide the target window with and opener reference.
Link
You can read more about link types here: https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types
This is the script they are using:
setTimeout('redirect_page()',0);
function redirect_page(){if (window.opener) { window.opener.location.href = '/home.html'; window.close(); } else { location.href = '/home.html'; }}
As to how to circumvent it (just an idea):
Create your own blank page, with it's source set to about:blank. When it loads (or after a time-out) you could write some code to that window that will then open the offending link.
Then the offending link just closes your buffer-page. F*ck 'm!! Power to the user!
Edit: looks like you could also name your page home.html hehe, but that is not such a workable solution..
Final Edit: SIMPLE LOGIC people...
www.chairworks.com
works for everyone, no javascript needed.
See this working jsfiddle example.
As #GitaarLAB explained, the targeted website is using the window.opener property to get access to your page. Using some Javascript yourself, and an about:blank page in the middle, can help you cut their access to your page. It would be like:
http://www.chairworks.com/
Some notes:
I'm leaving the href property there for users without JS enabled (guess what! the targeted website won't have JS neither! ;), or the web crawlers like search engines' (only those who don't care about JS stuff, though)
Before redirecting to the targeted website, you cut the back-link by resetting the window.opener attribute of the new window.
And after opening the targeted website, there's a return false; to prevent the normal the browser to use the href and target attributes.

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.

any way of redirecting the whole page from script inside iframe

As the topic says, Im looking for a way to redirect to another page, when i click a link in the iframe. i dont want just the iframe to redirect, but the whole window.
is this possible?
preferrably in javascript or in asp.net if possible
EDIT: When i try the answers i get redirected to the source of the iframe, not to the source of the site the iframe lies on... Ill show you the code
function redirect() {
window.top.location.href = "./Nyheter.html";
}
As i dont want the code to be static, so that i can use it on many pages without changing the url, i want to do it this way, alt. get the url from db... but preferrably this way, Solution?
Also, forgot to mention. The pages are not on the same domain, they are on different ones.. this could cause some problems.
Click me!
You cannot use the window.top.location if your frame and the top level page are on different domains.
A similar answer.
javascript: window.top.location.href = "xxx"
You should see this question which is pretty much identical: Redirect parent window from an iframe action
I don't believe you can do it in ASP.net because this has to be done on the client side (ie. Javascript).
window.top.location.href = "http://site.com";

Categories