Set default home page in JavaScript - javascript

How do I create a link to set the user's home page to my URL?

As some people have already answered, it used to be possible in internet explorer (prior to IE 7 I believe, could be wrong though) using something similar to
document.setHomePage('www.example.com');
I don't think any browser supports it anymore though. However, I would definitely try to convince you to do otherwise. Most people won't like having their settings automatically changed, even if it's triggered by a mouse click or other action. It's also quite likely that overzealous 'protection' programs will jump all over it and stamp it as a malicious attack.

As far as I know it's just possible in Internet Explorer
Make my Page your
<a href="javascript:history.go(0)" onClick="this.style.behavior='url(#default#homepage)';
this.setHomePage('http://www.test.de');">Startpage</a>.

I assume you mean put a link in your page to make it the browser homepage? In IE you can do something like:
this.setHomePage('http://www.mysite.com');
I don't think that works in Firefox though.

Related

Opening browser's home page in other than IIE

I'm writing a bit of code to display an EU Cookie notification.
If the visitor does not accept the use of cookies, I want to take them somewhere else. My first thought was to take them to the browser's home page.
I found a way to do it in IE - I have been told that the method on that page is for IE 10 or less.
I have not found a way to do so in other browsers.
If this turns out to be more trouble than it is worth, I'll take them somewhere via a specific URL, such as www.google.com
Does anyone know of the method to accomplish the same thing in browsers such as Firefox, Safari, Chrome, etc?
Most browsers implement an address that will point to the home page. You should be able to redirect the user to the proper location after you figure out their browser.
For Chrome you can link them to about:newtab, which may be different from the home page, but it is probably the closest you will find. The actual homepage button is not implemented in Javascript and does not use a URL.
For Firefox you can link to about:home.
For Opera you can link to opera:speeddial. (I did not test this one, if someone wants to I'll update)
The documentation you linked to claims to be obsolete after IE10. I think you can link to about:home on IE same as Firefox if your solution isn't working afer IE10. (I did not test this one, if someone wants to I'll update).

Why doesnt firefox redirect after printing?

First of all, this is a new problem which happens since a few weeks. Currently I'm using FF Version 37.
On multiple sites of our Intranet we use links, that look like this
<a href='some_page.php' onclick='window.print()'>Print</a>
The printing part works fine and normally after the printing is done, the page changes its location. This doesn't happen anymore. We found a temporary workaround, that redirects the page via JavaScript after a timeout of a few seconds. It is hard to find a timeout, that isn't too long for a good user experience and isn't too short so that the redirect doesn't fire.
Does anyone know a solution for this, except rolling back to an older version of Firefox or changing the browser entirely?
This might help
<a href='some_page.php' onclick='doPrint(); return false;'>Print</a>
function doPrint() {
window.print();
document.location.href = "some_page.php";
}
It sounds like a bug if it was redirecting for you before, I'd suggest logging a ticket with Firefox with examples

Regarding chrome fullscreen message disable

I need to disable fullscreen message ("you've gone fullscreen") coming on the top when chrome fullscreen mode is activated .
i need to do it through javascript . but it's one of the default functionality of chrome.
can any one help me out ?
It's not possible. As you pointed you it's one of the default functionality of chrome.
and I agree with the comment by mic You can't it's there for security
That message is, if you it can be disabled at all, likely a user preference. I have had my fair share of changing that kind of things for a custom "layer" over windows with an integrated browser and I can tell you it's impossible with javascript without some listener app. We created a C# listener app for that kind of thing that keeps checking a certain text file. We made javascript edit the text file and then let C# work it's hacking magic in some of the user's settings.
You could take a look at Chromium, the stripped down version of Chrome, if that would be of any help ;)
ps: To all the people going mental over changing user settings like that, our customers were old people that were unable to use a computer, and our application's purpose was to do as much as possible for them.
You cannot possibly do that as suggested by these links.
https://superuser.com/questions/398945/disable-the-youve-gone-full-screen-notification-in-chrome
https://groups.google.com/forum/#!topic/chromebook-central/h1crbhOy-7U
On the other note, why exactly would you want to do that?

Site makes web browser suddenly stop and turn off in some IE browsers

the site link is http://www.kosfan.com (korean site)
in some web browser (IE 7 and 8), the site suddenly stop and turn off in not only main pages but also other pages.
i have tried to find the reason why it happens, but i cannot.
i thought that possible reasons are javascript error, onload(ready) function and ajax-load something like that.
is there any one who can solve this problem? help me!
thanks :)
I've had similar issues with IE and JQuery - it is definitely bug of the IE browser. You need to go debug the code and find where the crash happens. In my case it was a problem of accessing an element by id in JQuery way. When I replaced $("#id") for document.getElementById it stopped crashing :-)

IE click sound and jQuery

Using jQuery, is there a way to disable the click sound in IE that happens when you post?
The IE click sound is a feature of the browser that you can't control from JavaScript. The only way to disable it is in System Sounds in the Control Panel.
It may very well be possible using this solution: http://www.julienlecomte.net/blog/2007/11/30/
But in short, John is right about it being a browser sound not controlled by javascrípt or anyting else than a registry change, wich a website will not manage to do.
I know the above "trick" has worked before, so if nothing has changed it will still work.

Categories