diff --git a/CMakeLists.txt b/CMakeLists.txt index de08db5..35ffbc4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,6 +141,7 @@ set(JSRUNTIME_CONTAINER_FILES ) set(JSRUNTIME_FILES ${JSRUNTIME_COMMON_SOURCE_DIRECTORY}/JSRuntimeContainer.cpp + ${JSRUNTIME_COMMON_SOURCE_DIRECTORY}/NativeJSLogger.cpp ) set(JSRUNTIME_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include/${JSRUNTIME_ENGINE_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/include/linux ${CMAKE_CURRENT_SOURCE_DIR}/src/jsc/jsc_lib ${JSRUNTIME_ENGINE_INCLUDE_DIRECTORIES}) @@ -212,7 +213,7 @@ if (BUILD_JSRUNTIME_CONTAINER) add_dependencies(jsruntime_container ${JSRUNTIMECONTAINER_LIBRARY_NAME}) target_include_directories(jsruntime_container PRIVATE ${JSRUNTIME_INCLUDE_DIRECTORIES}) set_target_properties(jsruntime_container PROPERTIES OUTPUT_NAME "JSRuntimeContainer") - target_link_libraries(jsruntime_container ${JSRUNTIME_LIBRARY_LINK_DIRECTORIES} -l${JSRUNTIMECONTAINER_LIBRARY_NAME} -lpthread) + target_link_libraries(jsruntime_container ${JSRUNTIME_LIBRARY_LINK_DIRECTORIES} -l${JSRUNTIMECONTAINER_LIBRARY_NAME} ${JSRUNTIME_LINK_ETHANLIB} -lpthread) endif (BUILD_JSRUNTIME_CONTAINER) diff --git a/src/jsc/modules/windowwrapper.js b/src/jsc/modules/windowwrapper.js index dd87e0a..f281c4c 100755 --- a/src/jsc/modules/windowwrapper.js +++ b/src/jsc/modules/windowwrapper.js @@ -23,7 +23,7 @@ try { window = jsdom.window; window.location = {"href":"", "host":"127.0.0.1", "protocol":"http"} - /* + window.frames = [] window.screen = { "width":1920, @@ -32,7 +32,79 @@ try "availHeight":1080 } screen = window.screen; - */ + + var BlobPolyfill = function(parts, options) + { + parts = parts || []; + options = options || {}; + this.size = 0; + this.type = options.type || ''; + this._parts = parts; + + for (var i = 0; i < parts.length; i++) + { + if (typeof parts[i] === 'string') + { + this.size += parts[i].length; + } + else if (parts[i] && parts[i].byteLength) + { + this.size += parts[i].byteLength; + } + } + }; + + BlobPolyfill.prototype.slice = function(start, end, contentType) + { + return new BlobPolyfill(this._parts, { type: contentType || this.type }); + }; + + BlobPolyfill.prototype.text = function() + { + var text = ''; + for (var i = 0; i < this._parts.length; i++) + { + if (typeof this._parts[i] === 'string') + { + text += this._parts[i]; + } + } + return Promise.resolve(text); + }; + + BlobPolyfill.prototype.arrayBuffer = function() + { + return Promise.resolve(new ArrayBuffer(0)); + }; + + if (typeof global.Blob === 'undefined') { + global.Blob = BlobPolyfill; + } + if (typeof window !== 'undefined' && typeof window.Blob === 'undefined') { + window.Blob = BlobPolyfill; + } + if (typeof self !== 'undefined' && typeof self.Blob === 'undefined') { + self.Blob = BlobPolyfill; + } + if (typeof this !== 'undefined' && typeof this.Blob === 'undefined') { + this.Blob = BlobPolyfill; + } + if (typeof window !== 'undefined') { + + if (!window.top) window.top = window; + if (!window.parent) window.parent = window; + + if (!window.__tcfapi) { + window.__tcfapi = function(cmd, ver, callback) { + if (callback) callback({gdprApplies: false}, true); + }; + } + if (!window.__uspapi) { + window.__uspapi = function(cmd, ver, callback) { + if (callback) callback({uspString: '1---'}, true); + }; + } + } } } catch(err)