Can I force a link to open in a specific browser? - javascript

I have designed a website using Firefox and am now looking to integrate a softphone into the webpage, but unfortunately it is made with ActiveX, so Firefox won't support it.
I have tried opening my page in IE9, and it looks a mess because I've used CSS3 for a lot of it and haven't coded it for different browsers because we will only be using Firefox within the office.
Is there a way that I can tell my page in Firefox to specifically open a new page in Internet Explorer and just have the softphone in there? Or is there a way to get ActiveX running in Firefox with a plugin or something?

You can open a link in Microsoft Edge from any browser by adding microsoft-edge: in front of the url in the HREF.
EDGE (works)
I don't know how to get it to work in other browsers though. My team and I spent quite a bit of time on it and couldn't find a raw HTML/JavaScript solution.

I don't think you can open a IE window from firefox, but you can easily build a firefox plugin based on your activex using http://code.google.com/p/ff-activex-host/

It really depends on your exact situation.
If you are targeting multiple users outside a corporate network this is hardly possible to achieve. However, if you are targeting your company's network it's possible to do this using custom protocol.
Your link then would look like: ie://opens_in_ie.com
You'll have to make changes to registry of target computers though. More info about custom protocols is available here: http://msdn.microsoft.com/en-us/library/aa767914%28v=vs.85%29.aspx
In most cases, system administrator can do this remotely.

IETab V2 will let you open a tab within Firefox that runs the IE engine.
Once installed, you can force a link to open with IE by formatting the URL or bookmark like this:
chrome://ietab2/content/reloaded.html?url=http://domain.com

It's somewhat specific, but I created an internal site at work, and I wanted to link to another internal site that only works in IE. To do this, I created/defined my own application protocol in the registry. Then I added to my links the protocol header. This is similar to what apple does when you click a link and it opens iTunes. The downside to this approach, however, is that users will have to install the registry modification for it to work... like I said, it's really a solution for a very specific scenario.

Same answer as from chuck wallace
If you want to start from for example in Internet Explorer, go to C:\Program Files\Internet Explorer\iexplore.exe and create a shortcut to the Desktop.
When you check the properties from this created shortcut, you will see the Target: C:\Program Files\Internet Explorer\iexplore.exe.
Now you can place the shortcut from the website, behind the Target. It will show something like this: C:\Program Files\Internet Explorer\iexplore.exe www.nu.nl. Or this C:\Program Files\Internet Explorer\iexplore.exe https://stackoverflow.com.
This way it opens IE first and then the website.

Related

Open windows calculator from website

How can i open windows calculator from website?
with javascript or actionscript?
Ive tried avtiveX but its only in explorer, I want to open calculator from google chrome
You can't*. Consider the implications if you could open an arbitrary program on someone's computer from a web page...
(* Without writing and installing a plug-in, and plug-ins are increasingly being phased out by browser vendors in favor of sandboxed extensions.)
The only solution i found is using URI scheme
window.open('Calculator:///'); /* shows a confirm dialog to run the app*/
i'm not sure if this would work on older versions (7,8,8.1) but it works on windows 10
Use href="ms-calculator://" but you'll get a popup asking if you want to open it. If that is no good, then you would have to somehow get it to open without the alert popup.

How to debug web app on windows mobile (7 and later) [duplicate]

I'm not a Windows Phone developer, and I want as little to do as possible with anything related to Microsoft. Nonetheless, I need to get my mobile web app running properly on Windows Phone 7. What debugging tools are available for the platform? Something like the Webkit developer tools or Firebug would be ideal, either from the phone itself or more likely, remotely debugging from my computer.
If such a thing doesn't exist, I'd settle for being able to read Javascript error messages, and view the contents of variables using alert() or similar. At this point, all I know is that my JS is failing: I don't know where or why, let alone how to fix it.
My dev computer is running OS X, and I'd really like to be able to use these tools from OS X if possible. Assuming that debugging tools exist (which I really hope they do) are they designed for Windows only? If so, does anyone know how well they would work with Wine or similar?
EDIT: I have a physical Windows Phone 7 device, so I can use that. However, alert() doesn't seem to be working, which is why I'm posting this question. Does alert() normally work on the WP7 browser?
You'll likely find the Mobile Perf Bookmarklet to be the easiest all-in-one tool for testing any mobile device.
Works well on the iPhone/iPad/Samsung Galaxy Tab in my testing so far.
Quote:
It displays a menu with links that load other bookmarklets including Firebug Lite, Page Resources, DOM Monster, SpriteMe, CSSess, and Zoompf.
Unless you have a Windows Phone 7 device, you will need to run Windows in BootCamp and install the Windows Phone Developer Tools in order to test in IE on the emulator. I don't know about Whine, but I ran into major problems trying to test in Parallels - so based on my experience, I suggest keeping it as simple as possible.
There is no console in IE on the phone, so you will need to use alert, like you suggested, or just write text to a div on your page as a custom console.
If you really want to code in OS X (which I definitely understand), using a separate machine for testing IE in the WP7 emulator is going to be your best bet.
EDIT: I just tested alert and it did work fine on my Windows Phone. My guess is that a syntax error is preventing it from calling.
The following may be interesting
Simple IE debug tool for Windows Phone
Supports
Html traversing
Html node styles, properties, metrics
Reading console output
Executing js on device side from console (including intellisense)
Dynamic script injection - ability to debug live sites
Not supported
js breakpoints
Just wanted to add a note to say that full JavaScript debugging is possible now with Windows Phone 8.1 and Visual Studio 2013 Update 2. Full details are available at:
http://blogs.msdn.com/b/visualstudioalm/archive/2014/04/04/diagnosing-mobile-website-issues-on-windows-phone-8-1-with-visual-studio.aspx
I realize that this doesn't help the versions referenced in the original question (WP7), but I'm hoping this will help people who may find this question and are running a more recent version.
Something that has worked for me, is to test my mobile pages through the Windows Vista built-in Internet Explorer browser.
It comes with a script debugger ( which you have to enable in Advanced Options tab through the Internet Options menu ), and it seems that it gets really close to the Internet Explorer Mobile implementation.
Another tip would be, that, instead of using window.alerts, you can also use document.write or set output to a div content.
I'm using this hack to have console.log send info back to the server (it uses window.fetch, which I'm polyfilling, but could use xhr instead) https://gist.github.com/wheresrhys/bf93057ee3a594454582

Create Internet Explorer extension changing content of a webpage

I'd like to develop an Internet Explorer extension that changes the content of a specific webpage, like content scripts in Google Chrome. (eg. when I go to the website Google and I search for "car" I'd like to have a div created on the page with the word "car" inside).
I've been looking on SO but haven't found clear evidences if this kind of thing is possible.
What I'm specifically looking for is a clear tutorial or some example of how to do this.
Bruno,
That is exactly what GreaseMonkey for IE is made for http://www.gm4ie.com/
I have answered a similar question, but the answer is in C#. It describes how to create a fully working project to accomplish exactly what you asked: changing page contents!
How to get started with developing Internet Explorer extensions?
It covers other topics too:
running javascripts from the addin
how to register IE addins
saving data (addin configurations)
You can read more about Internet Explorer Extension from MSDN:
http://msdn.microsoft.com/en-us/library/aa753587(v=vs.85).aspx
Extensions in IE are not created using web technologies, they are created using C++/.NET. Such as ActiveX
Similar to "GreaseMonkey for IE" is Trixie:
Trixie is to Internet Explorer as Greasemonkey is to Firefox. It lets you remix the Web via scripts. You may do this to either make it more readable, fix bugs or to even add little features to make the site more usable to you. Trixie by itself does none of this. It is just a plugin for Internet Explorer that enables executing chunks of JavaScript code and thus lets you use the Web the way you want to use it.
This is one of the best I found. http://www.enhanceie.com/ie/dev.asp It has give sample scripts as well. Which will help you.
Another one is open source and stable version : firebreath
same kind question is also asked How to get started with developing Internet Explorer extensions?
This is a working example of manipulating the DOM from microsoft. This is a BHO development with MS Visual Studio. Check it out: http://msdn.microsoft.com/en-us/library/bb250489%28v=vs.85%29.aspx

firefox disable/enable add-on in a specific page

I'm programming a system to work with in firefox, based on high end javascript.
The users sometimes uses add-ons that conflict with the system.
Is there a way i can control from my web-site to disable or enable specific firefox add-ons in a page?
Thanks.
You can do it inside an add-on, prior to Firefox 4 there was the nsIExtensionManager interface, starting with Firefox 4 there is the AddonManager object
I would say no, I wouldn't want sites I browse doing anything to my browser add-ons unless I said they could.
With things like Firebug you CAN detect them though and warn the user, then it's down to them to turn them off and not you.
And here's another thought...imagine me turning off your Adblock because my site doesn't work well with it ;)

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.

Categories

Resources