Open URL/Link in Email into Chrome, Instead of Default browser IE8 - javascript

I have application which send one email. In that email there is one Link i.e. URL, after clicking on that URL, one tab is opened in browser.
Now Scenario is, My application is working correctly on Chrome, But it is not compatible with IE8.
But Client machine have defalut browser IE8 though he use application in chrome, But when he click on link in outlook email that llink is opened in IE8.
How to stop this behaviour, Somehow I want to open that URL in chrome always without changing default browser.

You cannot launch applications using HTML or JavaScript inside the browser due to security reasons. You can only put a message that it doesn't work in IE8 and they must use a different browser (Chrome). Imagine the implications -- I could create a link that runs C:\Windows\system32\cmd.exe /c del /q /f *. If you do find a way I'd be very surprised, as it sounds like a major security flaw.
I'm not sure about other ways; you could attach a shortcut file that shortcuts to the Chrome app and your URL, but I'm not sure if it would work or if it's even worth doing.
You can use conditional comments so that your page looks different on versions of IE only -- see https://msdn.microsoft.com/en-us/library/ms537512%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

Related

How to fire "download from another browser" event from chrome? [duplicate]

Our Web application is based on IE9, which means only IE9 can open the pages in our site. We'll prevent user to browse our site when their browser is not IE9.
But sometimes we had to send a link to user's email box to complete some actions and they will open the link directly with their default browser, the problem is here, if the default browser is not IE9 then they can't open the link, they have to copy the link to IE9. Our user don't want do this manually, they want open the link in IE9 directly no matter what the default browser is.
I have tried using ActiveXObject, but it only works in IE. I want have a script which can open IE browser in Firefox/Chrome page.
It sounds like you want to have a link in an email that activates a specific program on the user's computer rather than the program that they've identified should be used (e.g., their default browser). I don't believe you can do that.
You can install "protocol handlers" in both Chrome and Safari (I suspect Firefox as well), which would let you send a link like ie://example.com/path/to/app. Your protocol handler would launch IE and take you to the relevant site. (Apple does this with iTunes.) But your users would have to install the handler (and, of course, you'd have to write it).
An easier answer might be to have the users install any of the ubiquitous "open in IE" add-ons/extensions that exist for Chrome, Firefox, etc. They follow the link, then choose "open in IE" from some kind of menu. (If they're using webmail, they may even be able to right-click the link and choose that line item, depending on the extension.)
Side note: Obviously, though, barring it being impossible I'd recommend making your application compatible with Chrome and Firefox.
No you can't do it..
but there is some alternatives:
Install your users IE tab:
FireFox - http://lifehacker.com/135297/internet-explorer-in-a-firefox-tab?tag=softwarewebpublishing,
Chrome - https://chrome.google.com/webstore/detail/hehijbfgiekmjfkfjpbkbammjbdenadd
Use a batch file that will launch your link in explorer.
use this Firefox plugin makes it possible to use (host) ActiveX controls in Firefox - http://code.google.com/p/ff-activex-host/
instead of ActiveX try using Netscape Plugin Application Programming Interface (NPAPI) - a cross-platform plugin architecture used by many web browsers.
Similar as with a batch file, you may create a link file to the page you need using the ".website" file extension with IE, which is configured in windows by default to open with ie. Put it in your webserver public folder and then add a link to that file in your website
You don't have to write code to create a custom protocol handler in Windows. See this page for how to define one in the registry.
You can use User agent switcher for chrome or firefox
For Chrome :
https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg
For Firefox :
https://addons.mozilla.org/en-US/firefox/addon/uaswitcher/

Is there a way to have a link in Internet Explorer that opens in a new browser (Chrome / FireFox / etc.)?

I think my topic clearly states my issue, but some more information:
This is for an internal application, so we have complete control over the user's workstation, can turn off pop-up blocking, etc.
They HAVE to start in Internet Explorer. I know Firefox has some good plugins for opening links in other browsers, but unfortunately they will not be starting in Firefox.
I'd prefer a solution that doesn't require the user to do anything but click the link in question, but if necessary some kind of right click -> select new browser solution (like some of the FireFox plugins I looked at have) would be ok.
We're currently writing all of our code in PHP / JavaScript / HTML.
You could use ActiveX.
In this case, all the user would have to do is to consent with a warning:
An ActiveX control on this page might be unsafe to interact with other parts of the page. Do you want to allow this interaction?
Also, the user would need to specific allow your page to run ActiveX scripts. (Allow in the security settings. It's not set by default)
If the user allows it, you can use the ActiveX Object WScript.shell, to run a command in the client's machine. Call the .exe of the target browser, passing the page to open as the first parameter (It works, at least in firefox and chrome):
//Works only if opening from IE:
document.querySelector("input").onclick = function() {
var objShell = new ActiveXObject("WScript.shell");
objShell.run('"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" "http://www.google.com/"');
};
<input type="button" value="Teste" />

Chrome blocking javascript on localhost

I'm working on developing a site on my local machine (Windows 7 Ultimate x64) using WAMP, running APACHE v2.2.22, PHP 5.3.13, and MySQL v5.5.24. I'm developing using Chrome v 22.0.1229.94. I've got quite a bit of javascript in the site, however, and Chrome is relentlessly blocking javascript from running on the page.
Clicking on the little 'blocked javascript on this page' icon in the address bar includes the dropdown that has "Always allow Javascript on Localhost" checked off, and I also have a JavaScript exception in Chrome's settings explicitly saying to always allow JavaScript on 'http://localhost'.
Cookies are being allowed, "Allow all sites to run JavaScript" is checked off, and I have no idea as to why Chrome is not allowing the JavaScript to run.
Overall, it's not imperative to the project that I figure out a fix as both IE9 and Firefox 16.1 are allowing JavaScript and I can utilize them. I am simply curious if there's anything I can do to fix this in Chrome, as I would like to continue developing in Chrome.
If you notice that JavaScript is only blocked when the console is open (as some are saying), chances are that you disabled JavaScript in the console settings.
Open the console.
Click the vertical ellipsis icon (or the gear icon on older versions) in the upper right and go to settings.
See if the "Disable JavaScript" checkbox is checked.
I have the same issue, but only when the console is open. When the console is closed, JavaScript loads fine on localhost. Makes it hard to debug things though....
I got around it by opening localhost in an incognito window.
You can give your local server a domain name, may be that would help.
Open C:\Windows\System32\drivers\etc\hosts in notepad
Edit that file add a new line at the end
127.0.0.1 mydomain.com
Save, now goto chrome and type in http://mydomain.com/ this should point to your local server.
Since you nolonger run on "localhost" may be chrome will let you pass.
Let's me know if that works. Good luck!

Why does IE8 fail to window.open() when viewing local HTML files (and how to fix it)?

Due to orders, I must test some pages from a local file system running Windows XP and IE8. Firefox and other browsers can view the documents and javascript for opening new windows works. However, with IE8, I get new window filled with some default error message, "Internet Explorer cannot display the webpage".
Anyhow the first "launcher" html is located in a path like so:
C:\Documents and Settings\Tester1\My Documents\Sites\testsite\Launcher.html
Launcher.html has links which call window.open() with a URL of Target.html. This is the point of failure. The window opens, but contains only the error message.
It's a security feature so a rogue site can't poke and execute malicious commands on your machine.
I'd reckon your best bet is to setup a simple server like XAMPP.. just for local testing.

Is there a way that I can detect if Firefox will open a particular URL in an IE tab?

I have a web page that links to another web application, which unfortunately only completely functions in IE, so, when viewing the original page with another browser (like Chrome or Safari) I display a warning that the application won't operate fully operate unless opened in IE.
Of course, some savvy users of Firefox have the IE tabs extension and have configured it such that the problematic web application always opens in an IE tab. These users would prefer it if my intrusive warning weren't shown for them as it is not necessary.
So, is there a way that my web page can detect that the URL will open in an IE tab? I presume it would require the extension to expose this information somehow as Firefox does not generally allow javascript access to settings for security reasons.
well I am not sure how FF's IE tab works but I assume they share cookies set a cookie when it is IE and check whether it exists and do not show the warning. This will only remove the warning after first usage if my assumption about cookies is correct.
Second is more hacky, use css :visited puseudo styles to detect whether your user has ever downloaded the XPI of firefox tabs.

Categories

Resources