Open HTML link with IE11 [duplicate] - 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

Turn bookmarklet into Firefox extension?

I have developed a very powerful and complicated bookmarklet, but it's starting to bump into the edges of the bookmarklet format. I'm considering turning it into a browser extension. For Chrome, I found this tool that makes it easy to get started. I'll need to tweak the outputs a bit, but it's fairly simple.
I'm wondering if there's something similar for Firefox. I want an extension that adds a button to the browser, and when you click it, it runs a script on the page. Can anyone point me to a tutorial, or the related part of the documentation?
Bookmarklets are very simple. The WebExtension API is not good if you want to use the addon right away.
The SDK is guaranteed to work right now, and the level of features which you will use from the SDK for a bookmarklet will continue to work in the future.
It's quite easy. What you want to do is follow this guide: https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Getting_Started_%28jpm%29
Do the prerequisites (install node [which installs npm]) should take just a few minutes.
Then when you get to the Implementing the add-on section of that guide. Don't paste what they say, instead paste this:
var data = require("sdk/self").data;
var pageMod = require("sdk/page-mod");
pageMod.PageMod({
include: "*.mozilla.org",
contentScriptFile: [data.url("jquery.js"),
data.url("my-script.js")]
});
Modify the include to match the website you want to target.
Then create a folder next to your index.js file, call it data. Inside, create my-script.js and paste your bookmarklet. If you need jquery then add that in there as well. If you don't, then remove jquery from the contentScriptFile line in the snippet i pasted above.
Then type in npm jpm xpi in command line (as thats how you use jpm).
To test - Make sure to go about:config and set xpinstall.signatures.required to false, as signing is required for Firefox now. Then drag that xpi to your Firefox.
Then when ready, upload that XPI to addons.mozilla.org :)
Starting at version 42 (current stable version), Firefox includes support for WebExtensions, ie the same API as Chrome Extensions, so you can luckily use the same tool.
Take into account that it's work in progress and it's not 100% ported, so please read the docs about the state of it.
The current Addon SDK will be deprecated in the future in favor of WebExtensions, so I think you should give WebExtensions a try, even more when it allows you to only have to maintain one code base.

Opening one browser from another browser [duplicate]

This question already has answers here:
Open IE browser in Firefox/Chrome page
(4 answers)
Closed 7 years ago.
I am running my web application on Firefox. I have hyperlink on one of the page and when I click on it, it opens another application as a new popup.
But that application is not supported on Firefox. So I want to open it in Internet Explorer, i.e., though I am running the application on Firefox, that particular popup should open in Internet explorer. I am using this to open new window:
var win = window.open(url, "NewWindow", strFeatures);
You can't do this with just ordinary JavaScript; as Levi notes, if you could, that would be a usability and security nightmare.
That said, there are a couple of ways you could get something like this to work. For example, a Firefox add-on can launch external programs, so you could write such an add-on to open your app in IE, and ask your users to install it (or have an admin pre-install it for them, if this is e.g. for an in-house app in a managed workplace setting).
Another possibility might be to use a custom URL scheme (like myapp:) to link to your application, and register that URL scheme to be opened in IE (or, rather, in some kind of a wrapper script that takes the custom URL, converts it to a normal HTTP URL, and opens it in IE). Again, though, this requires configuring (and, probably, installing a script on) the end-user's computer, so it's probably only suited for office or similar environments.
Note that both of these solutions have security implications that you should keep in mind. In particular, any add-on or script you use for them should only work for specific URLs that point to your app, and should refuse to open any other URLs someone might try to feed it.
In any case, if you're trying to do this for a public website, keep in mind that there's no way you can make this work for Linux / Mac users who don't have IE to begin with. And even many Windows users might be reluctant to use IE (not to mention installing an untrusted extension!) without a very good reason; after all, there's presumably a reason why they chose to use Firefox (or Chrome or Opera or whatever) in the first place.
That's not possible and for good reason. Just think of what someone clever -- arguably -- could do if they could cause various programs to run on your computer because you clicked a link on a website...
This is what you're trying to do...run another native application from clicking a link in a browser.
Why not just use Internet Explorer for everything since it works for the pop up?

What's a simple way in Google Chrome to insert Javascript into sites?

I would like to be able to add custom snippets of javascript to any site that matches a regex. This is mostly because of sites that I use daily because of specialized content, but which have a poor design. I want to be able to do something like:
Visit site See that sidebar overwrites content
Whip out developer tools, find div id for sidebar
Edit a snippet of javascript which is executed on document.ready for this domain:
$('#sidebar-right').remove();
A bit of searching for user scripts tells me that I need to be writing a Chrome extension, which seems unfortunate and overkill. Is there not an easier way, or an extension which is nothing but a javascript editor that assigns snippets to domains? I'd really like to be able to edit in Chrome itself, or at least have a file that I can just leave open in MacVim all the time. An extension requires unloading/installing to update as far as I can tell.
If I just had one big javascript file, that would be fine. I'd just wrap my customizations in domain checks.
Bonus love if I can write in CoffeeScript.
The answer is to use the Tampermonkey chrome extension.
https://chrome.google.com/webstore/detail/dhdgffkkebhmkfjojejmpbldmpobfkfo
Why not dotjs http://defunkt.io/dotjs/ ? It's local, you can version it with git, you can easily take it to another computer...
Another alternative that neatly solves the problem is Custom JavaScript for websites. You just need to install the extension, which takes around 2 seconds, and then you can immediately start typing your custom JavaScript for the specified website.
The extension automatically recognizes the current website, so all you need to do is write your code and click on Save. You can also easily import jQuery or your external scripts for convenience.
Custom JavaScript for Websites 2 is an alternative to Custom JavaScript for Websites, with some bug fixes and sync scripts across devices feature.
Snippets are available directly in Chrome Devtools
https://developers.google.com/web/tools/chrome-devtools/javascript/snippets
Witchcraft is another Google Chrome extension for loading custom Javascript and CSS, and it is supposedly for more avanced users. The older dotjs project repository lists Witchcraft as its successor.
What you're looking for is Greasemonkey. But wait, Greasemonkey is for Firefox only, right? Turns out, you can install Greasemonkey user-scripts as native Chrome add-ons. Just go to userscripts.org and hit the Install button on one of them, and Chrome will automatically convert it into a native add-on. Then, write your own and install it using Chrome.
Note: This only works in Chrome 4.0.

How do I debug Internet Explorer on Windows Phone 7?

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

How to create a browser plug in?

I have to create a plug-in that will have to display information when user hovers over certain terms. Can anyone show me the direction how to do it?
I do not have much ideas about creating plug-ins. I know what i want to do can be done by java script. But can a java script file be installed as a browser plug in? any ideas on this will be appreciated! Thanks!
What you want to do is create a userscript. It's exactly what you're describing: a piece of javascript code installed in the browser as a plugin.
Userscripts are supported:
By Firefox using Greasemonkey
By IE with its own version of Greasemonkey
Natively (soon) by Google Chrome
Natively by Opera
And even by Safari
So support is on almost every major browser.
A userscript is the easiest solution for what you're trying to do.
Kango's Content Scripts are similar to userscripts, with perhaps better support for all browsers, and the extension (and thus also the user script) can be installed with one click if self-hosted instead of installing Greasemonkey separately.

Categories