Internet Explorer minimises on page load - javascript

We have a couple of sites that use a bespoke CMS (e.g. www.trident-ha.org.uk). In these sites whenever a link is clicked in Internet Explorer the browser will minimise for no particular reason.
This is obviously very frustrating and although we have found a few mentions from other people with this problem nobody seems to have a solution.
Presumably this is something to do with JavaScript but it has us baffled.

The only code I know to "minimize" a window would be window.blur(), which actually just removes focus from the window. It works across browsers, so is it possible that there's some IE-only script with this included?
FWIW, I suppose it could also be window.resizeTo(), although I suspect you would have set it resizes the window to very small dimensions if that were the case. Really, scan through all the JS files you load looking for any window.* functions, as those will be the culprit. There shouldn't (knock on wood) be that many because they're a pretty heavy-handed way to control the user's experience.

Related

IE settings through Javascript or jquery

Is there any possibility to set the Internet Explorer settings by running Javascript file..?
I want to set the following settings in IE through javascript/Jquery
Go to, ‘Tools’ -> ’Internet options’.
Under ‘General’ tab, click the ‘Settings’ button in the ‘Browsing History’ section.
Choose the radio button "Every time I visit the webpage".
Click ‘OK’ and restart the IE.
This is not possible - it'd be a bit of a security hole if sites were able to do this...
Firstly, the short answer is no: You can't do what you're asking for.
Javascript within the browser is heavily restricted to only being able to access resources for the actual page being viewed. This is an important security feature.
You cannot access other pages or other tabs. You cannot access parts of the browser UI outside of the page itself. You cannot run external programs.
Even if you could, the way you've described it wouldn't work anyway: The settings page you've described is specific to one particular version of IE. So your hypothetical program wouldn't work in any other browser or even any other version of IE.
However, more importantly, you need to ask yourself why you're asking for this.
The thing is that you're trying to solve a problem with your site. You've found something that resolves it, and you've asked a question about how to automate that. But you need to work backward a bit -- stop trying to work out how to automate this particular solution: you need to ask yourself whether there might be a different way of solving the original problem, which could be automated.
The fact is this: the config setting you're trying to change is for handling how the browser deals with caching of files. There are ways of changing the behaviour of caching that can be scripted by your site. You might want to look at questions like this one for example.
The lesson here is this: Don't simply ask how to do something; explain why you're trying to do it as well. There might be an alternative solution that's better than the one you've thought of.
No, it's not possible to do using JavaScript.
This is not what Javascript designed to do. There is only a way to read browser setting from JS - using signed scripts.

Open a Internet explorer/Firefox etc window with Chrome

I'm building a smaller Web Builder with Javascript and I want the user to be available to preview their page in all the major browsers. Because that the tool only is available for Chrome I need them to get the chance to open a Internet explorer window with the same information, and the same for Firefox and Opera and Safari... Is there a way to do so, in Javascript?
P.S. The information that should appear on in the window is stored in a variable.
If JS can call firefox.exe, it could also call nasty_trojan.exe. The best you can do is generate a custom link server-side, and say "paste this link into your other browsers.
Unless you'd like to be really fancy, in which case you need to render the pages server-side, ala http://browsershots.org/.
There's a chance it could be done if you wrote it as a chrome extension, because those have some measure of trust, but the JS on a page stays very much inside its sandbox.
This doesn't belong on the answers, but I did not see how to comment (I am new, sorry!). This may help. It seems you may need to use a java applet, at least, I'm seeing that in a few places. Hope I've helped!

Porting a web application to work in IE7

I'm developing a web application that uses lots of Javascript and CSS, both of my own creation and through third-party libraries. These include jQuery and Google Maps & Visualization JS APIs.
I've been testing everything in Firefox 3. Things are peachy until it turns out the main target of this webapp is (cue sad trombone) IE7. I'm looking for caveats, advice, libraries, or other references to help make this transition as easy as possible (not that it's actually going to be easy).
I've already tried IE7.js though it hasn't yet shown itself to be the silver bullet I was hoping for. I'm sure that it works as advertised, I think it's just not as all-encompassing as I'd like (example: colors like #4684EE and #DC3912, which are correctly rendered in FF3, are rendered as black in IE7, with or without IE7.js). Are there other libraries out there to help bring IE7 (more) in line with FF3?
A corollary question: what debugger would you recommend for IE7? I'm currently using Firebug Lite, but it runs painfully slowly. Is there anything out there with similar features that I might have missed?
As far as libraries go, jQuery is compatible across all major browsers, so at least you've got that going for you. Without knowing exactly which plugins/modules/libraries you're using, I can't recommend alternatives that are cross-browser compatible.
You could take a look at the Internet Explorer Developer Toolbar. It isn't nearly as good as Firebug, but it's better than nothing.
Get the IETab add-on for Firefox so that you can fire up IE right inside the same tab you test Firefox in. Get the FULL version of Firebug. It will be perfect for you to deal with HTML, CSS, and scripting. HTMLValidator for validating your HTML and CSS. The Web Developer toolbar is a MUST if you don't have it. I can't even go into a fraction of the benefits it has, from images to source viewing to validating scripts it has a lot.
I use a separate stylesheet for IE7. It doesn't have many changes from the original stylesheet, but enough to make viewing in IE7 close to FF. I try not to do ANYTHING for IE6. In fact I encourage the "downfall" of IE6. It's almost ten years old, and full of bugs, and unsupported now!
Unfortunately, Microsoft doesn't really want to be on the same page as the W3C and developers that want web standards so that you don't have deal with what you're going through right now. Regardless of what they SAY, they're still "competing" against the other browsers for control, and it's hurting the developers.
Writing cross browser code is a big topic - you can't really generalize it into "don't float left and padding-left" statements and be done.
Separate stylesheets for ie are messy and not needed IMO.
Generally speaking, firefox fixes broken code in a good bit of cases, so there is a chance that at least some of your stuff looks bad in IE because of open tags that firefox is fixing for you.
Re-slicing a site that's already done might be your easiest way. You should be able to completely redo the CSS from scratch in a few hours tops.
But all this is advice that may not apply - it would be easier to see the code you're talking about.

How can I redirect to IE from other browsers?

I want to redirect to Internet Explorer from other browsers by JavaScript. How can I do that?
You can't.
In a standard security context, browsers provide no way of launching other programs (and a goodly number of systems don't have Internet Explorer anyway). In non-standard security contexts, most browsers still don't provide a way of launching other programs.
JavaScript does not allow you to execute programs (like Internet Explorer) from another web browser. This isn't possible.
I would recommend to either:
Show an error/warning that the site doesn't work or might not work correctly when not using IE
Fix the site to work cross-browser (recommended)
Short answer is that you can't.
The real reason is security, which will (hopefully) always prevent you from running applications on the user's computer, but even if there weren't for that reason... I'm sorry, I just have to nitpick a bit here. What you're trying to do should be absolutely unacceptable in no uncertain terms to every single user and developer. I think I can safely speak for the overwhelming majority of experienced web developers, that techniques designed to dictate to the user which browser to use are always, always, always wrong, not just technically but morally. Yes, I used the M-word. It's immoral to make those sorts of decisions for your users, no matter how dumb they are. Warn them if your site is designed specifically for a particular browser, that's fine, but don't make the actual decision for them.
Sorry, I know this ain't the place for arguing, but I do believe this needs to be clear because it's a real problem in web development that really does waste time and really does cost money and really does harm the web as a whole.
So as far as I'm concerned, I'm glad these security measures are there, because this is an extraordinarily bad idea in the first place, even without the security risks.
No disrespect intended. It just had to be said.
You can't and you shouldn't!
However, this simple javascript, which only works in IE6, can runs firefox.exe from C:\Program Files\Mozilla Firefox ( YES I KNOW IT CAN BE SOMEWHERE IN E: OR D: .... but as I know the default path of Firefox is C:\Program Files\Mozilla Firefox ... you can complete this script and find the correct path of firefox.exe)
This HELL script shows that IE6 is really insecure. ( of course it shows a warning message )
You should never 'FORCE' visitors using your favorite browser. Never ever use such script, this is just for demonstration purpose.
<html>
<head>
<SCRIPT Language="JScript">
function runFirefox() {
File="c:\\PROGRA~1\\MOZILL~1\\FIREFOX.EXE http://stackoverflow.com";
WSH=new ActiveXObject("WScript.Shell");
WSH.run(File);
}
</SCRIPT>
</head>
<body onLoad="javascript:runFirefox();">
<b>For the best experience we FORCE you using Firefox.</b>
</body>
</html>
You should just develop websites that are viewable in all common browsers ;).
No work-arounds for people using different browser types / version.
When developing websites just make sure you meet the standards and all websites have sheets for the common browsers.
You can't.
As far as I'm concerned, I'd love the other way around: redirect any user with IE6 to Firefox/Chrome/safari :-)
You can. We do it because IE has a problem with how many cookies (and how large cookie storage can be) per domain. Because we have so much in our domain we hit a wall with IE. Also, PeopleSoft does not support browsers besides IE so PS users are forced to use IE while everyone else can get locked out of other apps when they hit the IE cookie limit. Is it ugly? Yes. Horribly. It shows what happens when enough planning isn't put into a process and what happens when one group is allowed to make decisions in a vacuum without talking to other groups about potential issues. But this is a fact of life in any organization and especially smaller (size and thinking) ones where there are big egos and weak leadership. Nonetheless...
It is possible to push out to the desktop something that handles a custom mime type. Therefore, when a response goes back to the desktop of type blah/blahblah this triggers an EXE that gets the response (a target location) and fires up IE. Or milks a cow. Whatever you want. You could even use this to tell a PC to take a picture...lots of possibilities.
you can do the following:
function openInChrome(url) {
var ws = new ActiveXObject("WScript.Shell");
ws.Exec("c:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe " + url);
}

Hide google Toolbar by javascript

Is there a way to hide the google toolbar in my browser programmable?
You haven't said which browser you are using so I'm going to assume Internet Explorer* and answer No.
If JavaScript on a web page could manipulate the browser, it would be a serious security hole and could create a lot of confusion for users.
So no... for a good reason: Security.
*. If you were using Firefox, and were talking about JavaScript within an extension to manipulate and theme the window chrome then this would be a different story.
I really think that it is imposible to do that with javascript. This is because javascript is designed to control the behaviour of the site. And the browser is not part of the site.
Of course maby you are talking about some other Google toolbar then the plugin in the browser.
As far as I know, you cannot access these parts of the browser due to security issues. But you can load new browser windows without toolbars as such. I don't know exactly how (hopefully other users will help yout out), but maybe start here: http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20782379.html
(PS: I know, it's experts-exchange, but I'm not going to copy someone elses work, even if it's posted on EE).

Categories

Resources