From 8cf76d6df06f0c0415b2958accb230a9456de117 Mon Sep 17 00:00:00 2001 From: boocmp Date: Mon, 21 Oct 2024 18:09:34 +0700 Subject: [PATCH] Added security warning message. --- app/brave_settings_strings.grdp | 3 +++ .../components/brave_adblock_scriptlet_editor.html | 3 ++- .../components/brave_adblock_scriptlet_editor.ts | 6 +++--- .../settings/brave_settings_localized_strings_provider.cc | 8 +++++--- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app/brave_settings_strings.grdp b/app/brave_settings_strings.grdp index 57ee4ffe31a7..8b0cc30718f5 100644 --- a/app/brave_settings_strings.grdp +++ b/app/brave_settings_strings.grdp @@ -489,6 +489,9 @@ Scriptlet is not found. + + Don’t paste code here that you don’t understand or haven’t\nreviewed yourself. This could allow attackers to steal your\nidentity or take control of your computer. + Shortcuts diff --git a/browser/resources/settings/default_brave_shields_page/components/brave_adblock_scriptlet_editor.html b/browser/resources/settings/default_brave_shields_page/components/brave_adblock_scriptlet_editor.html index 7729afcb5a79..317d2255b76f 100644 --- a/browser/resources/settings/default_brave_shields_page/components/brave_adblock_scriptlet_editor.html +++ b/browser/resources/settings/default_brave_shields_page/components/brave_adblock_scriptlet_editor.html @@ -36,7 +36,8 @@
$i18n{adblockCustomScriptletDialogContentLabel}
-
diff --git a/browser/resources/settings/default_brave_shields_page/components/brave_adblock_scriptlet_editor.ts b/browser/resources/settings/default_brave_shields_page/components/brave_adblock_scriptlet_editor.ts index 1475c0e5bccf..063a553f84cd 100644 --- a/browser/resources/settings/default_brave_shields_page/components/brave_adblock_scriptlet_editor.ts +++ b/browser/resources/settings/default_brave_shields_page/components/brave_adblock_scriptlet_editor.ts @@ -81,17 +81,17 @@ class AdblockScriptletEditor extends AdblockScriptletEditorBase { break case ErrorCode.kAlreadyExists: this.scriptletErrorMessage_ = this.i18n( - 'adblockEditCustomScriptletAlreadyExistsError' + 'adblockCustomScriptletAlreadyExistsError' ) break case ErrorCode.kInvalidName: this.scriptletErrorMessage_ = this.i18n( - 'adblockEditCustomScriptletInvalidNameError' + 'adblockCustomScriptletInvalidNameError' ) break case ErrorCode.kNotFound: this.scriptletErrorMessage_ = this.i18n( - 'adblockEditCustomScriptletNotFoundError' + 'adblockCustomScriptletNotFoundError' ) break } diff --git a/browser/ui/webui/settings/brave_settings_localized_strings_provider.cc b/browser/ui/webui/settings/brave_settings_localized_strings_provider.cc index f834e9b1052a..392d588b31a3 100644 --- a/browser/ui/webui/settings/brave_settings_localized_strings_provider.cc +++ b/browser/ui/webui/settings/brave_settings_localized_strings_provider.cc @@ -749,12 +749,14 @@ void BraveAddCommonStrings(content::WebUIDataSource* html_source, IDS_BRAVE_ADBLOCK_CUSTOM_SCRIPTLET_DIALOG_SAVE_BUTTON}, {"adblockCustomScriptletDeleteConfirmation", IDS_BRAVE_ADBLOCK_CUSTOM_SCRIPTLET_DELETE_CONFIRMATION}, - {"adblockEditCustomScriptletAlreadyExistsError", + {"adblockCustomScriptletAlreadyExistsError", IDS_BRAVE_ADBLOCK_CUSTOM_SCRIPTLET_ALREADY_EXISTS_ERROR}, - {"adblockEditCustomScriptletInvalidNameError", + {"adblockCustomScriptletInvalidNameError", IDS_BRAVE_ADBLOCK_CUSTOM_SCRIPTLET_INVALID_NAME_ERROR}, - {"adblockEditCustomScriptletNotFoundError", + {"adblockCustomScriptletNotFoundError", IDS_BRAVE_ADBLOCK_CUSTOM_SCRIPTLET_NOT_FOUND_ERROR}, + {"adblockCustomScriptletWarning", + IDS_BRAVE_ADBLOCK_CUSTOM_SCRIPTLET_WARNING}, {"braveShortcutsPage", IDS_SETTINGS_BRAVE_SHORTCUTS_TITLE}, {"shortcutsPageSearchPlaceholder", IDS_SHORTCUTS_PAGE_SEARCH_PLACEHOLDER},