Javascript to open multiple tabs in single browser - javascript

Does anyone know how to open multiple URL's in a single browser.
Instead of opening multiple windows, I want the urls to open in tabs in IE.
I am trying to approach this using JavaScript.

This strictly is a user preference in the browser and never try to override that.

For actual browser tabs, the only thing you can do is add the target="_blank" attribute to links. This may open tabs, but it may open windows instead. It's a user preference, like phoenix said. (By the way, Firefox, Chrome and Opera all opens "blank" targets in tabs by default.)
The other solution is to use Javascript tabs within the page itself. If you use jQuery, there are some plugins mentioned on this article I just read. Otherwise, do a bit of Googling for pure JS solutions.

What about if it's Internet Explorer only?
Also, Greg's original question was about JavaScript but would it be possible to make a simple ActiveX/.NET object that could do this and you could call from JavaScript and pass URL as a parameter?

You can say "never try to override that" but if the user is in a closed environment in which the browser us under control of the administrator, then the user has no choice. Browsers are used for much more than the web. A browser on a corporate site does not belong to the user, it belongs to the corporation.

Related

Javascript that Creates an Outlook Appointment - Browser Issue

I was looking into a script embedded in a webpage that creates an Outlook appointment and opens it. I tested a sample appointment shared by Brian White: http://www.winscripter.com/WSH/MSOffice/90.aspx
and embedded it in a sample web page, but here are two problems:
The script works only in IE and not in any other browser.
IE issues a security message about an ActiveX control and asks if to enable it.
Do you have any idea how to make it work in all browsers and not to scare users with the ActiveX warning?
Thank you in advance!
The script you've linked to works by creating an instance of the Outlook ActiveX control. As such, no, there's no way to make this work in browsers that don't support ActiveX, which is effectively all of them except Internet Explorer.
As for not scaring the users with the ActiveX dialog box, that's not in your hands. The warning message is a security feature, part of the browser itself, and can only be disabled by changing the browser's settings - which isn't something you can do through code, for obvious reasons!
If it's appropriate to your situation, rather than do this through client-side javascript your could instead use Exchange Web Services on the server-side. This comes with its own set of limitations and things to be aware of, namely (a) it's obviously impossible to open Outlook with this method, and (b) on the server-side you'd require access to the Exchange server and would need to know the username/password of an Exchange user with permission to write to the relevant calendar (which is only going to happen if we're talking about a corporate environment).
Although I realize it is an old post, I wanted to offer another approach.
I notice your question refers specifically to OUTLOOK appointments, but what about using "iCalendar"?
{http://en.wikipedia.org/wiki/ICalendar}
This could offer a wider solution. Also, a page could offer two alternative icons.
One for Outlook, another one using iCalendar, and let the user choose which one to use.
Hope this helps. Cheers.
Marcelo F.

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!

Is there a way using jQuery or Javascript to force a page to open in Firefox?

Is there a way using jQuery or Javascript to force a page to open in Firefox? For example, if the user has their default browser set to internet explorer, but they have firefox on their computer - open a new firefox window with the intended page. If so, I would need to check to see if they have firefox on their machine; otherwise, redirect to the mozilla firefox download site...
any suggestions?
The answer, simply, is no. They don't have file system access like that for security reasons. You can probably imagine what would happen if, say you wrote a program that could crack open QuickBooks and take a look around. If you're worried about compatibility, you can use JavaScript checks to notify them that your page needs to be viewed with Firefox and refuse continuation until they get that settled.
http://www.quirksmode.org/js/detect.html
Or, you know, do it the old fashioned way and build a web page that is cross-browser compatible.
Alternatively, ActiveX might be able to do it, but the user has to accept permissions, and this is highly shady activity.
No. Web browsers do not provide information on other applications installed on a system. It would have security ramifications, such as presenting a fake McAfee antivirus dialog to folks who had McAfee antivirus installed.

disabling the Ctrl+N and File->New options on browsers

How do you disable the Ctrl+N/File->New options from browser windows, specifically for IE.
How much control do you have over the clients?
If you're just serving a page publicly on the WWW, then there's no way.
If you're running a kiosk or a classroom of computers or something, then you could probably hack something together to watch for instances of IE, and disable the menus and trap the Ctrl+N key combination.
Based on the comments, it sounds like you are trying to fix the symptom and not the problem itself. The approach you are hinting at is likely to be of limited use (only works in certain browsers) anyway.
I suggest you post the details of your duplicate session problem and let us take a crack at that.

Categories

Resources