/// <summary> /// Add hooks to listen for new JSContext creation and store the context for later use. /// </summary> internal static void Initialize() { Xpcom.AssertCorrectThread(); if (!_isInitialized) { _isInitialized = true; using (var runtimeService = new Gecko.Interop.ServiceWrapper <nsIJSRuntimeService>("@mozilla.org/js/xpc/RuntimeService;1")) { _originalContextCallback = SpiderMonkey.JS_SetContextCallback(Runtime, _globalContextCallback); } } }
/// <summary> /// Add hooks to listen for new JSContext creation and store the context for later use. /// </summary> internal static void Initialize() { Xpcom.AssertCorrectThread(); if(!_isInitialized) { _isInitialized = true; using (var runtimeService = Xpcom.GetService2<nsIJSRuntimeService>("@mozilla.org/js/xpc/RuntimeService;1")) { _originalContextCallback = SpiderMonkey.JS_SetContextCallback(runtimeService.Instance.GetRuntimeAttribute(), _globalContextCallback); } } }