From 652cc4d23e754c7dfaeddfffacf41425959f6481 Mon Sep 17 00:00:00 2001 From: Artem Vasilev Date: Wed, 22 Jun 2022 21:30:20 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D0=BB=20ad?= =?UTF-8?q?esplagin=5Fapi.js=20=D0=B4=D0=BE=202.3.2=20(#26)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/vendor/cadesplugin_api.js | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/vendor/cadesplugin_api.js b/src/vendor/cadesplugin_api.js index 9862110..0dd2a11 100644 --- a/src/vendor/cadesplugin_api.js +++ b/src/vendor/cadesplugin_api.js @@ -13,6 +13,7 @@ var isYandex = 0; var canPromise = !!window.Promise; var cadesplugin_loaded_event_recieved = false; + var isFireFoxExtensionLoaded = false; var cadesplugin; if(canPromise) @@ -236,6 +237,14 @@ cadesplugin.XCN_CRYPT_STRING_BASE64HEADER = 0; cadesplugin.AT_KEYEXCHANGE = 1; cadesplugin.AT_SIGNATURE = 2; + + cadesplugin.CARRIER_FLAG_REMOVABLE = 1; + cadesplugin.CARRIER_FLAG_UNIQUE = 2; + cadesplugin.CARRIER_FLAG_PROTECTED = 4; + cadesplugin.CARRIER_FLAG_FUNCTIONAL_CARRIER = 8; + cadesplugin.CARRIER_FLAG_SECURE_MESSAGING = 16; + cadesplugin.CARRIER_FLAG_ABLE_VISUALISE_SIGNATURE = 64; + cadesplugin.CARRIER_FLAG_VIRTUAL = 128; } function async_spawn(generatorFunc) { @@ -482,10 +491,17 @@ } } function firefox_or_safari_nmcades_onload() { + if (window.cadesplugin_extension_loaded_callback) + window.cadesplugin_extension_loaded_callback(); + isFireFoxExtensionLoaded = true; cpcsp_chrome_nmcades.check_chrome_plugin(plugin_loaded, plugin_loaded_error); } - function nmcades_api_onload () { + function nmcades_api_onload() { + if (!isIE() && !isFireFox && !isSafari) { + if (window.cadesplugin_extension_loaded_callback) + window.cadesplugin_extension_loaded_callback(); + } window.postMessage("cadesplugin_echo_request", "*"); window.addEventListener("message", function (event){ if (typeof(event.data) !== "string" || !event.data.match("cadesplugin_loaded")) @@ -600,7 +616,8 @@ return; if(isFireFox) { - show_firefox_missing_extension_dialog(); + if (!isFireFoxExtensionLoaded) + show_firefox_missing_extension_dialog(); } plugin_resolved = 1; if(canPromise) @@ -692,7 +709,7 @@ }; //Export - cadesplugin.JSModuleVersion = "2.3.1"; + cadesplugin.JSModuleVersion = "2.3.2"; cadesplugin.async_spawn = async_spawn; cadesplugin.set = set_pluginObject; cadesplugin.set_log_level = set_log_level;