Open a link in a specific browser - javascript

I have a web application which runs on all browsers but there is a link to another application which can only run in Internet Explorer. How I can force browser to open this link in a new IE browser when my application running in other browsers such as chrome? Should this piece of code written in server side or client side?

You can't force the client to launch a different browser like you're asking.
What I would suggest is to have your application test when it is launched to see if it is currently running in IE. If it isn't, it should issue an error message stating something like: "This application requires Internet Explorer. Please reopen in IE." Then have it stop there.

Most probably, using resources of JavaScript and HTML5, you cannot run applications on end user's computer. Moreover, it sounds incorrect in terms of security and usability.
The best thing you can do is to write a message like "Open this link in IE" near your link.
At the final page, you can detect a user's browser and, in case it is not an IE, show him a message "Unfortunately, this web-page works only with IE. Please, open it in IE".
By the way, could you tell us, why your page is not working in other browsers? Probably, we will find a proper answer there.

Related

Force a link to open in a different browser (Intranet)

We have an old .asp page application that runs only in IE. The problem is, most of the users are using Chrome or Firefox. Is there anyway possible to force a specific link to open in a different browser? I read that it is possible with URI SCHEME, but I wasn't able to find any good explanation.
As I mentioned, this is ONLY for intranet purposes. I know that it's impossible for users outside of the network.
Thanks

Is it possible to Blink alert "client browser" when new notification came in JSF?

I am working on JSF with primefaces, i have been assigned a task to notify the browser when new message arrived in client desktop, its like Message alert.
I found some concepts p:poll, and p:notificationBar, p:growl but those are happeniing inside the browser window itself, when browser is minimized the user can't get notify the new message arrival.
My question is:
Is it possible to do it in JSF with the help of Javascript?
I don't know whether it is possible to notify to the client?
How can i enable notifications for window minimised state as well?
You can make the title bar flash and on some platforms, even get the user's attention.
Make browser window blink in task Bar
Possible to flash a Browser window using Javascript?
This question shows part of your possible answer.
You should then use a to watch for the notification change. You could use the push framework, but that could be a bit of overkill on the network / connectivity side.
There are some solutions that work for only specific browsers. If you are doing this for your company intranet environment and everyone uses chrome or IE, there might be better solutions. Nonetheless, you should strive to do something that works on all compliant browsers (w3c compliant, that is).
There are some boundaries you should observe, regarding web apps in browser windows and what is the expected behavior. The user expects a minimized / offline browser window to sit quiet. If you are in a corporate environment, this could be waived, but for an app for the general public on the web, some people could (I would) be annoyed by this attention-seeking behavior (on a browser game, for example).

Enable script run in web browser using java script codes

I designed a web page which contains some javascripts, but when I'm running the page in certain browsers like internet explorer my scripts get blocke and the browsers asks for manual enabling of the script in that browser
I need java script or jquery code for enabling script run in any browser automatically. Can anyone help me please?
Thank you
It is impossible for a website to turn on JavaScript if it is disabled in the browser.
Design your site with progressive enhancement and unobtrusive JavaScript in mind.
If, by "certain browsers like internet explorer", you mean "Internet Explorer will not run my code" (as opposed to "Browsers wil JS turned off will not run my code") then you may just need to learn how to write cross-browser compatible code.
Without a specific example of code that does not work (along with the specific error messages you receive), that topic is too broad to cover on StackOverflow.
Sounds like you are running the website locally, ie opening the file not serving it from a web server. Try running a local web server or hosting your site on a free online service and as long as the browser doesn't have JavaScript disabled the messages shouldn't show up.

Javascript code to force html page to open in Chrome browser?

We are using Google Apps at our company and everyone has Chrome installed on their computers. The problem is that we still have to use IE for certain things. I have a few html files on our intranet site that link to Google Docs, but it's opening in an IE browser. I need it to open a Chrome browser so the user doesn't have to sign in each time they open the file. I only have control of the html files settings so is there any way to use Javascript to force a window to open in Chrome?
Thanks!
I believe that if you're using IE you can use ActiveX to open up specific programs.
For instance try looking at 'new ActiveXObject'
You must explicitly allow this however as IE confirms if you want to allow it to be executed.
function loadProg(path){
var active = new ActiveXObject("WScript.Shell");
activeX = active.Run(path);
}
If you know the direct file path use this like
loadProg(path);
More specifically like
window.onload = function(){
loadProg("\"C:\\Program Files (x86)\\Guitar Pro 5\\GP5.exe\"");
};
I don't know the path to Chrome so i used something else instead.
Check if current browser is chrome:
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
if not, alert user to show a message.
Are you asking if you can open a Chrome window from Javascript in an IE window? If so, then no, this is not possible. Javascript code in browsers run within a very strict sandbox that would not permit you to make any system calls. Opening a Chrome window from IE would effectively require you to execute chrome.exe on the client's machine. I'm sure you can see how this ability, if granted, could be misused to execute malicious exe's on the client' system.
I am quite sure that the best you can do using JavaScript is show a message to the user and tell them to open the file in Chrome instead. JavaScript does not have the right to execute an external application such as Chrome. See http://www.w3schools.com/js/js_browser.asp for information about detecting the browser using JavaScript.

Enable and Popup blocker in IE

I wrote a scripting logic in using ActiveX. When the application runs it is blocked by popup blocker. When I enabled it works fine, but I want to enable the popupblocker using JavaScript (especially in IE).
Obviously a website cannot modify the popup blocker settings. And that's a good thing.
You should avoid using ActiveX Controls because it is only supported by IE. Trying running your page on Firefox and it won't work.
Now the actual problem -
Firstly you need to understand what ActiveX Objects are used for? They basically allow a web application to interact with the client machine. For example it can use resources on my local hard drive. This is a security risk. So IE gives a warning for the same. You may disable it in your browser by going to Tools-> Internet Options -> Security Tab. Click "Custom Level" and change all the boxes with ActiveX text in it to "Enable".
But it will still show up in your client browsers.
So the point is try finding an alternative for it.
Hope this helps!
You cant. What you could do is have a message on screen which requests the user to turn off the popup blocker .

Categories