From 9ce254b51387a7e6bfea22c28b1a94ed8219e4d8 Mon Sep 17 00:00:00 2001 From: rpiontik Date: Wed, 24 Apr 2024 16:31:52 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0=20?= =?UTF-8?q?=D1=81=20=D0=BE=D0=BF=D1=80=D0=B5=D0=B4=D0=B5=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=D0=BC=20=D0=B8=D0=BD=D1=82=D0=B5=D1=80=D1=84=D0=B5?= =?UTF-8?q?=D0=B9=D1=81=D0=BD=D0=BE=D0=B9=20=D1=84=D1=83=D0=BD=D0=BA=D1=86?= =?UTF-8?q?=D0=B8=D0=B8=20=D0=B2=20=D0=BF=D0=BB=D0=B0=D0=B3=D0=B8=D0=BD?= =?UTF-8?q?=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/manifest/query.js | 1 + src/ide/idea/papi.js | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/frontend/manifest/query.js b/src/frontend/manifest/query.js index bbcbb8d2..6de14862 100644 --- a/src/frontend/manifest/query.js +++ b/src/frontend/manifest/query.js @@ -53,6 +53,7 @@ const queryDriver = { if (env.isBackendMode() && e?.request?.response) { const content = typeof e?.request?.response === 'object' ? e?.request?.response : JSON.parse(e?.request?.response); message = content.message; + // eslint-disable-next-line no-console console.error(message); throw new Error(message); } else throw e; diff --git a/src/ide/idea/papi.js b/src/ide/idea/papi.js index 00f88d16..7ac9117f 100644 --- a/src/ide/idea/papi.js +++ b/src/ide/idea/papi.js @@ -87,18 +87,24 @@ const fwCefQuery = '%$dochub-api-interface-func%'; let cefQuery = params.get('$dochub-api-interface-func'); // Если в параметрах интерфейсная функция не передана... -if (!cefQuery && window[fwCefQuery]) { +if (cefQuery) { + // eslint-disable-next-line no-console + console.info('Нашел интерфейсную функцию в параметрах!'); +} else if (!cefQuery && window[fwCefQuery]) { cefQuery = fwCefQuery; + // eslint-disable-next-line no-console console.info('Нашел интерфейсную функцию в коде!'); -} else if (window.localStorage && cefQuery) { +} else if (!cefQuery && window.localStorage && localStorage.getItem('cefQuery')) { + // eslint-disable-next-line no-console console.info('Нашел интерфейсную функцию в localStorage!'); cefQuery = localStorage.getItem('cefQuery'); } else { - console.info('Нашел интерфейсную функцию в параметрах!'); + // eslint-disable-next-line no-console + console.info('Интерфейсную функцию не нашел.'); } // eslint-disable-next-line no-console -console.info('Plugin API function: ', cefQuery); +cefQuery && console.info('Plugin API function: ', cefQuery); if (cefQuery && window[cefQuery]) { PAPI.cefQuery = window[cefQuery];