Steven de Salas edited this page May 22, 2016 · 78 revisions


What?!.. headless Internet Explorer.. are you for real?

Yep, TrifleJS is a wrapper over the .NET WebBrowser Control which uses the underlying Windows COM API to control a window-less instance of Internet Explorer.

To translate in plain english: TrifleJS is not a self-contained browser, but will be controlling whatever version of IE you have installed in your computer, a bit like WebDriver but without showing anything on screen other the command line.

Why the name?

There is a bit of a tradition in the PhantomJS ecosystem to use names derived from other-worldy entities, the pun here is that you are running a 'phantom' (non-corporeal) browser. This has given rise to names such as CasperJS, SlimerJS (after Ghostbusters), Wraith, GhostDriver etc etc.

TrifleJS breaks this tradition by using the name for a well-known english dessert. Why? When starting the project the main developer (@sdesalas) couldn't think of a name along those lines that wasn't taken already, and he used a variation of the IE rendering engine (Trident) to create a name. Thus TrifleJS derives from Trident.

Isn't it a bit pointless now that IE is losing so much market share?

Perhaps. Certainly a good question. If Microsoft decides to ditch IE the whole project will become pointless. But Microsoft appears to be too deeply committed to ditch IE, and they have the resources to throw at it even in the face of such adversity.

While mobile sales are altering the personal browser market in favor of Webkit, the corporate desktop world is still dominated by Internet Explorer. Besides, TrifleJS has the potential to become extremely useful in combination with PhantomJS and SlimerJS (via CasperJS or similar testing framework), as one set of tests will serve for IE, Webkit and Gecko (Firefox) engines. There is also the fact that IE Emulation allows you to test all recent versions of IE with the one package. And to top the cake, while testers using PhantomJS and SlimerJS are stuck with one browser that loses currency over time, TrifleJS uses the version of IE already installed on the computer, which stays current thanks to windows updates.

Plus you are here reading this aren't you? Meaning that somebody cares.

Are you planning to suport Linux/OSX?

No. As mentioned above, TrifleJS is a wrapper for Internet Explorer. Since Internet Explorer is not available for Linux and OSX there is no way it will work on those systems.

I thought the mono project made it possible to run .NET projects in Linux/OSX?

Correct, however the mono project runs either Webkit or Gecko as its rendering engine for the WebBrowser Control in Linux and OSX systems. Besides there are quite a few calls made directly to windows APIs that will not exist in Linux.

If you are concerned about the cost of running your own windows infrastructure there are some good news in the horizon with virtual container technology (native Docker) coming to Windows Server. This is currently in beta and should be released very soon.

I think IE has just been open-sourced, does that change your plans to support Linux/OSX?

Internet Explorer has not been open-sourced, the .NET Framework has. And the answer is still no.

The fact the .NET framework has been open-sourced does provide a benefit to TrifleJS in that it makes it easier to understand how the WebBrowser class works under the hood. But its does not magically change things overnight.

Why is it taking so long?

The main developer had twin babies and family commitments have taken precedence over personal hobby projects.

How can I speed things up?

You can keep checking the latest versions and notify any issues that you encounter. If you are brave enough to dive into the C# code you can also suggest changes by using pull requests.

How do I know what features I can use?

Status for different features is shown using RAG (Red-Amber-Green) notation.

New features are usually announced in the twitter page or noted as messages for each commit.

Will I be able to use CasperJS to run tests?

Yes, eventually. CasperJS support is scheduled for v0.8.

Will I be able to use TrifleJS inside Node.js?

Eventually (and with the proviso that node.js is hosted in a Windows environment) but not until somebody creates an npm package and ports it over.

Note that TrifleJS runs JavaScript in a separate V8 context so the same problems will apply as when using PhantomJS inside node (no access to closure and global variables as well as degraded sharing of objects between the two environments).

The Edge project may make it possible to fully integrate these two into the same V8 context - but there may be a bit of an issue communicating with the STAThread that the WebBrowser control runs on.

Thats all great but I'm a total noob, how do I get started?

You are probably better off waiting until the v0.9 release is out. At the moment the project is in beta and there will be too many bugs to be able to tell which ones are genuine and which ones are due to your lack of knowledge.

I would suggest that in the meantime you become familiar with PhantomJS or SlimerJS, those projects are far better documented and the lessons learnt will give you the background necessary to pick up TrifleJS without a steep learning curve.

I dont like downloading *.exe files, how do I build my own?

TrifleJS comes with a simple build system based on MSBuild so you dont need Visual Studio installed unless you are planning to make changes.

To build your own binary you only require .NET 3.5 installed on your computer, this will generally come pre-installed in most Windows 7 machines.

The steps are as follows:

  1. Download the whole project from github.
  2. Open the command line cmd.exe
  3. Navigate to the Build folder at the root of the project
  4. Type Build.Trifle.bat and press return.
  5. The output will appear as in the Build\Binary subfolder.

Please be patient as the process takes a couple of minutes.

Which version of the V8 engine does TrifleJS use?

TrifleJS uses the Javascript.NET project, which in turn bundles the Javascript V8 engine at version

See following release notes. This version is dated 24 May 2012. There are no plans to update to a newer V8 engine at present.

Internet Explorer has a different JavaScript engine, how can you be running IE with the V8 engine?

Internet Explorer runs as a compartmentalised process.

Your scripts will be executed in the V8 engine which in turn controls all running instances of Internet Explorer. You can execute JavaScript inside any those instances by using page.evaluate(function). Any function called in this way will be executed inside the JavaScript context of an individual IE page and return results to the main V8 context.

This also means that TrifleJS supports Chakra and/or JScript, depending on the IE version you are currently running.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.