From 548f6f62158226ed4a3703885bcbe6214962b6e3 Mon Sep 17 00:00:00 2001 From: shuangyexuan Date: Tue, 30 Nov 2021 19:34:20 +0800 Subject: [PATCH 01/15] add i18n's zh lunguage; modify popup/popup.html static text to i18n tab --- _locales/en/messages.json | 8 ++ _locales/zh/messages.json | 233 ++++++++++++++++++++++++++++++++++++++ popup/popup.html | 4 +- 3 files changed, 243 insertions(+), 2 deletions(-) create mode 100644 _locales/zh/messages.json diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 1507f43..3437f03 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -221,5 +221,13 @@ "no_expressions_found_text": { "message": "No saved expressions found.", "description": "Text displayed in the saved expressions pane when no expressions exist." + }, + "clear_expressions_button_text":{ + "message": "Clear Saved Expressions", + "description": "Text displayed in the saved expressions pane." + }, + "save_expression_button_text":{ + "message": "Save Expression", + "description": "Text displayed in the saved expressions pane." } } diff --git a/_locales/zh/messages.json b/_locales/zh/messages.json new file mode 100644 index 0000000..0aa5edc --- /dev/null +++ b/_locales/zh/messages.json @@ -0,0 +1,233 @@ +{ + "extension_name": { + "message": "find+ | 正则页内查找工具", + "description": "The extension name in the manifest file." + }, + "extension_description": { + "message": "一个支持正则表达式的网页搜索插件", + "description": "Short description of the extension in the manifest file." + }, + + + "search_field_title": { + "message": "搜索字段", + "description": "Tooltip text for the search field." + }, + "malformed_regex_error_title": { + "message": "错误的表达式:\n输入的表达式不被接受,因为不是有效的正则表达式或者不匹配Javascript正则规范。", + "description": "Tooltip text for the invalid regex icon." + }, + "clipboard_copy_error_title": { + "message": "未能复制到剪贴板,由于未知错误。", + "description": "Tooltip text for the clipboard copy error icon." + }, + "iframes_found_warning_title": { + "message": "该页有一个或多个框架,会导致你的搜索不被高亮显示", + "description": "Tooltip text for the iframes encountered warning icon." + }, + "clipboard_copy_title": { + "message": "正则已复制到剪贴板。Regex occurrence copied to clipboard.", + "description": "Tooltip text for the clipboard copy successful icon." + }, + "installation_information_title": { + "message": "欢迎并感谢安装我们的插件!这里有一些提示帮助你开始使用:\n\tENTER:查找下一个结果\n\tSHIFT-ENTER:返回上一个结果\n\tCTRL-ALT-0:展开或折叠可选面板\n\tCTRL-ALT-R:展开或折叠替代文本面板\n\tCTRL-ENTER 或 ESC:关闭插件弹窗", + "description": "Tooltip text for the install information icon." + }, + "update_information_title": { + "message": "我们更新了插件!现在它会工作的更好:)\n在我们的GitHub页查看这次的更新信息!", + "description": "Tooltip text for the update information icon." + }, + "search_prev_title": { + "message": "上一个", + "description": "Tooltip text for the seek backwards button." + }, + "search_next_title": { + "message": "下一个", + "description": "Tooltip text for the seek forwards button." + }, + "toggle_options_pane_title": { + "message": "设置窗口", + "description": "Tooltip text for the toggle options pane button." + }, + "toggle_saved_expressions_button": { + "message": "保存的表达式", + "description": "Tooltip text for the show saved expressions button." + }, + "copy_to_clipboard_button_title": { + "message": "复制所有结果到剪贴板", + "description": "Tooltip text for the copy to clipboard button." + }, + "toggle_find_replace_button_title": { + "message": "查找并替换", + "description": "Tooltip text for the find and replace toggle button." + }, + "close_extension_title": { + "message": "关闭find+", + "description": "Tooltip text for the close extension button." + }, + "replace_field_title": { + "message": "替换失败了", + "description": "Tooltip text for the replace field." + }, + "replace_button_title": { + "message": "替换下一个", + "description": "Tooltip text for the replace next button." + }, + "replace_all_button_title": { + "message": "替换所有", + "description": "Tooltip text for the replace all button." + }, + "search_option_find_by_regex_title": { + "message": "如果启用,搜索框的输入文本将作为正则表达式。\n如果禁用,文本将会作为普通字符。", + "description": "Tooltip text for the find by regex option description icon." + }, + "search_option_match_case_title": { + "message": "如果启用,大小写字母必须匹配表达式。\n如果禁用,大小写字母不影响匹配。", + "description": "Tooltip text for the match case option description icon." + }, + "search_option_persistent_highlights_title": { + "message": "如果启用,关闭插件后依然显示高亮。\n通过刷新或者重新打开网页取消高亮", + "description": "Tooltip text for the persistent highlights option description icon." + }, + "extension_option_persistent_storage_incognito_title": { + "message": "如果启用,搜索和选项将保留在常规和隐身会话中。如果禁用,则在隐身时不会保存任何会话信息。", + "description": "Tooltip text for the persistent storage incognito option description icon." + }, + "extension_option_hide_option_pane_toggle_button_title": { + "message": "如果启用,隐藏'设置窗口'的按钮。\n键盘快捷键仍可用于显示或隐藏该窗格。", + "description": "Tooltip text for the hide option pane toggle button option description icon." + }, + "extension_option_hide_saved_expressions_pane_toggle_button_title": { + "message": "如果启用,隐藏'保存的表达式'的按钮。\n键盘快捷键仍可用于显示或隐藏窗格。", + "description": "Tooltip text for the hide saved expressions pane toggle button option description icon." + }, + "extension_option_hide_copy_to_clipboard_toggle_button_title": { + "message": "如果启用,隐藏'复制到剪贴板'的按钮。\n键盘快捷方式仍可用于将所有匹配项复制到剪贴板。", + "description": "Tooltip text for the copy all occurrences to clipboard button option description icon." + }, + "extension_option_hide_find_replace_toggle_button_title": { + "message": "如果启用,隐藏'查找和替换'窗格的按钮。\n键盘快捷键仍可用于显示或隐藏窗格。", + "description": "Tooltip text for the hide find and replace pane toggle button option description icon." + }, + "saved_expression_icon_title": { + "message": "加载这个表达式", + "description": "Tooltip text for a saved expression entry icon." + }, + "delete_saved_expression_icon_title": { + "message": "删除这个表达式", + "description": "Tooltip text for a delete saved expression entry icon." + }, + "clear_expressions_button_title": { + "message": "清除所有保存的表达式", + "description": "Tooltip text for the clear saved expressions button." + }, + "save_expression_button_title": { + "message": "保存搜索字段的表达式", + "description": "Tooltip text for the save expression button." + }, + + + "replace_field_placeholder": { + "message": "替换为..", + "description": "Placeholder text for the replace field." + }, + + + "replace_button_text": { + "message": "替换", + "description": "Text displayed inside the replace button." + }, + "replace_all_button_text": { + "message": "替换所有", + "description": "Text displayed inside the replace all button." + }, + "extension_limitation_web_store_text": { + "message": "哎呀!您似乎正在尝试在Chrome网上应用店中使用该插件。Google的开发人员已阻止插件在此处执行,以防止恶意注入代码。这是所有Chrome插件的安全限制。", + "description": "Text displayed in the message pane when the extension is used in the Chrome Web Store." + }, + "extension_limitation_chrome_namespace_text": { + "message": "哎呀!您似乎正在尝试在'chrome://'命名空间中使用插件。Google的开发人员已阻止插件在此处执行,以防止恶意注入代码。这是所有 Chrome 插件的安全限制。", + "description": "Text displayed in the message pane when the extension is used in the chrome:// namespace." + }, + "extension_limitation_pdf_text": { + "message": "哎呀!您似乎正在尝试在 PDF 文档中使用插件名。不幸的是,由于PDF查看器的复杂性,我们的插件无法处理PDF搜索。我们建议改用本机工具。", + "description": "Text displayed in the message pane when the extension is used in a PDF." + }, + "extension_limitation_offline_file_text": { + "message": "尝试搜索此脱机文件时内部出现问题。幸运的是,我们可能知道如何解决这个问题。导航到'chrome://extensions',然后在插件名{find+}下找到'允许访问文件URL'复选框。", + "description": "Text displayed in the message pane when the extension is used in an offline file without adequate permissions for parsing file contents." + }, + "search_options_header_text": { + "message": "设置", + "description": "Header text displayed in the options pane." + }, + "extension_options_header_text": { + "message": "插件选项", + "description": "Header text displayed in the options pane." + }, + "saved_expressions_body_header": { + "message": "保存表达式", + "description": "Header text displayed in the saved expressions pane." + }, + "search_option_find_by_regex_text": { + "message": "通过正则表达式查找", + "description": "Text displayed beside the find by regex option." + }, + "search_option_match_case_text": { + "message": "匹配大小写", + "description": "Text displayed beside the match case option." + }, + "search_option_persistent_highlights_text": { + "message": "持续高亮", + "description": "Text displayed beside the persistent highlights option." + }, + "extension_option_persistent_storage_incognito_text": { + "message": "持续存储", + "description": "Text displayed beside the persistent storage option." + }, + "extension_option_hide_option_pane_toggle_button_text": { + "message": "隐藏'设置窗口'按钮", + "description": "Text displayed beside the hide option pane toggle button option." + }, + "extension_option_hide_saved_expressions_pane_toggle_button_text": { + "message": "隐藏'保存的表达式'按钮", + "description": "Text displayed beside the hide saved expressions pane toggle button option." + }, + "extension_option_hide_copy_to_clipboard_toggle_button_text": { + "message": "隐藏'复制到剪贴板'按钮", + "description": "Text displayed beside the hide copy to clipboard toggle button option." + }, + "extension_option_hide_find_replace_toggle_button_text": { + "message": "隐藏'复制和替换'按钮", + "description": "Text displayed beside the hide find and replace toggle button option." + }, + "search_option_max_results_text": { + "message": "最大高亮数量", + "description": "Text displayed above the max highlighted results option." + }, + "search_option_index_highlight_text": { + "message": "选中的高亮颜色", + "description": "Text displayed above the index highlight color option." + }, + "search_option_all_highlight_text": { + "message": "高亮颜色", + "description": "Text displayed above the all highlight color option." + }, + "reset_options_button_text": { + "message": "重置所有选项", + "description": "Text displayed in the reset options button." + }, + + "no_expressions_found_text": { + "message": "没有找到保存的表达式", + "description": "Text displayed in the saved expressions pane when no expressions exist." + }, + "clear_expressions_button_text":{ + "message": "清除保存的表达式", + "description": "Text displayed in the saved expressions pane." + }, + "save_expression_button_text":{ + "message": "保存表达式", + "description": "Text displayed in the saved expressions pane." + } +} diff --git a/popup/popup.html b/popup/popup.html index 45ecccb..2b1f28b 100644 --- a/popup/popup.html +++ b/popup/popup.html @@ -311,9 +311,9 @@
+ data-locale-title="clear_expressions_button_title"> + data-locale-title="save_expression_button_title">
From 545710e9b0b0a4dbb4456b434bd1064d6de144f8 Mon Sep 17 00:00:00 2001 From: shuangyexuan Date: Tue, 30 Nov 2021 20:38:05 +0800 Subject: [PATCH 02/15] fix button translator --- _locales/zh/messages.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/_locales/zh/messages.json b/_locales/zh/messages.json index 0aa5edc..1870102 100644 --- a/_locales/zh/messages.json +++ b/_locales/zh/messages.json @@ -18,15 +18,15 @@ "description": "Tooltip text for the invalid regex icon." }, "clipboard_copy_error_title": { - "message": "未能复制到剪贴板,由于未知错误。", + "message": "未能复制到剪贴板,由于一些未知错误。", "description": "Tooltip text for the clipboard copy error icon." }, "iframes_found_warning_title": { - "message": "该页有一个或多个框架,会导致你的搜索不被高亮显示", + "message": "该页有一个或多个框架,可能会导致搜索结果不被高亮显示", "description": "Tooltip text for the iframes encountered warning icon." }, "clipboard_copy_title": { - "message": "正则已复制到剪贴板。Regex occurrence copied to clipboard.", + "message": "正则已复制到剪贴板。", "description": "Tooltip text for the clipboard copy successful icon." }, "installation_information_title": { @@ -66,7 +66,7 @@ "description": "Tooltip text for the close extension button." }, "replace_field_title": { - "message": "替换失败了", + "message": "替换字段", "description": "Tooltip text for the replace field." }, "replace_button_title": { @@ -90,7 +90,7 @@ "description": "Tooltip text for the persistent highlights option description icon." }, "extension_option_persistent_storage_incognito_title": { - "message": "如果启用,搜索和选项将保留在常规和隐身会话中。如果禁用,则在隐身时不会保存任何会话信息。", + "message": "如果启用,搜索和选项将保留在常规和隐身窗口中。如果禁用,则在使用隐身窗口时不会保存任何会话信息。", "description": "Tooltip text for the persistent storage incognito option description icon." }, "extension_option_hide_option_pane_toggle_button_title": { @@ -158,11 +158,11 @@ "description": "Text displayed in the message pane when the extension is used in an offline file without adequate permissions for parsing file contents." }, "search_options_header_text": { - "message": "设置", + "message": "正则设置", "description": "Header text displayed in the options pane." }, "extension_options_header_text": { - "message": "插件选项", + "message": "插件设置", "description": "Header text displayed in the options pane." }, "saved_expressions_body_header": { @@ -198,7 +198,7 @@ "description": "Text displayed beside the hide copy to clipboard toggle button option." }, "extension_option_hide_find_replace_toggle_button_text": { - "message": "隐藏'复制和替换'按钮", + "message": "隐藏'查找和替换'按钮", "description": "Text displayed beside the hide find and replace toggle button option." }, "search_option_max_results_text": { From 2fdc87d544de74cd2d218088d8f8ad32320da6b9 Mon Sep 17 00:00:00 2001 From: Brandon Richardson Date: Sun, 6 Mar 2022 15:27:38 -0400 Subject: [PATCH 03/15] minor improvements to project README --- .github/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/README.md b/.github/README.md index 5b0db26..a26d836 100644 --- a/.github/README.md +++ b/.github/README.md @@ -1,11 +1,11 @@ # **{find+}** -![Chrome Users](https://img.shields.io/chrome-web-store/users/fddffkdncgkkdjobemgbpojjeffmmofb.svg?style=flat&label=chrome%20users) -![Firefox Users](https://img.shields.io/amo/users/brandon1024-find.svg?label=firefox%20users&style=flat) -![Last Commit on GitHub](https://img.shields.io/github/last-commit/brandon1024/find.svg?style=flat) +[![Chrome Users](https://img.shields.io/chrome-web-store/users/fddffkdncgkkdjobemgbpojjeffmmofb.svg?style=flat&label=chrome%20users)](https://chrome.google.com/webstore/detail/find%2B/fddffkdncgkkdjobemgbpojjeffmmofb) +[![Firefox Users](https://img.shields.io/amo/users/brandon1024-find.svg?label=firefox%20users&style=flat)](https://addons.mozilla.org/en-US/firefox/addon/brandon1024-find/) +[![Last Commit on GitHub](https://img.shields.io/github/last-commit/brandon1024/find.svg?style=flat)](https://github.com/brandon1024/find/commits/develop) -**{find+}** is a powerful _find-in-page_ extension for Chrome and Firefox that allows you to search for content in a web page or document by regular expression. It is a feature-rich alternative to the native _find-in-page_ tool built into your browser. +**{find+}** is a powerful _find-in-page_ extension for Chrome and Firefox that allows you to search for content in a web page or document by regular expression. It is a feature-rich alternative to the native _find-in-page_ tool built into your browser. Some notable features: - match a regular expression against text in a web page @@ -25,7 +25,7 @@ The **{find+}** extension is available through the Chrome Web Store and through Download the extension here: [{find+} – Get this Extension for 🦊 Firefox](https://addons.mozilla.org/en-US/firefox/addon/brandon1024-find/). ## Keyboard Shortcuts -In Firefox, you can use CTRL++F to open the extension popup. +In Firefox, you can use CTRL++F to open the extension popup. To open the extension popup in Chrome using a keyboard shortcut, you must first assign a keyboard shortcut to the extension through the Chrome settings. You can do this by following these steps: 1. Navigate to the `Extensions` settings page in Chrome, or type `chrome://extensions/` into the navigation bar. From d3d41bf7c3933571159b8fa3cf660dd9f612fbea Mon Sep 17 00:00:00 2001 From: TyIsI Date: Sat, 4 Feb 2023 15:10:57 -0800 Subject: [PATCH 04/15] Chevron fix for collapsible content --- docs/help.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/help.css b/docs/help.css index 2250f43..c7b171d 100644 --- a/docs/help.css +++ b/docs/help.css @@ -149,11 +149,11 @@ input[type='checkbox'] { border-left: 4px solid currentColor; vertical-align: middle; margin-right: .7rem; - transform: translateY(-2px); + transform: rotate(90deg) translateX(-3px); } .toggle:checked + .lbl-toggle::before { - transform: rotate(90deg) translateX(-3px); + transform: rotate(0deg) translateY(-3px); } .toggle:checked + .lbl-toggle + .collapsible-content { From 7bbbf284a6009de1a395048d6ab0f58d71b48325 Mon Sep 17 00:00:00 2001 From: Mozi <29089388+pzhlkj6612@users.noreply.github.com> Date: Sun, 5 Feb 2023 23:29:30 +0800 Subject: [PATCH 05/15] Set text color of the "User Guide" page to "black" To prevent colors from being overridden by user settings (in "Settings" - "Language and Appearance" - "Colors"). --- docs/help.css | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/help.css b/docs/help.css index c7b171d..f450fce 100644 --- a/docs/help.css +++ b/docs/help.css @@ -48,6 +48,7 @@ table tr:nth-child(2n) { div#body-container { background-color: white; + color: black; max-width: 800px; margin: auto; padding: 10px; From fc0893894452b300da3b04fc5b71ade3e41f2703 Mon Sep 17 00:00:00 2001 From: Mozi <29089388+pzhlkj6612@users.noreply.github.com> Date: Sun, 5 Feb 2023 23:17:32 +0800 Subject: [PATCH 06/15] Set the background-color of popup to "white" Similar to the previous commit, it will prevent colors from being overridden by user settings (in "Settings" - "Language and Appearance" - "Colors"). --- popup/css/extension.css | 1 + 1 file changed, 1 insertion(+) diff --git a/popup/css/extension.css b/popup/css/extension.css index 669df94..c6fd1f9 100644 --- a/popup/css/extension.css +++ b/popup/css/extension.css @@ -3,6 +3,7 @@ body { margin: 3px; width: 410px; + background-color: white; } div.pane { From c0bec7ecaed56927e08c417ccfa617967f0f4e4f Mon Sep 17 00:00:00 2001 From: Mozi <29089388+pzhlkj6612@users.noreply.github.com> Date: Sun, 5 Feb 2023 23:34:36 +0800 Subject: [PATCH 07/15] Darken the text of search index in popup --- popup/css/searchpane.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/popup/css/searchpane.css b/popup/css/searchpane.css index e5ac199..1ff5951 100644 --- a/popup/css/searchpane.css +++ b/popup/css/searchpane.css @@ -32,7 +32,7 @@ div#search-info { } span#index-text { - color: #CCCCCC; + color: #888888; white-space: nowrap; text-align: right; } From 061110110e278d3a741ecf586a5093aeed83fa5d Mon Sep 17 00:00:00 2001 From: Mozi <29089388+pzhlkj6612@users.noreply.github.com> Date: Sat, 2 Dec 2023 11:59:44 +0800 Subject: [PATCH 08/15] Ignore the new url of Google Chrome Web Store --- background/background.js | 4 +++- popup/js/browser-action.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/background/background.js b/background/background.js index 62326f4..2a2cc98 100644 --- a/background/background.js +++ b/background/background.js @@ -43,7 +43,9 @@ Find.register("Background", function(self) { Find.browser.tabs.query({}, (tabs) => { for(let tabIndex = 0; tabIndex < tabs.length; tabIndex++) { let url = tabs[tabIndex].url; - if(url.match(/chrome:\/\/.*/) || url.match(/https:\/\/chrome.google.com\/webstore\/.*/)) { + if(url.match(/chrome:\/\/.*/) + || url.match(/https:\/\/chrome\.google\.com\/webstore\/.*/) + || url.match(/https:\/\/chromewebstore\.google\.com\/.*/)) { continue; } diff --git a/popup/js/browser-action.js b/popup/js/browser-action.js index 151ddc4..c9d4783 100644 --- a/popup/js/browser-action.js +++ b/popup/js/browser-action.js @@ -269,6 +269,7 @@ Find.register('Popup.BrowserAction', function (self) { * */ function isWithinWebStoreNamespace(url) { return url.match(/https:\/\/chrome\.google\.com\/webstore\/.*/) + || url.match(/https:\/\/chromewebstore\.google\.com\/.*/) || url.match(/https:\/\/google\.[^\/]*\/_\/chrome\/newtab.*/); } From 8050dccf210ce6d151911baf2dc8228a37d308e3 Mon Sep 17 00:00:00 2001 From: Mozi <29089388+pzhlkj6612@users.noreply.github.com> Date: Tue, 2 Apr 2024 15:01:29 +0000 Subject: [PATCH 09/15] Check if the zip utility is installed before any actions --- build.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.sh b/build.sh index a3c1dac..bf456d9 100755 --- a/build.sh +++ b/build.sh @@ -81,6 +81,12 @@ if [ -z "$VERSION" ]; then help fi +# Check if zip is installed +if [ zip ]; then + echo "Error: missing 'zip' utility." + exit 2 +fi + # Create build directory structure echo "$ME: Creating the build directory structure under $BUILD_DIR..." rm -rf "$BUILD_DIR" From 1c3f74b3245aae7676a3dca5f6383ecc6e4a5202 Mon Sep 17 00:00:00 2001 From: Mozi <29089388+pzhlkj6612@users.noreply.github.com> Date: Sat, 20 Apr 2024 13:47:56 +0000 Subject: [PATCH 10/15] Correctly check if the zip utility is installed before any actions Co-Authored-By: Lennard Hofmann --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index bf456d9..df15f31 100755 --- a/build.sh +++ b/build.sh @@ -82,7 +82,7 @@ if [ -z "$VERSION" ]; then fi # Check if zip is installed -if [ zip ]; then +if ! command -v zip >/dev/null; then echo "Error: missing 'zip' utility." exit 2 fi From 8fd26d9e083a6ccbaff2a9135b7265dde1f69d5e Mon Sep 17 00:00:00 2001 From: Brandon Richardson Date: Sun, 3 Aug 2025 10:09:08 +0200 Subject: [PATCH 11/15] fix(manifest): migrate to manifest v3 for chrome extension Migrate to version 3 of the manifest format for Chrome. Firefox continues to support V2 for the foreseeable future, so we'll migrate down the road. Additionally, at the request of many users, change the omni keyword from 'find' to 'findplus'. Special thanks to pzhlkj6612! --- .github/CODE_OF_CONDUCT.md | 46 ------------------- .github/CONTRIBUTING.md | 21 --------- CODE_OF_CONDUCT.md | 74 ++++++++++++++++++++++++++++++ CONTRIBUTING.md | 44 ++++++++++++++++++ .github/PRIVACY.md => PRIVACY.md | 5 +- .github/README.md => README.md | 62 +++++++++++++++++-------- app.js | 14 +----- background/background.js | 12 ++--- background/browser-action-proxy.js | 4 +- background/content-proxy.js | 8 ++-- background/omni.js | 4 +- background/service_worker.js | 7 +++ docs/index.html | 2 +- manifest.json | 59 +++++++++++++----------- manifest_firefox.json | 2 +- 15 files changed, 222 insertions(+), 142 deletions(-) delete mode 100644 .github/CODE_OF_CONDUCT.md delete mode 100644 .github/CONTRIBUTING.md create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md rename .github/PRIVACY.md => PRIVACY.md (89%) rename .github/README.md => README.md (71%) create mode 100644 background/service_worker.js diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md deleted file mode 100644 index 7bd8676..0000000 --- a/.github/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,46 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at brandon1024.br@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md deleted file mode 100644 index ab47d1c..0000000 --- a/.github/CONTRIBUTING.md +++ /dev/null @@ -1,21 +0,0 @@ -# Contributing to {find+} -We need help! We feel this project has great potential, but there is a lot of work to go around. If you are interested in becoming a contributor, reading this document should help you get started. - -All contributions from the community must follow the [Code of Conduct](CODE_OF_CONDUCT.md). - -## Reporting an Issue -Did you notice an issue? We probably missed something. Let us know by [opening an issue](https://github.com/brandon1024/find/issues). Be sure to check whether the issue has already been brought up (expand upon the issue if you have more details), or whether the issue has been fixed in a new release. - -In creating a new issue, ensure you use a succinct title, full description, and images if applicable. - -If you think you can fix the issue yourself, follow the steps to become a contributor. If you feel the issue is outside of your comfort zone, you can mention someone in the description or assign the issue to another developer. - -## Making Changes -Our project follows the git-flow. This means that we have a `master` (stable-release) branch, and a `develop` (beta) branch. All proposed changes must be targeted at the `develop` branch. - -Once you create a fork of this repository, you can make your changes on a feature branch and open a pull request to the upstream project when it's ready. - -Once you think your changes are ready to be merged, create a pull request. Use a succinct title, full description, and images if applicable. Linking a pull request to the original issue helps the reviewer when testing your changes. Provide a description of how you tested your changes locally. Another developer will review your changes, provide feedback, and merge once everything looks good. - -## Reviewing a Pull Request -Code reviews plays an important part of our development cycle. As a reviewer, it's important to check that fixes/functionality is working as described, that the changes follow good style guidelines, and that the changes provide value to the project. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..9b9888b --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, nationality, personal appearance, race, religion, or sexual identity +and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at brandon1024.br@gmail.com. The project +team will review and investigate all complaints, and will respond in a way that +it deems appropriate to the circumstances. The project team is obligated to +maintain confidentiality with regard to the reporter of an incident. Further +details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..a2d549a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,44 @@ +# Contributing to {find+} + +We need help! We feel this project has great potential, but there is a lot of +work to go around. If you are interested in becoming a contributor, reading this +document should help you get started. + +All contributions from the community must follow the [Code of Conduct](CODE_OF_CONDUCT.md). + +## Reporting an Issue + +Did you notice an issue? We probably missed something. Let us know by [opening +an issue](https://github.com/brandon1024/find/issues). Be sure to check whether +the issue has already been brought up (expand upon the issue if you have more +details), or whether the issue has been fixed in a new release. + +In creating a new issue, ensure you use a succinct title, full description, and +images if applicable. + +If you think you can fix the issue yourself, follow the steps to become a +contributor. If you feel the issue is outside of your comfort zone, you can +mention someone in the description or assign the issue to another developer. + +## Making Changes + +Our project follows the git-flow. This means that we have a `master` +(stable-release) branch, and a `develop` (beta) branch. All proposed changes +must be targeted at the `develop` branch. + +Once you create a fork of this repository, you can make your changes on a +feature branch and open a pull request to the upstream project when it's ready. + +Once you think your changes are ready to be merged, create a pull request. Use a +succinct title, full description, and images if applicable. Linking a pull +request to the original issue helps the reviewer when testing your changes. +Provide a description of how you tested your changes locally. Another developer +will review your changes, provide feedback, and merge once everything looks +good. + +## Reviewing a Pull Request + +Code reviews plays an important part of our development cycle. As a reviewer, +it's important to check that fixes/functionality is working as described, that +the changes follow good style guidelines, and that the changes provide value to +the project. diff --git a/.github/PRIVACY.md b/PRIVACY.md similarity index 89% rename from .github/PRIVACY.md rename to PRIVACY.md index ca83704..27a70f9 100644 --- a/.github/PRIVACY.md +++ b/PRIVACY.md @@ -1,8 +1,9 @@ # Find+ Privacy Policy + Find+ does not collect any data of any kind. -- Find+ is run on the client, only. There are no external servers hosted to support this extension. +- Find+ is run on the client, only. There are no external servers hosted to + support this extension. - Find+ doesn't embed any kind of analytic or telemetry hooks in its code. - Find+ doesn't accept donations or any other form of financing. - Find+ doesn't make any web requests to any third party servers. - diff --git a/.github/README.md b/README.md similarity index 71% rename from .github/README.md rename to README.md index a26d836..cdb7628 100644 --- a/.github/README.md +++ b/README.md @@ -1,13 +1,18 @@ - + # **{find+}** + [![Chrome Users](https://img.shields.io/chrome-web-store/users/fddffkdncgkkdjobemgbpojjeffmmofb.svg?style=flat&label=chrome%20users)](https://chrome.google.com/webstore/detail/find%2B/fddffkdncgkkdjobemgbpojjeffmmofb) [![Firefox Users](https://img.shields.io/amo/users/brandon1024-find.svg?label=firefox%20users&style=flat)](https://addons.mozilla.org/en-US/firefox/addon/brandon1024-find/) [![Last Commit on GitHub](https://img.shields.io/github/last-commit/brandon1024/find.svg?style=flat)](https://github.com/brandon1024/find/commits/develop) -**{find+}** is a powerful _find-in-page_ extension for Chrome and Firefox that allows you to search for content in a web page or document by regular expression. It is a feature-rich alternative to the native _find-in-page_ tool built into your browser. +**{find+}** is a powerful _find-in-page_ extension for Chrome and Firefox that +allows you to search for content in a web page or document by regular +expression. It is a feature-rich alternative to the native _find-in-page_ tool +built into your browser. Some notable features: + - match a regular expression against text in a web page - quickly search for text using the browser omnibox - find and replace text in a page @@ -15,25 +20,36 @@ Some notable features: - store frequently-used patterns - adjust colours and search settings -![](screencast.gif) ## Getting Started -The **{find+}** extension is available through the Chrome Web Store and through the Firefox Add-ons Store. - Download the extension here: [find+ | Regex Find-in-Page Tool](https://chrome.google.com/webstore/detail/find%2B/fddffkdncgkkdjobemgbpojjeffmmofb). +The **{find+}** extension is available through the Chrome Web Store and through +the Firefox Add-ons Store. + + Download the extension here: [find+ | Regex Find-in-Page Tool](https://chrome.google.com/webstore/detail/find%2B/fddffkdncgkkdjobemgbpojjeffmmofb). - Download the extension here: [{find+} – Get this Extension for 🦊 Firefox](https://addons.mozilla.org/en-US/firefox/addon/brandon1024-find/). + Download the extension here: [{find+} – Get this Extension for 🦊 Firefox](https://addons.mozilla.org/en-US/firefox/addon/brandon1024-find/). ## Keyboard Shortcuts -In Firefox, you can use CTRL++F to open the extension popup. -To open the extension popup in Chrome using a keyboard shortcut, you must first assign a keyboard shortcut to the extension through the Chrome settings. You can do this by following these steps: -1. Navigate to the `Extensions` settings page in Chrome, or type `chrome://extensions/` into the navigation bar. +In Firefox, you can use CTRL++F to open the +extension popup. + +To open the extension popup in Chrome using a keyboard shortcut, you must first +assign a keyboard shortcut to the extension through the Chrome settings. You can +do this by following these steps: + +1. Navigate to the `Extensions` settings page in Chrome, or type + `chrome://extensions/` into the navigation bar. 2. In the top left click on the ☰ menu icon, then click `Keyboard shortcuts`. -3. Locate the shortcut settings for find+. Click the input field located to the right of the label `Activate the extension`. -4. Press the combination of keys you would like to use, and once complete press `OK`. We recommend using CTRL++F, since it shouldn't conflict with any other browser keyboard shortcut mappings. +3. Locate the shortcut settings for find+. Click the input field located to the + right of the label `Activate the extension`. +4. Press the combination of keys you would like to use, and once complete press + `OK`. We recommend using CTRL++F, since it + shouldn't conflict with any other browser keyboard shortcut mappings. -When the extension popup is open, there are a number of keyboard shortcuts you can use. These settings cannot be remapped. +When the extension popup is open, there are a number of keyboard shortcuts you +can use. These settings cannot be remapped. | Windows Shortcut | macOS Shortcut | Action | | :------------------------------------------------- | :------------------------------------------------- | :--------------------------------------------------------------------- | @@ -48,18 +64,28 @@ When the extension popup is open, there are a number of keyboard shortcuts you c | CTRL+ or ESC | ^+ or ESC | Close the extension popup | ## Omnibox Support -In version 1.4.0, we introduced omnibox support! This allows you to highlight text on a page without even opening the extension. To use this feature, type `find` in your browser's address bar, press or , and then enter a regular expression. Occurrences of the regular expression will become highlighted on the page as you type. -Pressing `ENTER` will leave the highlights in the page. To remove the highlights, simply refresh the page. If you don't want to leave the highlights in the page, just erase the text entered in the address bar. +In version 1.4.0, we introduced omnibox support! This allows you to highlight +text on a page without even opening the extension. To use this feature, type +`findplus` in your browser's address bar, press or , +and then enter a regular expression. Occurrences of the regular expression will +become highlighted on the page as you type. - +Pressing `ENTER` will leave the highlights in the page. To remove the +highlights, simply refresh the page. If you don't want to leave the highlights +in the page, just erase the text entered in the address bar. + + ## Contributing -We can use your help! Our [CONTRIBUTING](CONTRIBUTING.md) doc should help get you started. + +We can use your help! Our [CONTRIBUTING](CONTRIBUTING.md) doc should help get +you started. ## Contributors -[](https://github.com/brandon1024) [](https://github.com/MichaelWalz) [](https://github.com/muescha) [](https://github.com/amit-gshe) [](https://github.com/ReporterX) + +[](https://github.com/brandon1024) [](https://github.com/MichaelWalz) [](https://github.com/muescha) [](https://github.com/amit-gshe) [](https://github.com/ReporterX) [](https://github.com/pzhlkj6612) ## License -This project is licensed under the [GPLv3 License](https://www.gnu.org/licenses/gpl-3.0.en.html). +This project is licensed under the [GPLv3 License](https://www.gnu.org/licenses/gpl-3.0.en.html). diff --git a/app.js b/app.js index 4538fca..1730075 100644 --- a/app.js +++ b/app.js @@ -10,11 +10,7 @@ const Find = (function () { const self = {}; self.browserId = (() => { - if(typeof window.browser !== 'undefined') { - return 'Firefox'; - } else { - return 'Chrome'; - } + return typeof browser !== 'undefined' ? 'Firefox' : 'Chrome'; })(); self.browser = (() => { @@ -25,12 +21,6 @@ const Find = (function () { return self.browser.extension.inIncognitoContext; })(); - /** - * This callback function is used to initialize the namespace. - * @callback registerCallback - * @param {object} self - Object used to create public functions and variables. - * */ - /** * Register a new namespace, and initialize it using a callback function. * @@ -110,4 +100,4 @@ const Find = (function () { } return self; -})(); \ No newline at end of file +})(); diff --git a/background/background.js b/background/background.js index 2a2cc98..a43cae4 100644 --- a/background/background.js +++ b/background/background.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; /** * Create the Background namespace. The background coordinates activities between the browser @@ -21,13 +21,13 @@ Find.register("Background", function(self) { Find.browser.contextMenus.removeAll(() => { Find.browser.contextMenus.create({ title: "Show Help", - contexts: ["browser_action"], + contexts: ["action"], id: 'show-help' }); Find.browser.contextMenus.onClicked.addListener((info) => { if(info.menuItemId === 'show-help') { - Find.browser.tabs.create({url: Find.browser.extension.getURL("docs/index.html")}); + Find.browser.tabs.create({url: Find.browser.runtime.getURL("docs/index.html")}); } }); }); @@ -49,15 +49,13 @@ Find.register("Background", function(self) { continue; } - for (let i = 0; i < scripts.length; i++) { - Find.Background.ContentProxy.executeScript(tabs[tabIndex], {file: scripts[i]}); - } + Find.Background.ContentProxy.executeScript(tabs[tabIndex], {files: scripts}); } }); } if(installation.reason === 'install') { - Find.browser.tabs.create({url: Find.browser.extension.getURL("docs/index.html")}); + Find.browser.tabs.create({url: Find.browser.runtime.getURL("docs/index.html")}); } }); diff --git a/background/browser-action-proxy.js b/background/browser-action-proxy.js index 37b3324..4764136 100644 --- a/background/browser-action-proxy.js +++ b/background/browser-action-proxy.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; /** * Create the Background ContentProxy namespace. Serves as mediator between the background scripts @@ -81,4 +81,4 @@ Find.register("Background.BrowserActionProxy", function() { break; } } -}); \ No newline at end of file +}); diff --git a/background/content-proxy.js b/background/content-proxy.js index f663c09..ca1304f 100644 --- a/background/content-proxy.js +++ b/background/content-proxy.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; /** * Create the Background ContentProxy namespace. Serves as mediator between the content @@ -142,11 +142,11 @@ Find.register("Background.ContentProxy", function(self) { * Execute a given script in a specific tab. * * @param {object} tab - The tab with the search. - * @param {object} details - Details of the script to run. Either the code or the file property must be set, but + * @param {object} details - Details of the script to run. Either the func or the files property must be set, but * both may not be set at the same time. * @param {function} [callback] - Callback invoked once the operation is complete. * */ self.executeScript = function(tab, details, callback) { - Find.browser.tabs.executeScript(tab.id, details, callback); + Find.browser.scripting.executeScript({target: {tabId: tab.id}, ...details}, callback); }; -}); \ No newline at end of file +}); diff --git a/background/omni.js b/background/omni.js index e482f4e..f70bbc6 100644 --- a/background/omni.js +++ b/background/omni.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; /** * Create the Background Omni namespace. Registers various event listeners which invoke @@ -92,4 +92,4 @@ Find.register("Background.Omni", function(self) { callback(options); }); } -}); \ No newline at end of file +}); diff --git a/background/service_worker.js b/background/service_worker.js new file mode 100644 index 0000000..51e5c2c --- /dev/null +++ b/background/service_worker.js @@ -0,0 +1,7 @@ +"use strict"; + +importScripts('../app.js'); +importScripts('./browser-action-proxy.js'); +importScripts('./content-proxy.js'); +importScripts('./background.js'); +importScripts('./omni.js'); diff --git a/docs/index.html b/docs/index.html index f6a3725..11de080 100644 --- a/docs/index.html +++ b/docs/index.html @@ -351,7 +351,7 @@

Result in Clipboard

You can also use the omnibox to highlight occurrences of a query in the page, rather than opening the browser extension popup.

-

To use this feature, type "find" in your browser's address bar, press space, and then enter a regular +

To use this feature, type "findplus" in your browser's address bar, press space, and then enter a regular expression. Occurrences of the regular expression will become highlighted on the page as you type.

Pressing ENTER will leave the highlights in the page. To remove the highlights, simply diff --git a/manifest.json b/manifest.json index 1a75e9a..7761d5b 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,11 @@ "name": "__MSG_extension_name__", "short_name": "find+", "version": "1", - "author": ["Michael Walz", "Brandon Richardson"], - "manifest_version": 2, + "author": [ + "Michael Walz", + "Brandon Richardson" + ], + "manifest_version": 3, "description": "__MSG_extension_description__", "default_locale": "en", "permissions": [ @@ -12,6 +15,9 @@ "background", "storage", "contextMenus", + "scripting" + ], + "host_permissions": [ "" ], "icons": { @@ -19,37 +25,38 @@ "16": "resources/icon.png", "48": "resources/icon.png" }, - "browser_action": { - "default_icon": "resources/icon.png", + "action": { + "default_icon": { + "128": "resources/icon.png", + "16": "resources/icon.png", + "48": "resources/icon.png" + }, "default_popup": "popup/popup.html" }, "background": { - "scripts": [ - "app.js", - "/background/browser-action-proxy.js", - "/background/content-proxy.js", - "/background/background.js", - "/background/omni.js" - ], - "persistent": false + "service_worker": "/background/service_worker.js" }, - "content_scripts": [{ - "matches": [""], - "all_frames": false, - "run_at": "document_end", - "js": [ - "app.js", - "/lib/html-entity-handler/entityhandler.js", - "/content/content.js", - "/content/parser.js", - "/content/highlighter.js" - ] - }], + "content_scripts": [ + { + "matches": [ + "" + ], + "all_frames": false, + "run_at": "document_end", + "js": [ + "app.js", + "/lib/html-entity-handler/entityhandler.js", + "/content/content.js", + "/content/parser.js", + "/content/highlighter.js" + ] + } + ], "omnibox": { - "keyword" : "find" + "keyword": "findplus" }, "commands": { - "_execute_browser_action": { + "_execute_action": { "suggested_key": { "default": "Ctrl+Shift+F", "mac": "MacCtrl+Shift+F" diff --git a/manifest_firefox.json b/manifest_firefox.json index 2ca09a1..8b6eaf9 100644 --- a/manifest_firefox.json +++ b/manifest_firefox.json @@ -44,7 +44,7 @@ ] }], "omnibox": { - "keyword" : "find" + "keyword" : "findplus" }, "commands": { "_execute_browser_action": { From 1966cb4791cfa022b01b4ac25d7d3287e58751a7 Mon Sep 17 00:00:00 2001 From: Mozi <29089388+pzhlkj6612@users.noreply.github.com> Date: Sun, 20 Apr 2025 15:49:52 +0000 Subject: [PATCH 12/15] Drop the "tabs" permission See goodbye to "Read your browsing history". --- background/background.js | 3 ++- manifest.json | 1 - manifest_firefox.json | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/background/background.js b/background/background.js index a43cae4..3e0a9e0 100644 --- a/background/background.js +++ b/background/background.js @@ -43,7 +43,8 @@ Find.register("Background", function(self) { Find.browser.tabs.query({}, (tabs) => { for(let tabIndex = 0; tabIndex < tabs.length; tabIndex++) { let url = tabs[tabIndex].url; - if(url.match(/chrome:\/\/.*/) + // Without the "tabs" permission, browser's internal webpage (e.g., "chrome://" or "chrome-extension://") has no "url" + if(!url || url.match(/https:\/\/chrome\.google\.com\/webstore\/.*/) || url.match(/https:\/\/chromewebstore\.google\.com\/.*/)) { continue; diff --git a/manifest.json b/manifest.json index 7761d5b..5f546be 100644 --- a/manifest.json +++ b/manifest.json @@ -10,7 +10,6 @@ "description": "__MSG_extension_description__", "default_locale": "en", "permissions": [ - "tabs", "activeTab", "background", "storage", diff --git a/manifest_firefox.json b/manifest_firefox.json index 8b6eaf9..8f0d0c5 100644 --- a/manifest_firefox.json +++ b/manifest_firefox.json @@ -7,7 +7,6 @@ "description": "__MSG_extension_description__", "default_locale": "en", "permissions": [ - "tabs", "activeTab", "storage", "contextMenus", From e9e9e4b398c655a932c80e8c4d7a2c681e0dc8e0 Mon Sep 17 00:00:00 2001 From: Mozi <29089388+pzhlkj6612@users.noreply.github.com> Date: Tue, 22 Apr 2025 15:36:30 +0000 Subject: [PATCH 13/15] Rework Zh l10n; correct info in En msg; localize "Show Help" button --- _locales/en/messages.json | 12 +++-- _locales/zh/messages.json | 98 +++++++++++++++++++++------------------ background/background.js | 2 +- 3 files changed, 62 insertions(+), 50 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 3437f03..51e551e 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -4,7 +4,7 @@ "description": "The extension name in the manifest file." }, "extension_description": { - "message": "A find-in-page extension for Google Chrome with support for regular expressions.", + "message": "A find-in-page extension with support for regular expressions.", "description": "Short description of the extension in the manifest file." }, @@ -90,7 +90,7 @@ "description": "Tooltip text for the persistent highlights option description icon." }, "extension_option_persistent_storage_incognito_title": { - "message": "If enabled, searches and options will be persisted in regular and incognito sessions. If disabled, no session information will be saved while incognito.", + "message": "If enabled, searches and options will be persisted in regular and incognito sessions.\nIf disabled, no session information will be saved while incognito.", "description": "Tooltip text for the persistent storage incognito option description icon." }, "extension_option_hide_option_pane_toggle_button_title": { @@ -154,7 +154,7 @@ "description": "Text displayed in the message pane when the extension is used in a PDF." }, "extension_limitation_offline_file_text": { - "message": "Something went wrong internally while trying to search this offline file. Luckily, we might know how to fix this. Navigate to 'chrome://extensions' and locate the checkbox 'Allow access to file URLs' under the {find+} extension.", + "message": "Something went wrong internally while trying to search this offline file. Luckily, we might know how to fix this. Navigate to 'chrome://extensions' and locate the checkbox 'Allow access to file URLs' in the 'Details' page of the {find+} extension.", "description": "Text displayed in the message pane when the extension is used in an offline file without adequate permissions for parsing file contents." }, "search_options_header_text": { @@ -229,5 +229,11 @@ "save_expression_button_text":{ "message": "Save Expression", "description": "Text displayed in the saved expressions pane." + }, + + + "contextmenu_show_help_title": { + "message": "Show Help", + "description": "Text displayed inside the show-help button in the context menu." } } diff --git a/_locales/zh/messages.json b/_locales/zh/messages.json index 1870102..fac1e0d 100644 --- a/_locales/zh/messages.json +++ b/_locales/zh/messages.json @@ -4,37 +4,37 @@ "description": "The extension name in the manifest file." }, "extension_description": { - "message": "一个支持正则表达式的网页搜索插件", + "message": "一个支持正则表达式查找的扩展程序", "description": "Short description of the extension in the manifest file." }, "search_field_title": { - "message": "搜索字段", + "message": "表达式", "description": "Tooltip text for the search field." }, "malformed_regex_error_title": { - "message": "错误的表达式:\n输入的表达式不被接受,因为不是有效的正则表达式或者不匹配Javascript正则规范。", + "message": "表达式错误:\n可能输入了不符合 JavaScript 规范的正则表达式。", "description": "Tooltip text for the invalid regex icon." }, "clipboard_copy_error_title": { - "message": "未能复制到剪贴板,由于一些未知错误。", + "message": "未知错误,无法复制到剪贴板。", "description": "Tooltip text for the clipboard copy error icon." }, "iframes_found_warning_title": { - "message": "该页有一个或多个框架,可能会导致搜索结果不被高亮显示", + "message": "由于该页面包含 iframe,页面上的某些内容将被忽略从而没有高亮。", "description": "Tooltip text for the iframes encountered warning icon." }, "clipboard_copy_title": { - "message": "正则已复制到剪贴板。", + "message": "匹配项已复制到剪贴板。", "description": "Tooltip text for the clipboard copy successful icon." }, "installation_information_title": { - "message": "欢迎并感谢安装我们的插件!这里有一些提示帮助你开始使用:\n\tENTER:查找下一个结果\n\tSHIFT-ENTER:返回上一个结果\n\tCTRL-ALT-0:展开或折叠可选面板\n\tCTRL-ALT-R:展开或折叠替代文本面板\n\tCTRL-ENTER 或 ESC:关闭插件弹窗", + "message": "欢迎!感谢您安装我们的扩展程序。这里是一些提示:\n\tENTER:查看页面中的下一个匹配项\n\tSHIFT-ENTER:查看页面中的上一个匹配项\n\tCTRL-ALT-O:显示或隐藏“设置”面板\n\tCTRL-ALT-R:显示或隐藏“查找并替换”面板\n\tCTRL-ENTER 或 ESC:关闭本窗口", "description": "Tooltip text for the install information icon." }, "update_information_title": { - "message": "我们更新了插件!现在它会工作的更好:)\n在我们的GitHub页查看这次的更新信息!", + "message": "我们刚刚更新了这个扩展程序!现在它更好用了 :)\n请访问我们的 GitHub 页面了解本次更新的详细信息!", "description": "Tooltip text for the update information icon." }, "search_prev_title": { @@ -46,7 +46,7 @@ "description": "Tooltip text for the seek forwards button." }, "toggle_options_pane_title": { - "message": "设置窗口", + "message": "设置", "description": "Tooltip text for the toggle options pane button." }, "toggle_saved_expressions_button": { @@ -54,7 +54,7 @@ "description": "Tooltip text for the show saved expressions button." }, "copy_to_clipboard_button_title": { - "message": "复制所有结果到剪贴板", + "message": "复制到剪贴板", "description": "Tooltip text for the copy to clipboard button." }, "toggle_find_replace_button_title": { @@ -62,73 +62,73 @@ "description": "Tooltip text for the find and replace toggle button." }, "close_extension_title": { - "message": "关闭find+", + "message": "关闭 find+", "description": "Tooltip text for the close extension button." }, "replace_field_title": { - "message": "替换字段", + "message": "替换文本", "description": "Tooltip text for the replace field." }, "replace_button_title": { - "message": "替换下一个", + "message": "替换下一个匹配项", "description": "Tooltip text for the replace next button." }, "replace_all_button_title": { - "message": "替换所有", + "message": "替换所有匹配项", "description": "Tooltip text for the replace all button." }, "search_option_find_by_regex_title": { - "message": "如果启用,搜索框的输入文本将作为正则表达式。\n如果禁用,文本将会作为普通字符。", + "message": "若启用,将“表达式”视为正则表达式;\n若禁用,则视为普通文本。", "description": "Tooltip text for the find by regex option description icon." }, "search_option_match_case_title": { - "message": "如果启用,大小写字母必须匹配表达式。\n如果禁用,大小写字母不影响匹配。", + "message": "若启用,“表达式”大小写敏感;\n若禁用,则忽略大小写。", "description": "Tooltip text for the match case option description icon." }, "search_option_persistent_highlights_title": { - "message": "如果启用,关闭插件后依然显示高亮。\n通过刷新或者重新打开网页取消高亮", + "message": "若启用,关闭本窗口后仍然显示高亮。\n要移除高亮,刷新页面或重新打开本扩展程序", "description": "Tooltip text for the persistent highlights option description icon." }, "extension_option_persistent_storage_incognito_title": { - "message": "如果启用,搜索和选项将保留在常规和隐身窗口中。如果禁用,则在使用隐身窗口时不会保存任何会话信息。", + "message": "若启用,本扩展程序的设置和已保存的表达式将由常规浏览和无痕浏览共享;\n若禁用,在无痕浏览时所作的任何修改均不会保留", "description": "Tooltip text for the persistent storage incognito option description icon." }, "extension_option_hide_option_pane_toggle_button_title": { - "message": "如果启用,隐藏'设置窗口'的按钮。\n键盘快捷键仍可用于显示或隐藏该窗格。", + "message": "若启用,将隐藏顶部的“设置”面板切换按钮。\n仍可使用快捷键显示或隐藏该面板。", "description": "Tooltip text for the hide option pane toggle button option description icon." }, "extension_option_hide_saved_expressions_pane_toggle_button_title": { - "message": "如果启用,隐藏'保存的表达式'的按钮。\n键盘快捷键仍可用于显示或隐藏窗格。", + "message": "若启用,将隐藏顶部的“保存的表达式”面板切换按钮。\n仍可使用快捷键显示或隐藏该面板。", "description": "Tooltip text for the hide saved expressions pane toggle button option description icon." }, "extension_option_hide_copy_to_clipboard_toggle_button_title": { - "message": "如果启用,隐藏'复制到剪贴板'的按钮。\n键盘快捷方式仍可用于将所有匹配项复制到剪贴板。", + "message": "若启用,将隐藏顶部的“复制到剪贴板”按钮。\n仍可使用快捷键复制所有匹配项到剪贴板。", "description": "Tooltip text for the copy all occurrences to clipboard button option description icon." }, "extension_option_hide_find_replace_toggle_button_title": { - "message": "如果启用,隐藏'查找和替换'窗格的按钮。\n键盘快捷键仍可用于显示或隐藏窗格。", + "message": "若启用,将隐藏顶部的“查找并替换”面板切换按钮。\n仍可使用快捷键显示或隐藏该面板。", "description": "Tooltip text for the hide find and replace pane toggle button option description icon." }, "saved_expression_icon_title": { - "message": "加载这个表达式", + "message": "使用该表达式", "description": "Tooltip text for a saved expression entry icon." }, "delete_saved_expression_icon_title": { - "message": "删除这个表达式", + "message": "删除该表达式", "description": "Tooltip text for a delete saved expression entry icon." }, "clear_expressions_button_title": { - "message": "清除所有保存的表达式", + "message": "清空已保存的表达式", "description": "Tooltip text for the clear saved expressions button." }, "save_expression_button_title": { - "message": "保存搜索字段的表达式", + "message": "保存当前表达式", "description": "Tooltip text for the save expression button." }, "replace_field_placeholder": { - "message": "替换为..", + "message": "替换为…", "description": "Placeholder text for the replace field." }, @@ -138,39 +138,39 @@ "description": "Text displayed inside the replace button." }, "replace_all_button_text": { - "message": "替换所有", + "message": "全部替换", "description": "Text displayed inside the replace all button." }, "extension_limitation_web_store_text": { - "message": "哎呀!您似乎正在尝试在Chrome网上应用店中使用该插件。Google的开发人员已阻止插件在此处执行,以防止恶意注入代码。这是所有Chrome插件的安全限制。", + "message": "哎呀!您似乎正在 Chrome 应用商店中使用本扩展程序。Google 的开发者设置了安全限制,屏蔽了所有的 Chrome 扩展程序以避免恶意代码注入。", "description": "Text displayed in the message pane when the extension is used in the Chrome Web Store." }, "extension_limitation_chrome_namespace_text": { - "message": "哎呀!您似乎正在尝试在'chrome://'命名空间中使用插件。Google的开发人员已阻止插件在此处执行,以防止恶意注入代码。这是所有 Chrome 插件的安全限制。", + "message": "哎呀!您似乎正在“chrome://”命名空间中使用本扩展程序。Google 的开发者设置了安全限制,屏蔽了所有的 Chrome 扩展程序以避免恶意代码注入。", "description": "Text displayed in the message pane when the extension is used in the chrome:// namespace." }, "extension_limitation_pdf_text": { - "message": "哎呀!您似乎正在尝试在 PDF 文档中使用插件名。不幸的是,由于PDF查看器的复杂性,我们的插件无法处理PDF搜索。我们建议改用本机工具。", + "message": "哎呀!您似乎正在 PDF 文档中使用本扩展程序。由于浏览器的内置阅读器比较复杂,很遗憾,我们无法进行查找,建议改用专门的 PDF 阅读器", "description": "Text displayed in the message pane when the extension is used in a PDF." }, "extension_limitation_offline_file_text": { - "message": "尝试搜索此脱机文件时内部出现问题。幸运的是,我们可能知道如何解决这个问题。导航到'chrome://extensions',然后在插件名{find+}下找到'允许访问文件URL'复选框。", + "message": "在离线文件中查找时出现错误,请按下列步骤操作:访问“chrome://extensions”,进入 find+ 扩展程序的详情页,勾选“允许访问文件网址”复选框。", "description": "Text displayed in the message pane when the extension is used in an offline file without adequate permissions for parsing file contents." }, "search_options_header_text": { - "message": "正则设置", + "message": "表达式设置", "description": "Header text displayed in the options pane." }, "extension_options_header_text": { - "message": "插件设置", + "message": "扩展程序设置", "description": "Header text displayed in the options pane." }, "saved_expressions_body_header": { - "message": "保存表达式", + "message": "保存的表达式", "description": "Header text displayed in the saved expressions pane." }, "search_option_find_by_regex_text": { - "message": "通过正则表达式查找", + "message": "正则表达式", "description": "Text displayed beside the find by regex option." }, "search_option_match_case_text": { @@ -178,27 +178,27 @@ "description": "Text displayed beside the match case option." }, "search_option_persistent_highlights_text": { - "message": "持续高亮", + "message": "保持高亮", "description": "Text displayed beside the persistent highlights option." }, "extension_option_persistent_storage_incognito_text": { - "message": "持续存储", + "message": "存储持久化(无痕浏览)", "description": "Text displayed beside the persistent storage option." }, "extension_option_hide_option_pane_toggle_button_text": { - "message": "隐藏'设置窗口'按钮", + "message": "隐藏“设置”按钮", "description": "Text displayed beside the hide option pane toggle button option." }, "extension_option_hide_saved_expressions_pane_toggle_button_text": { - "message": "隐藏'保存的表达式'按钮", + "message": "隐藏“保存的表达式”按钮", "description": "Text displayed beside the hide saved expressions pane toggle button option." }, "extension_option_hide_copy_to_clipboard_toggle_button_text": { - "message": "隐藏'复制到剪贴板'按钮", + "message": "隐藏“复制到剪贴板”按钮", "description": "Text displayed beside the hide copy to clipboard toggle button option." }, "extension_option_hide_find_replace_toggle_button_text": { - "message": "隐藏'查找和替换'按钮", + "message": "隐藏“查找并替换”按钮", "description": "Text displayed beside the hide find and replace toggle button option." }, "search_option_max_results_text": { @@ -206,7 +206,7 @@ "description": "Text displayed above the max highlighted results option." }, "search_option_index_highlight_text": { - "message": "选中的高亮颜色", + "message": "选中项的高亮颜色", "description": "Text displayed above the index highlight color option." }, "search_option_all_highlight_text": { @@ -214,20 +214,26 @@ "description": "Text displayed above the all highlight color option." }, "reset_options_button_text": { - "message": "重置所有选项", + "message": "重置所有设置", "description": "Text displayed in the reset options button." }, "no_expressions_found_text": { - "message": "没有找到保存的表达式", + "message": "表达式为空", "description": "Text displayed in the saved expressions pane when no expressions exist." }, "clear_expressions_button_text":{ - "message": "清除保存的表达式", + "message": "清空表达式", "description": "Text displayed in the saved expressions pane." }, "save_expression_button_text":{ "message": "保存表达式", "description": "Text displayed in the saved expressions pane." + }, + + + "contextmenu_show_help_title": { + "message": "显示帮助(英语)", + "description": "Text displayed inside the show-help button in the context menu." } } diff --git a/background/background.js b/background/background.js index 3e0a9e0..1e4681d 100644 --- a/background/background.js +++ b/background/background.js @@ -20,7 +20,7 @@ Find.register("Background", function(self) { Find.browser.contextMenus.removeAll(() => { Find.browser.contextMenus.create({ - title: "Show Help", + title: Find.browser.i18n.getMessage("contextmenu_show_help_title"), contexts: ["action"], id: 'show-help' }); From ae34c094e05b312ffdfa704d0c5ed5c4b6ed41f3 Mon Sep 17 00:00:00 2001 From: Mozi <29089388+pzhlkj6612@users.noreply.github.com> Date: Sun, 24 Aug 2025 06:30:19 +0000 Subject: [PATCH 14/15] Fix broken menu of browser action on Firefox Firefox is still MV2: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/menus/ContextType#browser_action ... banged my head against the wall! --- background/background.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/background/background.js b/background/background.js index 1e4681d..793eabf 100644 --- a/background/background.js +++ b/background/background.js @@ -21,7 +21,7 @@ Find.register("Background", function(self) { Find.browser.contextMenus.removeAll(() => { Find.browser.contextMenus.create({ title: Find.browser.i18n.getMessage("contextmenu_show_help_title"), - contexts: ["action"], + contexts: [(Find.browserId !== 'Firefox') ? "action" : "browser_action"], id: 'show-help' }); From 3ef3f36f35fe7ea6a4fc770c3c4415ec9011aca3 Mon Sep 17 00:00:00 2001 From: Mozi <29089388+pzhlkj6612@users.noreply.github.com> Date: Mon, 21 Apr 2025 08:39:41 +0000 Subject: [PATCH 15/15] Ignore URLs of internal restricted browser pages Co-authored-by: Brandon Richardson --- _locales/en/messages.json | 10 +++------- _locales/zh/messages.json | 10 +++------- background/background.js | 5 +++-- popup/css/messagepane.css | 3 +-- popup/js/browser-action.js | 41 ++++++++++++++++++++++++-------------- popup/js/message-pane.js | 14 +++---------- popup/popup.html | 6 ++---- 7 files changed, 41 insertions(+), 48 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 51e551e..2df9f81 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -141,13 +141,9 @@ "message": "Replace All", "description": "Text displayed inside the replace all button." }, - "extension_limitation_web_store_text": { - "message": "Oops! It appears you are trying to use the extension in the Chrome Web Store. Developers at Google have blocked extensions from executing here to prevent the malicious injection of code. This is a security limitation across all Chrome extensions.", - "description": "Text displayed in the message pane when the extension is used in the Chrome Web Store." - }, - "extension_limitation_chrome_namespace_text": { - "message": "Oops! It appears you are trying to use the extension in the 'chrome://' namespace. Developers at Google have blocked extensions from executing here to prevent the malicious injection of code. This is a security limitation across all Chrome extensions.", - "description": "Text displayed in the message pane when the extension is used in the chrome:// namespace." + "extension_limitation_internal_restricted_browser_page_text": { + "message": "Oops! It appears you are trying to use the extension in a restricted internal browser page. Browser developers have blocked extensions from executing here to prevent the malicious injection of code. This is a security limitation across all browser extensions.", + "description": "Text displayed in the message pane when the extension is used in an internal restrcited browser page." }, "extension_limitation_pdf_text": { "message": "Oops! It appears you are trying to use the extension in a PDF document. Unfortunately, due to the complexity of the PDF viewer our extension is not able to handle searching through a PDF. We recommend using the native tool instead.", diff --git a/_locales/zh/messages.json b/_locales/zh/messages.json index fac1e0d..f5fefbc 100644 --- a/_locales/zh/messages.json +++ b/_locales/zh/messages.json @@ -141,13 +141,9 @@ "message": "全部替换", "description": "Text displayed inside the replace all button." }, - "extension_limitation_web_store_text": { - "message": "哎呀!您似乎正在 Chrome 应用商店中使用本扩展程序。Google 的开发者设置了安全限制,屏蔽了所有的 Chrome 扩展程序以避免恶意代码注入。", - "description": "Text displayed in the message pane when the extension is used in the Chrome Web Store." - }, - "extension_limitation_chrome_namespace_text": { - "message": "哎呀!您似乎正在“chrome://”命名空间中使用本扩展程序。Google 的开发者设置了安全限制,屏蔽了所有的 Chrome 扩展程序以避免恶意代码注入。", - "description": "Text displayed in the message pane when the extension is used in the chrome:// namespace." + "extension_limitation_internal_restricted_browser_page_text": { + "message": "哎呀!您似乎正在浏览器内部页面或某些受限制的页面中使用本扩展程序。为避免遭受恶意代码的攻击,浏览器开发者对所有的扩展程序都施加了安全限制,因此本扩展程序无法在该页面运行。", + "description": "Text displayed in the message pane when the extension is used in an internal restrcited browser page." }, "extension_limitation_pdf_text": { "message": "哎呀!您似乎正在 PDF 文档中使用本扩展程序。由于浏览器的内置阅读器比较复杂,很遗憾,我们无法进行查找,建议改用专门的 PDF 阅读器", diff --git a/background/background.js b/background/background.js index 793eabf..5dbab71 100644 --- a/background/background.js +++ b/background/background.js @@ -45,8 +45,9 @@ Find.register("Background", function(self) { let url = tabs[tabIndex].url; // Without the "tabs" permission, browser's internal webpage (e.g., "chrome://" or "chrome-extension://") has no "url" if(!url - || url.match(/https:\/\/chrome\.google\.com\/webstore\/.*/) - || url.match(/https:\/\/chromewebstore\.google\.com\/.*/)) { + || url.match(/^https:\/\/chrome\.google\.com\/webstore\/.*/) + || url.match(/^https:\/\/chromewebstore\.google\.com\/.*/) + || url.match(/^https:\/\/microsoftedge\.microsoft\.com\/.*/)) { continue; } diff --git a/popup/css/messagepane.css b/popup/css/messagepane.css index b13bbd6..55401c6 100644 --- a/popup/css/messagepane.css +++ b/popup/css/messagepane.css @@ -9,8 +9,7 @@ table#message-table { padding: 3px; } -span#extension-limitation-web-store-text, -span#extension-limitation-chrome-settings-text, +span#extension-limitation-internal-restricted-browser-page-text, span#extension-limitation-pdf-fileview-text, span#extension-limitation-offline-file-search-text { color: #FF0000; diff --git a/popup/js/browser-action.js b/popup/js/browser-action.js index c9d4783..7fa15d9 100644 --- a/popup/js/browser-action.js +++ b/popup/js/browser-action.js @@ -57,11 +57,8 @@ Find.register('Popup.BrowserAction', function (self) { // this is the only time we have the active window hostname Find.Popup.History.setHostname(new URL(url).hostname); - if(isWithinChromeNamespace(url)) { - Find.Popup.MessagePane.showChromeNamespaceErrorMessage(); - self.error('forbidden_url'); - } else if(isWithinWebStoreNamespace(url)) { - Find.Popup.MessagePane.showChromeWebStoreErrorMessage(); + if(isWithinBrowserNamespace(url) || isWithinBrowserWebsiteNamespace(url)) { + Find.Popup.MessagePane.showInternalRestrictedBrowserPageErrorMessage(); self.error('forbidden_url'); } else if(isPDF(url)) { Find.Popup.MessagePane.showPDFSearchErrorMessage(); @@ -252,25 +249,39 @@ Find.register('Popup.BrowserAction', function (self) { }; /** - * Return whether or not the given url is within the chrome:// namespace. + * Return whether or not the given url is within the browser internal namespace. * * @private - * @return {boolean} True if URL is within the chrome:// namespace, false otherwise. + * @return {boolean} True if URL is within the browser internal namespace, false otherwise. * */ - function isWithinChromeNamespace(url) { - return url.match(/chrome:\/\/.*/); + function isWithinBrowserNamespace(url) { + if(url.match(/^(about|view-source):.*/)) { + return true; + } + + if(Find.browserId !== 'Firefox') { + return url.match(/^(chrome(-extension)?|edge):\/\/.*/); + } else { + return url.match(/^moz-extension:\/\/.*/); + } } /** - * Return whether or not the given url is within the Chrome Web Store or newtab namespace. + * Return whether or not the given url is within the browser official website or newtab namespace. * * @private - * @return {boolean} True if URL is within the Chrome Web Store or newtab namespace, false otherwise. + * @return {boolean} True if URL is within the browser official website or newtab namespace, false otherwise. * */ - function isWithinWebStoreNamespace(url) { - return url.match(/https:\/\/chrome\.google\.com\/webstore\/.*/) - || url.match(/https:\/\/chromewebstore\.google\.com\/.*/) - || url.match(/https:\/\/google\.[^\/]*\/_\/chrome\/newtab.*/); + function isWithinBrowserWebsiteNamespace(url) { + if(Find.browserId !== 'Firefox') { + return url.match(/^https:\/\/chrome\.google\.com\/webstore\/.*/) + || url.match(/^https:\/\/chromewebstore\.google\.com\/.*/) + || url.match(/^https:\/\/microsoftedge\.microsoft\.com\/.*/) + || url.match(/^https:\/\/google\.[^\/]*\/_\/chrome\/newtab.*/); + } else { + return url.match(/^https:\/\/addons\.mozilla\.org\/.*/) + || url.match(/^https:\/\/support\.mozilla\.org\/.*/); + } } /** diff --git a/popup/js/message-pane.js b/popup/js/message-pane.js index 7e2363a..eac9b8f 100644 --- a/popup/js/message-pane.js +++ b/popup/js/message-pane.js @@ -8,18 +8,10 @@ Find.register('Popup.MessagePane', function (self) { /** * Display an error message that indicates that the current URL is forbidden. * */ - self.showChromeNamespaceErrorMessage = function() { + self.showInternalRestrictedBrowserPageErrorMessage = function() { document.getElementById('extension-message-body').style.display = 'initial'; - document.getElementById('extension-limitation-chrome-settings-text').style.display = 'initial'; - }; - - /** - * Display an error message that indicates that the current URL is forbidden. - * */ - self.showChromeWebStoreErrorMessage = function() { - document.getElementById('extension-message-body').style.display = 'initial'; - document.getElementById('extension-limitation-web-store-text').style.display = 'initial'; - }; + document.getElementById('extension-limitation-internal-restricted-browser-page-text').style.display = 'initial'; + } /** * Display an error message that indicates that the current page cannot be parsed. diff --git a/popup/popup.html b/popup/popup.html index 2b1f28b..ee30fe1 100644 --- a/popup/popup.html +++ b/popup/popup.html @@ -89,10 +89,8 @@ - - +