All Projects → Taritsyn → Msiejavascriptengine

Taritsyn / Msiejavascriptengine

Licence: apache-2.0
.NET wrapper for working with the JavaScript engines of Internet Explorer and Edge Legacy (JsRT versions of Chakra, ActiveScript version of Chakra and Classic JavaScript Engine). Project was based on the code of SassAndCoffee.JavaScript and Chakra Sample Hosts.

Programming Languages

javascript
184084 projects - #8 most used programming language
ecmascript
72 projects

Projects that are alternatives of or similar to Msiejavascriptengine

Go Duktape
Duktape JavaScript engine bindings for Go
Stars: ✭ 747 (+711.96%)
Mutual labels:  javascript-engine
Repository Edge
EDGE - Home Assistant Community Add-ons
Stars: ✭ 42 (-54.35%)
Mutual labels:  edge
Disable Webassembly
Browser hacks to disable WebAssembly (WASM)
Stars: ✭ 63 (-31.52%)
Mutual labels:  edge
Baristacore
BaristaCore is a framework for providing a serverless platform using ChakraCore and .Net Core
Stars: ✭ 24 (-73.91%)
Mutual labels:  javascript-engine
Web Extension Starter
🖥🔋Web Extension starter to build "Write Once Run on Any Browser" extension
Stars: ✭ 987 (+972.83%)
Mutual labels:  edge
Clarifai Apple Sdk
Artificial Intelligence with a Vision
Stars: ✭ 46 (-50%)
Mutual labels:  edge
Nanos
A kernel designed to run one and only one application in a virtualized environment
Stars: ✭ 557 (+505.43%)
Mutual labels:  edge
Known Css Properties
List of standard and browser specific CSS properties.
Stars: ✭ 89 (-3.26%)
Mutual labels:  edge
Edge Selenium Tools
An updated EdgeDriver implementation for Selenium 3 with newly-added support for Microsoft Edge (Chromium).
Stars: ✭ 41 (-55.43%)
Mutual labels:  edge
People Counter Python
Create a smart video application using the Intel Distribution of OpenVINO toolkit. The toolkit uses models and inference to run single-class object detection.
Stars: ✭ 62 (-32.61%)
Mutual labels:  edge
Gooreplacer
⚡️⚡️A browser extension to modify HTTP requests :-)
Stars: ✭ 850 (+823.91%)
Mutual labels:  edge
X K8s
ITRI's Kubernetes platform for 5G Edge VNF.
Stars: ✭ 20 (-78.26%)
Mutual labels:  edge
Maixpy
MicroPython for K210 RISC-V, let's play with edge AI easier
Stars: ✭ 1,065 (+1057.61%)
Mutual labels:  edge
Aoe
AoE (AI on Edge,终端智能,边缘计算) 是一个终端侧AI集成运行时环境 (IRE),帮助开发者提升效率。
Stars: ✭ 759 (+725%)
Mutual labels:  edge
Jsvu
JavaScript (engine) Version Updater
Stars: ✭ 1,192 (+1195.65%)
Mutual labels:  javascript-engine
Search Deflector
A small program that forwards searches from Cortana to your preferred browser and search engine.
Stars: ✭ 620 (+573.91%)
Mutual labels:  edge
Stream
Elegant stream processing pipeline written entirely in Golang
Stars: ✭ 45 (-51.09%)
Mutual labels:  edge
Neardb
Simple document db made for infinitely scalable globally distributed reads.
Stars: ✭ 92 (+0%)
Mutual labels:  edge
Chakracore
ChakraCore is an open source Javascript engine with a C API.
Stars: ✭ 8,600 (+9247.83%)
Mutual labels:  javascript-engine
Mue
Fast, open and free-to-use new tab page for modern browsers
Stars: ✭ 56 (-39.13%)
Mutual labels:  edge

MSIE JavaScript Engine for .NET NuGet version Download count

MSIE JS Engine Logo

This project is a .NET wrapper for working with the JavaScript engines of Internet Explorer and Edge Legacy (JsRT versions of Chakra, ActiveScript version of Chakra and Classic JavaScript Engine). Project was based on the code of SassAndCoffee.JavaScript, Chakra Sample Hosts and jsrt-dotnet.

MSIE JavaScript Engine requires a installation of Internet Explorer or Edge Legacy on the machine and can work in 5 modes, that are defined in the JsEngineMode enumeration:

  • Auto. Automatically selects the most modern JavaScript engine from available on the machine.
  • Classic. Classic MSIE JavaScript engine (supports ECMAScript 3 with possibility of using the ECMAScript 5 Polyfill and the JSON2 library). Requires Internet Explorer 6 or higher on the machine. Not supported in version for .NET Core.
  • ChakraActiveScript. ActiveScript version of Chakra JavaScript engine (supports ECMAScript 5). Requires Internet Explorer 9 or higher on the machine. Not supported in version for .NET Core.
  • ChakraIeJsRt. “IE” JsRT version of Chakra JavaScript engine (supports ECMAScript 5). Requires Internet Explorer 11 or Microsoft Edge Legacy on the machine.
  • ChakraEdgeJsRt. “Edge” JsRT version of Chakra JavaScript engine (supports ECMAScript 5). Requires Microsoft Edge Legacy on the machine.

The supported .NET types are as follows:

  • MsieJavaScriptEngine.Undefined
  • System.Boolean
  • System.Int32
  • System.Double
  • System.String

Installation

This library can be installed through NuGet - http://nuget.org/packages/MsieJavaScriptEngine.

Usage

Consider a simple example of usage of the MSIE JavaScript Engine:

using System;

using MsieJavaScriptEngine;
using MsieJavaScriptEngine.Helpers;

namespace MsieJavaScriptEngine.Example.Console
{
	class Program
	{
		static void Main(string[] args)
		{
			try
			{
				using (var jsEngine = new MsieJsEngine())
				{
					const string expression = "7 * 8 - 20";
					var result = jsEngine.Evaluate<int>(expression);

					Console.WriteLine("{0} = {1}", expression, result);
				}
			}
			catch (JsEngineLoadException e)
			{
				Console.WriteLine("During loading of JavaScript engine an error occurred.");
				Console.WriteLine();
				Console.WriteLine(JsErrorHelpers.GenerateErrorDetails(e));
			}
			catch (JsScriptException e)
			{
				Console.WriteLine("During processing of JavaScript code an error occurred.");
				Console.WriteLine();
				Console.WriteLine(JsErrorHelpers.GenerateErrorDetails(e));
			}
			catch (JsException e)
			{
				Console.WriteLine("During working of JavaScript engine an unknown error occurred.");
				Console.WriteLine();
				Console.WriteLine(JsErrorHelpers.GenerateErrorDetails(e));
			}

			Console.ReadLine();
		}
	}
}

First we create an instance of the MsieJsEngine class. Then we evaluate a JavaScript expression by using of the Evaluate method and output its result to the console. In addition, we provide handling of the following exception types: JsEngineLoadException, JsScriptException and JsException. In the MSIE JavaScript Engine, exceptions have the following hierarchy:

  • JsException
    • JsEngineException
      • JsEngineLoadException
    • JsFatalException
    • JsScriptException
      • JsCompilationException
      • JsRuntimeException
        • JsInterruptedException
    • JsUsageException

Also, when you create an instance of the MsieJsEngine class, then you can pass the JavaScript engine settings via the constructor. Consider in detail properties of the JsEngineSettings class:

Property name Data type Default value Description
EnableDebugging Boolean false Flag for whether to allow debugging in Visual Studio by adding the debugger statement to script code.
EngineMode JsEngineMode enumeration Auto JavaScript engine mode.
MaxStackSize Int32 503 808 or 1 007 616

Maximum stack size in bytes.

Set a 0 to use the default maximum stack size specified in the header for the executable.

UseEcmaScript5Polyfill Boolean false Flag for whether to use the ECMAScript 5 Polyfill.
UseJson2Library Boolean false Flag for whether to use the JSON2 library

Release History

See the changelog.

License

Apache License Version 2.0

Credits

Who's Using MSIE JavaScript Engine

If you use the MSIE JavaScript Engine in some project, please send me a message so I can include it in this list:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].