diff --git a/package.json b/package.json index 6d2fb71b6..6b3902fa5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@adguard/scriptlets", - "version": "1.9.11", + "version": "1.9.12", "description": "AdGuard's JavaScript library of Scriptlets and Redirect resources", "scripts": { "build": "babel-node bundler.js", diff --git a/src/helpers/log-message.js b/src/helpers/log-message.js index 0bcd090f6..d98ef304a 100644 --- a/src/helpers/log-message.js +++ b/src/helpers/log-message.js @@ -12,7 +12,6 @@ export const logMessage = (source, message, forced = false, convertMessageToString = true) => { const { name, - ruleText, verbose, } = source; @@ -31,16 +30,5 @@ export const logMessage = (source, message, forced = false, convertMessageToStri return; } - let messageStr = `${name}: ${message}`; - - // Extract scriptlet part from rule text - if (ruleText) { - const RULE_MARKER = '#%#//scriptlet'; - const markerIdx = ruleText.indexOf(RULE_MARKER); - if (markerIdx > -1) { - const ruleWithoutDomains = ruleText.slice(markerIdx, ruleText.length); - messageStr += `; cannot apply rule: ${ruleWithoutDomains}`; - } - } - nativeConsole(messageStr); + nativeConsole(`${name}: ${message}`); }; diff --git a/tests/helpers/log-message.test.js b/tests/helpers/log-message.test.js index eda2de100..6167628cb 100644 --- a/tests/helpers/log-message.test.js +++ b/tests/helpers/log-message.test.js @@ -16,7 +16,6 @@ module(name, { afterEach }); const RULE_TEXT = 'example.org#%#//scriptlet(\'set-cookie\', \'name\', \'value\')'; const SCRIPTLET_NAME = 'set-cookie'; const MESSAGE = 'arbitrary text message'; -const MESSAGE_EXTENSION = '; cannot apply rule: #%#//scriptlet(\'set-cookie\', \'name\', \'value\')'; test('Logs message conditionally', async (assert) => { // eslint-disable-next-line no-console @@ -26,7 +25,7 @@ test('Logs message conditionally', async (assert) => { } assert.strictEqual( input, - `${SCRIPTLET_NAME}: ${MESSAGE}${MESSAGE_EXTENSION}`, + `${SCRIPTLET_NAME}: ${MESSAGE}`, 'message logged correctly', ); };