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 63%
rename from .github/README.md
rename to README.md
index 5b0db26..cdb7628 100644
--- a/.github/README.md
+++ b/README.md
@@ -1,13 +1,18 @@
-
+
# **{find+}**
-
-
-
-**{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.
+[](https://chrome.google.com/webstore/detail/find%2B/fddffkdncgkkdjobemgbpojjeffmmofb)
+[](https://addons.mozilla.org/en-US/firefox/addon/brandon1024-find/)
+[](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.
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
-
## 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/_locales/en/messages.json b/_locales/en/messages.json
index 1507f43..2df9f81 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": {
@@ -141,20 +141,16 @@
"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.",
"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": {
@@ -221,5 +217,19 @@
"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."
+ },
+
+
+ "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
new file mode 100644
index 0000000..f5fefbc
--- /dev/null
+++ b/_locales/zh/messages.json
@@ -0,0 +1,235 @@
+{
+ "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": "由于该页面包含 iframe,页面上的某些内容将被忽略从而没有高亮。",
+ "description": "Tooltip text for the iframes encountered warning icon."
+ },
+ "clipboard_copy_title": {
+ "message": "匹配项已复制到剪贴板。",
+ "description": "Tooltip text for the clipboard copy successful icon."
+ },
+ "installation_information_title": {
+ "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 页面了解本次更新的详细信息!",
+ "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": "若启用,本扩展程序的设置和已保存的表达式将由常规浏览和无痕浏览共享;\n若禁用,在无痕浏览时所作的任何修改均不会保留",
+ "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_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 阅读器",
+ "description": "Text displayed in the message pane when the extension is used in a PDF."
+ },
+ "extension_limitation_offline_file_text": {
+ "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": "表达式设置",
+ "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."
+ },
+
+
+ "contextmenu_show_help_title": {
+ "message": "显示帮助(英语)",
+ "description": "Text displayed inside the show-help button in the context menu."
+ }
+}
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 62326f4..5dbab71 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
@@ -20,14 +20,14 @@ Find.register("Background", function(self) {
Find.browser.contextMenus.removeAll(() => {
Find.browser.contextMenus.create({
- title: "Show Help",
- contexts: ["browser_action"],
+ title: Find.browser.i18n.getMessage("contextmenu_show_help_title"),
+ contexts: [(Find.browserId !== 'Firefox') ? "action" : "browser_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")});
}
});
});
@@ -43,19 +43,21 @@ 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\/.*/)) {
+ // 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:\/\/microsoftedge\.microsoft\.com\/.*/)) {
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/build.sh b/build.sh
index a3c1dac..df15f31 100755
--- a/build.sh
+++ b/build.sh
@@ -81,6 +81,12 @@ if [ -z "$VERSION" ]; then
help
fi
+# Check if zip is installed
+if ! command -v zip >/dev/null; 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"
diff --git a/docs/help.css b/docs/help.css
index 2250f43..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;
@@ -149,11 +150,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 {
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 @@
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..5f546be 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,16 +2,21 @@
"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": [
- "tabs",
"activeTab",
"background",
"storage",
"contextMenus",
+ "scripting"
+ ],
+ "host_permissions": [
"
-
-
+