Showing preview only (421K chars total). Download the full file or copy to clipboard to get everything.
Repository: brandon1024/find
Branch: master
Commit: 288053bdfb26
Files: 43
Total size: 402.1 KB
Directory structure:
gitextract_xf1_b131/
├── .github/
│ ├── ISSUE_TEMPLATE.md
│ └── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── PRIVACY.md
├── README.md
├── _locales/
│ ├── en/
│ │ └── messages.json
│ └── zh/
│ └── messages.json
├── app.js
├── background/
│ ├── background.js
│ ├── browser-action-proxy.js
│ ├── content-proxy.js
│ ├── omni.js
│ └── service_worker.js
├── build.sh
├── content/
│ ├── content.js
│ ├── highlighter.js
│ └── parser.js
├── docs/
│ ├── _config.yml
│ ├── help.css
│ └── index.html
├── lib/
│ └── html-entity-handler/
│ └── entityhandler.js
├── manifest.json
├── manifest_firefox.json
└── popup/
├── css/
│ ├── extension.css
│ ├── messagepane.css
│ ├── optionspane.css
│ ├── replacepane.css
│ ├── savedexpressionspane.css
│ └── searchpane.css
├── js/
│ ├── background-proxy.js
│ ├── browser-action.js
│ ├── history.js
│ ├── i18n.js
│ ├── message-pane.js
│ ├── options-pane.js
│ ├── replace-pane.js
│ ├── saved-expressions-pane.js
│ ├── search-pane.js
│ └── storage.js
└── popup.html
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/ISSUE_TEMPLATE.md
================================================
## Issue Description
## Steps to Reproduce
- .
- .
- .
## Tasks
- [ ] t1
- [ ] t2
- [ ] t3
## Screenshots and Documentation
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
## Fixes #
### Changes Proposed in this Pull Request:
- .
- .
- .
### Additional Comments and Documentation:
================================================
FILE: .gitignore
================================================
/.idea/
.build/
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# 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/
================================================
FILE: CONTRIBUTING.md
================================================
# 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.
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
================================================
FILE: PRIVACY.md
================================================
# 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+ 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.
================================================
FILE: README.md
================================================
<img src="resources/icon.png" align="right" width="128" />
# **{find+}**
[](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
- copy occurrences of a regular expression to your clipboard
- 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.
<img src=".github/chrome-icon.png" width="16"/> Download the extension here: [find+ | Regex Find-in-Page Tool](https://chrome.google.com/webstore/detail/find%2B/fddffkdncgkkdjobemgbpojjeffmmofb).
<img src=".github/firefox-icon.png" width="16"/> 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 <kbd>CTRL</kbd>+<kbd>⇧</kbd>+<kbd>F</kbd> 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 <kbd>CTRL</kbd>+<kbd>⇧</kbd>+<kbd>F</kbd>, 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.
| Windows Shortcut | macOS Shortcut | Action |
| :------------------------------------------------- | :------------------------------------------------- | :--------------------------------------------------------------------- |
| <kbd>↵</kbd> | <kbd>↵</kbd> | Advance to the next occurrence of the regular expression in the page |
| <kbd>⇧</kbd>+<kbd>↵</kbd> | <kbd>⇧</kbd>+<kbd>↵</kbd> | Return to the previous occurrence of the regular expression in the page|
| <kbd>CTRL</kbd>+<kbd>⇧</kbd>+<kbd>↵</kbd> | <kbd>^</kbd>+<kbd>⇧</kbd>+<kbd>↵</kbd> | Follow the first highlighted link in the current occurrence focus |
| <kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>C</kbd> | <kbd>^</kbd>+<kbd>⌥</kbd>+<kbd>C</kbd> | Copy to the clipboard the currently highlighted text on the page. |
| <kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>A</kbd> | <kbd>^</kbd>+<kbd>⌥</kbd>+<kbd>A</kbd> | Copy to the clipboard the all highlighted text on the page. |
| <kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>O</kbd> | <kbd>^</kbd>+<kbd>⌥</kbd>+<kbd>O</kbd> | Expand or Collapse Options Pane |
| <kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>R</kbd> | <kbd>^</kbd>+<kbd>⌥</kbd>+<kbd>R</kbd> | Expand or Collapse Replace Text Pane |
| <kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>H</kbd> | <kbd>^</kbd>+<kbd>⌥</kbd>+<kbd>H</kbd> | Expand or Collapse Saved Expressions Pane |
| <kbd>CTRL</kbd>+<kbd>↵</kbd> or <kbd>ESC</kbd> | <kbd>^</kbd>+<kbd>↵</kbd> or <kbd>ESC</kbd> | 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
`findplus` in your browser's address bar, press <kbd>␣</kbd> or <kbd>⇥</kbd>,
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.
<img src=".github/omni.png"/>
## Contributing
We can use your help! Our [CONTRIBUTING](CONTRIBUTING.md) doc should help get
you started.
## Contributors
[<img src="https://avatars3.githubusercontent.com/u/22732449?v=3&s=460" width="64" style="border-radius:50%">](https://github.com/brandon1024) [<img src="https://avatars3.githubusercontent.com/u/25009878?s=460&u=ba1d4eb8abb2ad96c514aeb911adf1b34949e32f&v=4" width="64" style="border-radius:50%">](https://github.com/MichaelWalz) [<img src="https://avatars3.githubusercontent.com/u/184316?s=460&u=beed843205b1fd652277562e715f517d3082b4be&v=4" width="64" style="border-radius:50%">](https://github.com/muescha) [<img src="https://avatars3.githubusercontent.com/u/7383028?s=460&v=4" width="64" style="border-radius:50%">](https://github.com/amit-gshe) [<img src="https://avatars2.githubusercontent.com/u/8235338?s=460&v=4" width="64" style="border-radius:50%">](https://github.com/ReporterX) [<img src="https://avatars.githubusercontent.com/u/29089388?v=4" width="64" style="border-radius:50%">](https://github.com/pzhlkj6612)
## License
This project is licensed under the [GPLv3 License](https://www.gnu.org/licenses/gpl-3.0.en.html).
================================================
FILE: _locales/en/messages.json
================================================
{
"extension_name": {
"message": "find+ | Regex Find-in-Page Tool",
"description": "The extension name in the manifest file."
},
"extension_description": {
"message": "A find-in-page extension with support for regular expressions.",
"description": "Short description of the extension in the manifest file."
},
"search_field_title": {
"message": "Search Field",
"description": "Tooltip text for the search field."
},
"malformed_regex_error_title": {
"message": "Malformed Regex:\nThe regular expression entered is not acceptable, as it is either an invalid regular expression, or not supported according to the Javascript RegExp specification",
"description": "Tooltip text for the invalid regex icon."
},
"clipboard_copy_error_title": {
"message": "Unable to copy to the clipboard due to unexpected error.",
"description": "Tooltip text for the clipboard copy error icon."
},
"iframes_found_warning_title": {
"message": "One or more iframes were encountered in the page. As a result, some occurrences of your search query may not be highlighted in the page.",
"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": "Welcome and thanks for installing our extension! Here are some tips to get you started:\n\tENTER : Advance to the next occurrence of the regular expression in the page\n\tSHIFT-ENTER : Return to the previous occurrence of the regular expression in the page\n\tCTRL-ALT-O : Expand or Collapse Options Pane\n\tCTRL-ALT-R : Expand or Collapse Replace Text Pane\n\tCTRL-ENTER or ESC : Close the extension popup",
"description": "Tooltip text for the install information icon."
},
"update_information_title": {
"message": "We just updated the extension! Now it works better than ever :)\nCheck out our GitHub page for information about this update!",
"description": "Tooltip text for the update information icon."
},
"search_prev_title": {
"message": "Previous",
"description": "Tooltip text for the seek backwards button."
},
"search_next_title": {
"message": "Next",
"description": "Tooltip text for the seek forwards button."
},
"toggle_options_pane_title": {
"message": "Toggle Options Pane",
"description": "Tooltip text for the toggle options pane button."
},
"toggle_saved_expressions_button": {
"message": "Show Saved Expressions",
"description": "Tooltip text for the show saved expressions button."
},
"copy_to_clipboard_button_title": {
"message": "Copy All Occurrences To Clipboard",
"description": "Tooltip text for the copy to clipboard button."
},
"toggle_find_replace_button_title": {
"message": "Find and Replace",
"description": "Tooltip text for the find and replace toggle button."
},
"close_extension_title": {
"message": "Close find+",
"description": "Tooltip text for the close extension button."
},
"replace_field_title": {
"message": "Replace Field",
"description": "Tooltip text for the replace field."
},
"replace_button_title": {
"message": "Replace Next",
"description": "Tooltip text for the replace next button."
},
"replace_all_button_title": {
"message": "Replace All",
"description": "Tooltip text for the replace all button."
},
"search_option_find_by_regex_title": {
"message": "If enabled, text entered in the search field will be treated as a regular expression.\nIf disabled, the text is treated as string literal.",
"description": "Tooltip text for the find by regex option description icon."
},
"search_option_match_case_title": {
"message": "If enabled, the case of characters must match that of the query string.\nIf disabled, the case of characters in the query string are not considered.",
"description": "Tooltip text for the match case option description icon."
},
"search_option_persistent_highlights_title": {
"message": "If enabled, highlights in the web page will remain after the extension closes.\nRemove the highlights by reloading the page or reopening the extension.",
"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.\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": {
"message": "If enabled, the button used to toggle the option pane will be hidden.\nThe keyboard shortcuts may still be used to display or hide the pane.",
"description": "Tooltip text for the hide option pane toggle button option description icon."
},
"extension_option_hide_saved_expressions_pane_toggle_button_title": {
"message": "If enabled, the button used to toggle the saved expressions pane will be hidden.\nThe keyboard shortcuts may still be used to display or hide the pane.",
"description": "Tooltip text for the hide saved expressions pane toggle button option description icon."
},
"extension_option_hide_copy_to_clipboard_toggle_button_title": {
"message": "If enabled, the button used to copy all occurrences to clipboard will be hidden.\nThe keyboard shortcuts may still be used to copy all occurrences to clipboard.",
"description": "Tooltip text for the copy all occurrences to clipboard button option description icon."
},
"extension_option_hide_find_replace_toggle_button_title": {
"message": "If enabled, the button used to toggle the Find and Replace pane will be hidden.\nThe keyboard shortcuts may still be used to display or hide the pane.",
"description": "Tooltip text for the hide find and replace pane toggle button option description icon."
},
"saved_expression_icon_title": {
"message": "Load this expression",
"description": "Tooltip text for a saved expression entry icon."
},
"delete_saved_expression_icon_title": {
"message": "Delete this expression",
"description": "Tooltip text for a delete saved expression entry icon."
},
"clear_expressions_button_title": {
"message": "Clear All Saved Expressions",
"description": "Tooltip text for the clear saved expressions button."
},
"save_expression_button_title": {
"message": "Save Expression in Search Field",
"description": "Tooltip text for the save expression button."
},
"replace_field_placeholder": {
"message": "Replace with..",
"description": "Placeholder text for the replace field."
},
"replace_button_text": {
"message": "Replace",
"description": "Text displayed inside the replace button."
},
"replace_all_button_text": {
"message": "Replace All",
"description": "Text displayed inside the replace all button."
},
"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' 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": {
"message": "Expression Options",
"description": "Header text displayed in the options pane."
},
"extension_options_header_text": {
"message": "Extension Options",
"description": "Header text displayed in the options pane."
},
"saved_expressions_body_header": {
"message": "Saved Expressions",
"description": "Header text displayed in the saved expressions pane."
},
"search_option_find_by_regex_text": {
"message": "Find by Regular Expression",
"description": "Text displayed beside the find by regex option."
},
"search_option_match_case_text": {
"message": "Match Case",
"description": "Text displayed beside the match case option."
},
"search_option_persistent_highlights_text": {
"message": "Persistent Highlights",
"description": "Text displayed beside the persistent highlights option."
},
"extension_option_persistent_storage_incognito_text": {
"message": "Persistent Storage (Incognito)",
"description": "Text displayed beside the persistent storage option."
},
"extension_option_hide_option_pane_toggle_button_text": {
"message": "Hide Option Pane Toggle Button",
"description": "Text displayed beside the hide option pane toggle button option."
},
"extension_option_hide_saved_expressions_pane_toggle_button_text": {
"message": "Hide Saved Expressions Pane Toggle Button",
"description": "Text displayed beside the hide saved expressions pane toggle button option."
},
"extension_option_hide_copy_to_clipboard_toggle_button_text": {
"message": "Hide Copy To Clipboard Button",
"description": "Text displayed beside the hide copy to clipboard toggle button option."
},
"extension_option_hide_find_replace_toggle_button_text": {
"message": "Hide Find and Replace Pane Toggle Button",
"description": "Text displayed beside the hide find and replace toggle button option."
},
"search_option_max_results_text": {
"message": "Max Highlighted Results",
"description": "Text displayed above the max highlighted results option."
},
"search_option_index_highlight_text": {
"message": "Selected Occurrence Highlight Color",
"description": "Text displayed above the index highlight color option."
},
"search_option_all_highlight_text": {
"message": "Highlight Color",
"description": "Text displayed above the all highlight color option."
},
"reset_options_button_text": {
"message": "Reset All Options",
"description": "Text displayed in the reset options button."
},
"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."
}
}
================================================
FILE: _locales/zh/messages.json
================================================
{
"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."
}
}
================================================
FILE: app.js
================================================
'use strict';
/**
* Micro-framework specifically built for the find+ browser extension.
*
* This design was inspired from Stoyan Stefanov's nested namespace pattern outlined in
* his book JavaScript Patterns.
* */
const Find = (function () {
const self = {};
self.browserId = (() => {
return typeof browser !== 'undefined' ? 'Firefox' : 'Chrome';
})();
self.browser = (() => {
return typeof chrome === 'undefined' ? browser : chrome;
})();
self.incognito = (() => {
return self.browser.extension.inIncognitoContext;
})();
/**
* Register a new namespace, and initialize it using a callback function.
*
* The callback function is invoked with the new namespace as an argument. This argument
* must be used in the callback to initialize the namespace.
*
* Once the namespace is initialized using the callback function, if the namespace contains
* an init() function, it will be invoked once the DOM is ready. This avoids the need to use
* window.onload or attach window load event listeners manually. As such, the init function may be used
* to safely register all DOM component listeners and start or initialize the application.
*
* Intermediate namespaces are created if necessary. For example, the namespace 'Popup.Storage.'
* would allow you to reference this namespace through Find.Popup.Storage.
*
* @param {string} path - The namespace path.
* @param {registerCallback} callback - A function that initializes the namespace.
* @return the namespace
* */
self.register = function(path, callback) {
let pathKeys = path.split('.');
let parent = self;
for(let keyIndex = 0; keyIndex < pathKeys.length; keyIndex++) {
let key = pathKeys[keyIndex];
if(typeof parent[key] === 'undefined') {
parent[key] = {};
}
parent = parent[key];
}
callback(parent);
if(parent && isFunction(parent.init)) {
if(document.readyState === 'complete') {
parent.init();
} else {
window.addEventListener('load', () => {
parent.init();
}, { once: true });
}
}
return parent;
};
/**
* Retrieve a given namespace using a string path.
*
* @param {string} path - The namespace path.
* @return the namespace.
* */
self.getContext = function(path) {
let pathKeys = path.split('.');
let parent = self;
for(let keyIndex = 0; keyIndex < pathKeys.length; keyIndex++) {
let key = pathKeys[keyIndex];
if(typeof parent[key] === 'undefined') {
return undefined;
}
parent = parent[key];
}
return parent;
};
/**
* Determine if a given object is an invokable function.
*
* @private
* @param {object} obj - The object in question
* @return boolean true if the object is a function, false otherwise
* */
function isFunction(obj) {
return !!(obj && obj.constructor && obj.call && obj.apply);
}
return self;
})();
================================================
FILE: background/background.js
================================================
"use strict";
/**
* Create the Background namespace. The background coordinates activities between the browser
* action popup and the content in the web page. The background keeps track of the state of the
* search, along with other necessary data to seek, replace, and perform other actions efficiently.
* */
Find.register("Background", function(self) {
/**
* Allocated on the namespace to allow the BrowserActionProxy to communicate installation
* details to the browser action popup if the extension was recently installed or updated.
* */
self.installationDetails = null;
self.options = null;
let documentRepresentation = null;
let regexOccurrenceMap = null;
let index = null;
Find.browser.contextMenus.removeAll(() => {
Find.browser.contextMenus.create({
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.runtime.getURL("docs/index.html")});
}
});
});
/**
* Inject content scripts into pages once installed (not performed automatically in Chrome).
*/
Find.browser.runtime.onInstalled.addListener((installation) => {
self.installationDetails = installation;
if(Find.browserId !== 'Firefox') {
let scripts = Find.browser.runtime.getManifest().content_scripts[0].js;
Find.browser.tabs.query({}, (tabs) => {
for(let tabIndex = 0; tabIndex < tabs.length; tabIndex++) {
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:\/\/microsoftedge\.microsoft\.com\/.*/)) {
continue;
}
Find.Background.ContentProxy.executeScript(tabs[tabIndex], {files: scripts});
}
});
}
if(installation.reason === 'install') {
Find.browser.tabs.create({url: Find.browser.runtime.getURL("docs/index.html")});
}
});
/**
* Initialize the browser action. Fetches the web page to ensure that the content scripts
* have been properly injected. If the content script responds, the selected text is retrieved
* from the page and included in the response to the popup.
*
* If the content script still has state variables, such as the index and regex of the last search,
* this information is used to initialize the extension.
*
* @param {object} message - The message containing the details about the action.
* @param {object} tab - Information about the active tab in the current window.
* @param {function} sendResponse - Function used to issue a response back to the popup.
* */
self.initializeBrowserAction = function(message, tab, sendResponse) {
let resp = {};
resp.activeTab = tab;
Find.Background.ContentProxy.fetch(tab, (response) => {
resp.isReachable = response && response.success;
if(resp.isReachable) {
resp.selectedText = response.selection;
resp.regex = response.regex;
resp.iframes = response.iframes;
index = response.index || 0;
}
sendResponse({action: 'browser_action_init', response: resp});
});
};
/**
* Initialize the extension by constructing the page document representation.
*
* @param {object} tab - Information about the active tab in the current window.
* @param {function} callback - Optional callback .
* */
self.initializePage = function(tab, callback) {
Find.Background.ContentProxy.buildDocumentRepresentation(tab, (model) => {
documentRepresentation = model;
if (callback) {
callback();
}
});
};
/**
* Remove any highlights and markup from the active tab in the current window. Also resets
* any state variables, such as the current index, document representation and occurrence map.
*
* @param {object} tab - Information about the active tab in the current window.
* @param {boolean} [restoreHighlights] - If undefined or true, remove highlights. If false,
* highlights are not removed, and are persisted in the page.
* */
self.restorePageState = function(tab, restoreHighlights) {
if(restoreHighlights === undefined || restoreHighlights) {
Find.Background.ContentProxy.clearPageHighlights(tab);
}
let uuids = getUUIDsFromModelObject(documentRepresentation);
Find.Background.ContentProxy.restoreWebPage(tab, uuids);
documentRepresentation = null;
regexOccurrenceMap = null;
index = null;
};
/**
* Update the search when the search query or search options change. Builds a new occurrence map from the
* documentRepresentation object, highlight the occurrence in the page, and send the indices
* to the browser action popup through the sendResponse function.
*
* If the background has not been initialized properly (documentRepresentation is null), simply returns.
*
* If the regex is invalid, removes all highlights from the page and sends appropriate response
* to the popup.
*
* @param {object} message - The message containing the details about the search, including the search
* options and search query.
* @param {object} tab - Information about the active tab in the current window.
* @param {function} sendResponse - Function used to issue a response back to the popup.
* */
self.updateSearch = function(message, tab, sendResponse) {
try {
if(!documentRepresentation) {
self.initializePage(tab, () => {
self.updateSearch(message, tab, sendResponse);
});
return;
}
self.options = message.options;
let regex = message.regex;
//If searching by string, escape all regex metacharacters
if(!self.options.find_by_regex) {
regex = regex.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
}
//Ensure non-empty search
if(regex.length === 0) {
sendResponse({action: 'empty_regex'});
Find.Background.ContentProxy.clearPageHighlights(tab);
return;
}
//Build occurrence map, reposition index if necessary
regexOccurrenceMap = buildOccurrenceMap(documentRepresentation, regex, self.options);
if(index > regexOccurrenceMap.length-1) {
if(regexOccurrenceMap.length !== 0) {
index = regexOccurrenceMap.length - 1;
} else {
index = 0;
}
}
if(self.options.max_results !== 0 && index >= self.options.max_results) {
index = self.options.max_results - 1;
}
//Invoke update action
Find.Background.ContentProxy.updatePageHighlights(tab, regex, index, regexOccurrenceMap, self.options);
//If occurrence map empty, viewable index is zero
let viewableIndex = index + 1;
if(regexOccurrenceMap.length === 0) {
viewableIndex = 0;
}
//if occurrence map larger than max results, viewable total is max results
let viewableTotal = regexOccurrenceMap.length;
if(self.options.max_results !== 0 && self.options.max_results <= regexOccurrenceMap.length) {
viewableTotal = self.options.max_results;
}
sendResponse({
action: 'index_update',
index: viewableIndex,
total: viewableTotal
});
} catch(e) {
sendResponse({action: 'invalid_regex', error: e.message});
Find.Background.ContentProxy.clearPageHighlights(tab);
}
};
/**
* Move forward or backward the current search index, and respond to the popup
* the new search index.
*
* @param {object} message - The message containing the details about the search options.
* @param {boolean} seekForward - Specifies whether to seek forward or backward.
* @param {object} tab - Information about the active tab in the current window.
* @param {function} sendResponse - Function used to issue a response back to the popup.
* */
self.seekSearch = function(message, seekForward, tab, sendResponse) {
self.options= message.options;
let indexCap = self.options.max_results !== 0;
//If reached end, reset index
if(seekForward) {
index = computeSubsequentIndex(index, regexOccurrenceMap, self.options);
} else {
index = computePrecedingIndex(index, regexOccurrenceMap, self.options);
}
//Invoke seek action
Find.Background.ContentProxy.seekHighlight(tab, index, self.options);
let viewableIndex = regexOccurrenceMap.length === 0 ? 0 : index+1;
let viewableTotal = (indexCap && self.options.max_results <= regexOccurrenceMap.length) ?
self.options.max_results : regexOccurrenceMap.length;
sendResponse({
action: 'index_update',
index: viewableIndex,
total: viewableTotal
});
};
/**
* Replace the occurrence of the search query with a given replacement string, and invalidate the search
* state.
*
* @param {object} message - The message containing the details about the action, including the index to
* replace, the replacement string, and the search options.
* @param {object} tab - Information about the active tab in the current window.
* @param {function} sendResponse - Function used to issue a response back to the popup.
* */
self.replaceNext = function(message, tab, sendResponse) {
Find.Background.ContentProxy.replaceOccurrence(tab, message.index - 1, message.replaceWith, message.options);
//Restore Web Page
Find.Background.ContentProxy.clearPageHighlights(tab);
let uuids = getUUIDsFromModelObject(documentRepresentation);
Find.Background.ContentProxy.restoreWebPage(tab, uuids, () => {
//Rebuild documentRepresentation and invalidate
Find.Background.ContentProxy.buildDocumentRepresentation(tab, (model) => {
documentRepresentation = model;
sendResponse({action: 'invalidate'});
});
});
};
/**
* Replace all occurrences of the search query with a given replacement string, and invalidate the search
* state.
*
* @param {object} message - The message containing the details about the action, the replacement string,
* and the search options.
* @param {object} tab - Information about the active tab in the current window.
* @param {function} sendResponse - Function used to issue a response back to the popup.
* */
self.replaceAll = function(message, tab, sendResponse) {
Find.Background.ContentProxy.replaceAllOccurrences(tab, message.replaceWith, message.options);
//Restore Web Page
Find.Background.ContentProxy.clearPageHighlights(tab);
let uuids = getUUIDsFromModelObject(documentRepresentation);
Find.Background.ContentProxy.restoreWebPage(tab, uuids, () => {
//Rebuild documentRepresentation and invalidate
Find.Background.ContentProxy.buildDocumentRepresentation(tab, (model) => {
documentRepresentation = model;
sendResponse({action: 'invalidate'});
});
});
};
/**
* Follow the link at the current occurrence index in the page.
*
* @param {object} message - The message containing the details about the action.
* @param {object} tab - Information about the active tab in the current window.
* @param {function} sendResponse - Function used to issue a response back to the popup.
* */
self.followLinkUnderFocus = function(message, tab, sendResponse) {
Find.Background.ContentProxy.followLinkUnderFocus(tab);
sendResponse({action: 'close'});
};
/**
* Extract from the regex occurrence map the current or all occurrences of the search query
* and respond to the popup. Used to allow the occurrences to be copied to the clipboard.
*
* If the cardinality is 'all', a line feed separated string of occurrences is returned.
* Otherwise, only the current occurrence is returned.
*
* @param {object} message - The message containing the details about the action.
* @param {object} tab - Information about the active tab in the current window.
* @param {function} sendResponse - Function used to issue a response back to the popup.
* */
self.extractOccurrences = function(message, tab, sendResponse) {
let cardinality = message.options.cardinality;
let resp;
if(cardinality === 'all') {
let occurrences = [];
for(let occIndex = 0; occIndex < regexOccurrenceMap.length; occIndex++) {
occurrences.push(regexOccurrenceMap.occurrenceIndexMap[occIndex].occurrence);
}
resp = occurrences.join('\n');
} else {
resp = regexOccurrenceMap.occurrenceIndexMap[index].occurrence;
}
sendResponse({action: 'get_occurrence', response: resp});
};
/**
* Construct an occurrence map object from a document representation and regular expression.
* The occurrence map is used to map occurrences of a given regex to nodes in the DOM.
*
* The occurrence map will have the following format:
* {
* occurrenceIndexMap: {
* 1: {
* groupIndex: _index to the parent group of this occurrence_,
* subIndex: _the occurrence subindex of the parent group_,
* occurrence: _the matched text_
* }, ...
* },
* length: _number of occurrences of the regex_,
* groups: _number of occurrence groups_,
* 1: {
* uuids: [...],
* count: _number of matches in this group_,
* preformated: _whether or not the text node in the DOM is preformatted_
* }, ...
* }
*
* @private
* @param {object} documentRepresentation - The representation of the page's DOM
* @param {string} regex - A regular expression
* @param {object} options - Options used to alter the creation of the occurrence map.
* @return {object} occurrence map
* */
function buildOccurrenceMap(documentRepresentation, regex, options) {
let occurrenceMap = {occurrenceIndexMap: {}, length: null, groups: null};
let count = 0;
let groupIndex = 0;
regex = regex.replace(/ /g, '\\s');
regex = (options.match_case) ? new RegExp(regex, 'gm') : new RegExp(regex, 'gmi');
//Loop over all text nodes in documentRepresentation
for(let key in documentRepresentation) {
let textNodes = documentRepresentation[key].group, preformatted = documentRepresentation[key].preformatted;
let textGroup = '';
let uuids = [];
for(let nodeIndex = 0; nodeIndex < textNodes.length; nodeIndex++) {
textGroup += textNodes[nodeIndex].text;
uuids.push(textNodes[nodeIndex].elementUUID);
}
let matches = textGroup.match(regex);
if(!matches) {
continue;
}
count += matches.length;
occurrenceMap[groupIndex] = {
uuids: uuids,
count: matches.length,
preformatted: preformatted
};
for(let matchesIndex = 0; matchesIndex < matches.length; matchesIndex++) {
let occMapIndex = matchesIndex + (count - matches.length);
occurrenceMap.occurrenceIndexMap[occMapIndex] = {groupIndex: groupIndex, subIndex: matchesIndex, occurrence: matches[matchesIndex]};
}
groupIndex++;
//If reached maxIndex, exit
if(options.max_results !== 0 && count >= options.max_results) {
break;
}
}
occurrenceMap.length = count;
occurrenceMap.groups = groupIndex;
return occurrenceMap;
}
/**
* Increment the given index, wrapping back to zero if reached end of occurrence map or index cap.
*
* @private
* @param {number} index - The current index
* @param {object} regexOccurrenceMap - The occurrence map object
* @param {object} options - The search options
* @return {number} the new index
* */
function computeSubsequentIndex(index, regexOccurrenceMap, options) {
//If reached end, reset index
let indexCap = self.options.max_results !== 0;
if(index >= regexOccurrenceMap.length-1 || (indexCap && index >= options.max_results-1)) {
return 0;
}
return index + 1;
}
/**
* Decrement the given index, wrapping back to the end if reached zero.
*
* @private
* @param {number} index - The current index
* @param {object} regexOccurrenceMap - The occurrence map object
* @param {object} options - The search options
* @return {number} the new index
* */
function computePrecedingIndex(index, regexOccurrenceMap, options) {
//If reached start, set index to last occurrence
let indexCap = self.options.max_results !== 0;
if(index <= 0) {
if(indexCap && options.max_results <= regexOccurrenceMap.length) {
return options.max_results - 1;
}
return regexOccurrenceMap.length - 1;
} else {
return index - 1;
}
}
/**
* Extract UUIDs from the document representation object.
*
* @private
* @param {object} documentRepresentation - The document representation object
* @return {array} a list of UUIDs
* */
function getUUIDsFromModelObject(documentRepresentation) {
let uuids = [];
for(let key in documentRepresentation) {
let textNodes = documentRepresentation[key].group;
for(let index = 0; index < textNodes.length; index++) {
uuids.push(textNodes[index].elementUUID);
}
}
return uuids;
}
});
================================================
FILE: background/browser-action-proxy.js
================================================
"use strict";
/**
* Create the Background ContentProxy namespace. Serves as mediator between the background scripts
* and the browser action popup.
* */
Find.register("Background.BrowserActionProxy", function() {
/**
* Initialize the port connection with the browser action popup.
* */
Find.browser.runtime.onConnect.addListener((browserActionPort) => {
if(browserActionPort.name !== 'popup_to_background_port') {
return;
}
if(Find.Background.installationDetails) {
browserActionPort.postMessage({action: 'install', details: Find.Background.installationDetails});
Find.Background.installationDetails = null;
}
let activeTab = null;
Find.browser.tabs.query({active: true, currentWindow: true}, (tabs) => {
activeTab = tabs[0];
// invoke action on message from popup script
browserActionPort.onMessage.addListener((message) => {
actionDispatch(message, activeTab, (resp) => {
browserActionPort.postMessage(resp);
});
});
// handle extension close
browserActionPort.onDisconnect.addListener(() => {
if(!Find.Background.options || !Find.Background.options.persistent_highlights) {
Find.Background.restorePageState(activeTab);
} else {
Find.Background.restorePageState(activeTab, false);
}
activeTab = null;
});
});
});
/**
* Dispatcher for calls for action by the browser action popup.
* Invokes the appropriate function in the Background based on the
* message.action field.
*
* @param {object} message - The message received from the popup
* @param {object} tab - Information about the active tab in the current window
* @param {function} sendResponse - Function used to issue a response back to the popup.
* */
function actionDispatch(message, tab, sendResponse) {
let action = message.action;
switch(action) {
case 'update':
Find.Background.updateSearch(message, tab, sendResponse);
break;
case 'next':
Find.Background.seekSearch(message, true, tab, sendResponse);
break;
case 'previous':
Find.Background.seekSearch(message, false, tab, sendResponse);
break;
case 'replace_next':
Find.Background.replaceNext(message, tab, sendResponse);
break;
case 'replace_all':
Find.Background.replaceAll(message, tab, sendResponse);
break;
case 'follow_link':
Find.Background.followLinkUnderFocus(message, tab, sendResponse);
break;
case 'browser_action_init':
Find.Background.initializeBrowserAction(message, tab, sendResponse);
break;
case 'get_occurrence':
Find.Background.extractOccurrences(message, tab, sendResponse);
break;
}
}
});
================================================
FILE: background/content-proxy.js
================================================
"use strict";
/**
* Create the Background ContentProxy namespace. Serves as mediator between the content
* in the web page and the background scripts.
* */
Find.register("Background.ContentProxy", function(self) {
/**
* Request from a given page a representation of the text nodes in the page's document.
*
* @param {object} tab - The tab to which the request will be made.
* @param {function} callback - The callback function that will utilize the document object model.
* @param {function} [error] - Callback function for handing an error.
* */
self.buildDocumentRepresentation = function(tab, callback, error) {
Find.browser.tabs.sendMessage(tab.id, {action: 'init'}, (response) => {
if(response && response.model) {
callback(response.model);
} else if(error) {
error();
}
});
};
/**
* Restore the page by removing reference markup to next nodes in the page. Highlight marking will not be removed.
*
* @param {object} tab - The tab from which all markup will be removed.
* @param {array} nodeReferences - Array of node reference UUIDs.
* @param {function} [callback] - Callback invoked when the page is restored.
* */
self.restoreWebPage = function(tab, nodeReferences, callback) {
Find.browser.tabs.sendMessage(tab.id, {
action: 'restore',
uuids: nodeReferences
}, callback);
};
/**
* Update the highlights in the page once the search query or options change.
*
* @param {object} tab - The tab that will be updated
* @param {string} regex - The regular expression or query
* @param {number} index - The index of the first occurrence
* @param {object} occurrenceMap - A special object that maps occurrences of the regex to individual text nodes.
* @param {object} options - The search options
* @param {function} [callback] - Callback invoked when the page highlights are updated.
* */
self.updatePageHighlights = function(tab, regex, index, occurrenceMap, options, callback) {
Find.browser.tabs.sendMessage(tab.id, {
action: 'update',
occurrenceMap: occurrenceMap,
index: index,
regex: regex,
options: options
}, callback);
};
/**
* Seek the search forward or backward.
*
* @param {object} tab - The tab that will be updated
* @param {number} index - The index of the occurrence to seek to
* @param {object} options - The search options
* @param {function} [callback] - Callback invoked when complete.
* */
self.seekHighlight = function(tab, index, options, callback) {
Find.browser.tabs.sendMessage(tab.id, {
action: 'seek',
index: index,
options: options
}, callback);
};
/**
* Remove all highlights from the page.
*
* @param {object} tab - The tab from which to remove all highlights
* @param {function} [callback] - Callback invoked when the highlights are removed from the page.
* */
self.clearPageHighlights = function(tab, callback) {
Find.browser.tabs.sendMessage(tab.id, {action: 'highlight_restore'}, callback);
};
/**
* Replace a single occurrence of the regular expression with a given piece of text in the page.
*
* @param {object} tab - The tab that will be updated
* @param {number} index - The specific index of the occurrence that will be replaced
* @param {string} replaceWith - The text that will replace the occurrence of the regex
* @param {object} options - The search options
* @param {function} [callback] - Callback invoked when the occurrence is replaced.
* */
self.replaceOccurrence = function(tab, index, replaceWith, options, callback) {
Find.browser.tabs.sendMessage(tab.id, {
action: 'replace',
index: index,
replaceWith: replaceWith,
options: options
}, callback);
};
/**
* Replace all occurrences of the regular expression with a given piece of text in the page.
*
* @param {object} tab - The tab that will be updated
* @param {string} replaceWith - The text that will replace each occurrence of the regex
* @param {object} options - The search options
* @param {function} [callback] - Callback invoked when the occurrences are replaced.
* */
self.replaceAllOccurrences = function(tab, replaceWith, options, callback) {
Find.browser.tabs.sendMessage(tab.id, {
action: 'replace_all',
replaceWith: replaceWith,
options: options
}, callback);
};
/**
* Follow the link in the page at the current index.
*
* @param {object} tab - The tab with the search
* @param {function} [callback] - Callback invoked once the operation is complete.
* */
self.followLinkUnderFocus = function(tab, callback) {
Find.browser.tabs.sendMessage(tab.id, {action: 'follow_link'}, callback);
};
/**
* Send a fetch message to the given tab to ensure that it responds. A successful response
* indicates that the content scripts were loaded successfully.
*
* @param {object} tab - The tab to fetch.
* @param {function} callback - Callback invoked once the operation is complete.
* */
self.fetch = function(tab, callback) {
Find.browser.tabs.sendMessage(tab.id, {action: 'fetch'}, callback);
};
/**
* 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 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.scripting.executeScript({target: {tabId: tab.id}, ...details}, callback);
};
});
================================================
FILE: background/omni.js
================================================
"use strict";
/**
* Create the Background Omni namespace. Registers various event listeners which invoke
* the appropriate background functions.
* */
Find.register("Background.Omni", function(self) {
Find.browser.omnibox.onInputStarted.addListener(() => {
Find.browser.tabs.query({active: true, currentWindow: true}, (tabs) => {
Find.Background.initializePage(tabs[0]);
});
});
retrieveOptions((options) => {
Find.browser.omnibox.onInputChanged.addListener((regex) => {
Find.browser.tabs.query({active: true, currentWindow: true}, (tabs) => {
Find.Background.updateSearch({regex: regex, options: options}, tabs[0], (result) => {
let description;
if (!regex) {
description = 'Enter a regular expression';
} else if (result.action === 'index_update') {
description = `${result.total} matches found`;
} else if (result.action === 'invalid_regex') {
description = result.error;
}
Find.browser.omnibox.setDefaultSuggestion({description: description});
});
});
});
});
Find.browser.omnibox.onInputCancelled.addListener(() => {
Find.browser.tabs.query({active: true, currentWindow: true}, (tabs) => {
Find.Background.restorePageState(tabs[0]);
});
});
Find.browser.omnibox.onInputEntered.addListener(() => {
Find.browser.tabs.query({active: true, currentWindow: true}, (tabs) => {
Find.Background.restorePageState(tabs[0], false);
});
});
/**
* Default options. This object and all of it's properties are immutable.
* To use this object, it must be cloned into a mutable object.
*
* To clone this object:
* let mutableOptions = JSON.parse(JSON.stringify(DEFAULT_OPTIONS));
* */
const DEFAULT_OPTIONS = Object.freeze({
find_by_regex: true,
match_case: true,
persistent_highlights: false,
persistent_storage_incognito: false,
hide_options_button: false,
hide_saved_expressions_button: false,
hide_clipboard_button: true,
hide_find_replace_button: true,
max_results: 0,
index_highlight_color: Object.freeze({
hue: 34,
saturation: 0.925,
value: 1,
hexColor: '#ff9813'
}),
all_highlight_color: Object.freeze({
hue: 56,
saturation: 1,
value: 1,
hexColor: '#fff000'
})
});
/**
* Retrieve the search options from the browser local storage, and pass
* to the callback function. The data from the storage is passed as a single
* argument to the callback function.
*
* @param {function} callback - The callback function to handle the data.
* @return {object} The search options, or null if it does not exist or cannot be retrieved.
* */
function retrieveOptions(callback) {
Find.browser.storage.local.get('options', (data) => {
let options = data['options'];
if(!options) {
return callback(JSON.parse(JSON.stringify(DEFAULT_OPTIONS)));
}
callback(options);
});
}
});
================================================
FILE: background/service_worker.js
================================================
"use strict";
importScripts('../app.js');
importScripts('./browser-action-proxy.js');
importScripts('./content-proxy.js');
importScripts('./background.js');
importScripts('./omni.js');
================================================
FILE: build.sh
================================================
#!/usr/bin/env bash
ME=$0
ROOT_DIR=$PWD
BUILD_DIR="$ROOT_DIR/.build"
MANIFEST="$ROOT_DIR/manifest.json"
VERSION=
# Display Usage
function help() {
cat <<EOS
usage: ${ME} [options]
Build and package the find+ extension.
example:
${ME} -m find/manifest.json -v 1.4.4 -o find/buildpath
options:
-m, --manifest Alternate path of the manifest file 'manifest.json'.
-v, --version New extension version number
-o, --output Alternate build directory. Default '.build' in the current working directory
-h, --help Show help and exit
EOS
exit 2
}
function parseargs() {
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-m|--manifest)
case $2 in
/*) MANIFEST="$2" ;;
*) MANIFEST="$ROOT_DIR/$2" ;;
esac
shift
shift
;;
-v|--version)
VERSION=$2
shift
shift
;;
-o|--output)
case $2 in
/*) BUILD_DIR="$2" ;;
*) BUILD_DIR="$ROOT_DIR/$2" ;;
esac
shift
shift
;;
-h|--help)
help
;;
*)
echo "Error: Unknown option $key"
help
;;
esac
done
}
parseargs "$@"
# Check if manifest filename matches expected filename
if [[ ${MANIFEST} =~ "*/manifest.json" ]]; then
echo "Error: file '$MANIFEST' must have the filename 'manifest.json'"
exit 2
fi
# Check if manifest file exists
if [ ! -f ${MANIFEST} ]; then
echo "Error: manifest file '$MANIFEST' not found."
exit 2
fi
# Check if version number is set
if [ -z "$VERSION" ]; then
echo "Error: missing version number."
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"
mkdir --parents --verbose "$BUILD_DIR/chr"
mkdir --parents --verbose "$BUILD_DIR/moz"
# Copy project src to build directory
echo "$ME: Copying project source files to build directory..."
PROJECT_SRC_DIR=$(dirname "${MANIFEST}")
for file in "$PROJECT_SRC_DIR/"*
do
[[ $file = $BUILD_DIR ]] && continue
cp -r "$file" "$BUILD_DIR/chr"
cp -r "$file" "$BUILD_DIR/moz"
done
# Update manifest version numbers
echo "$ME: Updating version number in manifest to $VERSION..."
sed -i "s/\"version\": \"1\"/\"version\": \"$VERSION\"/" "$BUILD_DIR/chr/manifest.json"
sed -i "s/\"version\": \"1\"/\"version\": \"$VERSION\"/" "$BUILD_DIR/moz/manifest_firefox.json"
# Package extension for chrome
echo "$ME: Packaging extension for Chrome..."
rm -f "$BUILD_DIR/chr/manifest_firefox.json"
cd "$BUILD_DIR/chr"
zip -r "$BUILD_DIR/find-chrome.zip" .
cd "$ROOT_DIR"
# Package extension for firefox
echo "$ME: Packaging extension for Firefox..."
mv "$BUILD_DIR/moz/manifest_firefox.json" "$BUILD_DIR/moz/manifest.json"
cd "$BUILD_DIR/moz"
zip -r "$BUILD_DIR/find-firefox.zip" .
cd "$ROOT_DIR"
================================================
FILE: content/content.js
================================================
'use strict';
/**
* Create the Content namespace. This component is injected into the
* page and delegates messages to the parser or highlighter.
* */
Find.register('Content', function(self) {
/**
* State variables, used to recover the extension state if the extension
* is closed accidentally.
* */
let regex = null;
let index = null;
let selected = null;
/**
* Register a message listener to the extension background script.
* */
Find.browser.runtime.onMessage.addListener((message, sender, sendResponse) => {
switch (message.action) {
case 'init':
selected = window.getSelection().toString();
sendResponse({model: Find.Content.Parser.buildDOMReferenceObject()});
return true;
case 'fetch':
sendResponse({
success: true,
regex: regex,
index: index,
selection: selected,
iframes: document.getElementsByTagName('iframe').length
});
return true;
case 'restore':
selected = null;
Find.Content.Parser.restoreWebPage(message.uuids);
return false;
}
//Highlighter Actions
switch(message.action) {
case 'update':
regex = message.regex;
index = message.index;
Find.Content.Highlighter.restore();
Find.Content.Highlighter.highlightAll(message.occurrenceMap, message.regex, message.options);
Find.Content.Highlighter.seekHighlight(message.index, message.options);
break;
case 'seek':
index = message.index;
Find.Content.Highlighter.seekHighlight(message.index, message.options);
break;
case 'highlight_restore':
Find.Content.Highlighter.restore();
break;
case 'replace':
Find.Content.Highlighter.replace(message.index, message.replaceWith);
break;
case 'replace_all':
Find.Content.Highlighter.replaceAll(message.replaceWith);
break;
case 'follow_link':
Find.Content.Highlighter.followLinkUnderFocus();
break;
}
return false;
});
});
================================================
FILE: content/highlighter.js
================================================
'use strict';
/**
* Create the Content Highlighter namespace. This component is injected into
* the page and is used to highlight occurrences of a regex in the page.
* */
Find.register('Content.Highlighter', function(self) {
const indexHighlight = 'find-ext-index-highlight';
const allHighlight = 'find-ext-all-highlight';
/**
* Highlight all occurrences of a regex in the page, using an occurrence map and regex.
*
* @private
* @param {object} occurrenceMap - The occurrence map
* @param {string} regex - The regular expression
* @param {object} options - The search and highlight options
* */
self.highlightAll = function(occurrenceMap, regex, options) {
const tags = {
occIndex: null,
maxIndex: null,
openingMarkup: '',
closingMarkup: '',
update: function (index) {
if (this.occIndex !== index) {
this.occIndex = index;
//If reached max number of occurrences to show, don't highlight text
if (this.maxIndex == null || this.occIndex <= this.maxIndex) {
let style = 'all: unset; background-color: ' + options.all_highlight_color.hexColor + '; color: black;';
let classList = 'find-ext-occr' + index + ' ' + allHighlight;
this.openingMarkup = '<span style="' + style + '" class="' + classList + '">';
this.closingMarkup = '</span>';
} else {
this.openingMarkup = '';
this.closingMarkup = '';
}
}
}
};
if (options && options.max_results !== 0) {
tags.maxIndex = options.max_results - 1;
} else {
tags.maxIndex = null;
}
regex = regex.replace(/ /g, '\\s');
if (!options || options.match_case) {
regex = new RegExp(regex, 'm');
} else {
regex = new RegExp(regex, 'mi');
}
//Iterate each text group
let occIndex = 0;
for (let index = 0; index < occurrenceMap.groups; index++) {
let uuids = occurrenceMap[index].uuids;
let groupText = '';
let charMap = {};
let charIndexMap = [];
//Build groupText, charMap and charIndexMap
let count = 0;
for (let uuidIndex = 0; uuidIndex < uuids.length; uuidIndex++) {
let el = document.getElementById(uuids[uuidIndex]);
let text = el.childNodes[0].nodeValue;
if (!text) {
continue;
}
text = decode(text);
groupText += text;
for (let stringIndex = 0; stringIndex < text.length; stringIndex++) {
charIndexMap.push(count);
charMap[count++] = {
char: text.charAt(stringIndex),
nodeUUID: uuids[uuidIndex],
nodeIndex: stringIndex,
ignorable: false,
matched: false,
boundary: false
};
}
}
charMap.length = count;
//Format text nodes (whitespaces) whilst keeping references to their nodes in the DOM, updating charMap ignorable characters
if (!occurrenceMap[index].preformatted) {
let info;
//Replace all whitespace characters (\t \n\r) with the space character
while (info = /[\t\n\r]/.exec(groupText)) {
charMap[charIndexMap[info.index]].ignorable = true;
groupText = groupText.replace(/[\t\n\r]/, ' ');
}
//Truncate consecutive whitespaces
while (info = / {2,}/.exec(groupText)) {
let len = info[0].length;
let offset = info.index;
for (let currIndex = 0; currIndex < len; currIndex++) {
charMap[charIndexMap[offset + currIndex]].ignorable = true;
}
for (let currIndex = 0; currIndex < len - 1; currIndex++) {
charIndexMap.splice(offset, 1);
}
groupText = groupText.replace(/ {2,}/, ' ');
}
//Collapse leading or trailing whitespaces
while (info = /^ | $/.exec(groupText)) {
let len = info[0].length;
let offset = info.index;
for (let currIndex = 0; currIndex < len; currIndex++) {
charMap[charIndexMap[offset + currIndex]].ignorable = true;
}
for (let currIndex = 0; currIndex < len; currIndex++) {
charIndexMap.splice(offset, 1);
}
groupText = groupText.replace(/^ | $/, '');
}
}
//Perform complex regex search, updating charMap matched characters
let info;
while (info = regex.exec(groupText)) {
let len = info[0].length;
let offset = info.index;
if (len === 0) {
break;
}
let first = charIndexMap[offset];
let last = charIndexMap[offset + len - 1];
for (let currIndex = first; currIndex <= last; currIndex++) {
charMap[currIndex].matched = true;
if (currIndex === last) {
charMap[currIndex].boundary = true;
}
}
for (let currIndex = 0; currIndex < offset + len; currIndex++) {
charIndexMap.splice(0, 1);
}
groupText = groupText.substring(offset + len);
}
//Wrap matched characters in an element with class indexHighlight and occurrenceIdentifier
let matchGroup = {text: '', groupUUID: charMap[0].nodeUUID};
let inMatch = false;
for (let key = 0; key < charMap.length; key++) {
tags.update(occIndex);
//If Transitioning Into New Text Group
if (matchGroup.groupUUID !== charMap[key].nodeUUID) {
if (inMatch) {
matchGroup.text += tags.closingMarkup;
}
document.getElementById(matchGroup.groupUUID).innerHTML = matchGroup.text;
matchGroup.text = '';
matchGroup.groupUUID = charMap[key].nodeUUID;
if (inMatch) {
matchGroup.text += tags.openingMarkup;
}
}
//If Current Character is Matched
if (charMap[key].matched) {
if (!inMatch) {
inMatch = charMap[key].matched;
matchGroup.text += tags.openingMarkup;
}
} else {
if (inMatch) {
inMatch = charMap[key].matched;
matchGroup.text += tags.closingMarkup;
if (key < charMap.length) {
occIndex++;
}
}
}
matchGroup.text += encode(charMap[key].char);
if (charMap[key].boundary) {
inMatch = false;
matchGroup.text += tags.closingMarkup;
if (key < charMap.length) {
occIndex++;
}
}
//If End of Map Reached
if (key === charMap.length - 1) {
if (inMatch) {
matchGroup.text += tags.closingMarkup;
occIndex++;
}
document.getElementById(matchGroup.groupUUID).innerHTML = matchGroup.text;
}
}
}
};
/**
* Seek the search to the given index.
*
* @private
* @param {number} index - The index to seek to
* @param {object} options - The search options
* */
self.seekHighlight = function(index, options) {
if (index === null || options == null) {
return;
}
let previousIndex = Array.from(document.querySelectorAll('.' + indexHighlight));
if (previousIndex && previousIndex.length) {
for (let elsIndex = 0; elsIndex < previousIndex.length; elsIndex++) {
let style = 'all: unset; background-color: ' + options.all_highlight_color.hexColor + '; color: black;';
previousIndex[elsIndex].classList.remove(indexHighlight);
previousIndex[elsIndex].setAttribute("style", style);
}
}
let els = Array.from(document.querySelectorAll('.find-ext-occr' + index));
if (els == null || els.length === 0) {
return;
}
for (let elsIndex = 0; elsIndex < els.length; elsIndex++) {
let style = 'all: unset; background-color: ' + options.index_highlight_color.hexColor + '; color: black;';
els[elsIndex].classList.add(indexHighlight);
els[elsIndex].setAttribute("style", style);
}
// only scroll if the element is not in the current viewport
if (!isElementInViewport(els[0])) {
els[0].scrollIntoView(true);
let docHeight = Math.max(document.documentElement.clientHeight, document.documentElement.offsetHeight, document.documentElement.scrollHeight);
let bottomScrollPos = window.pageYOffset + window.innerHeight;
if (bottomScrollPos + 100 < docHeight) {
window.scrollBy(0, -100);
}
}
};
/**
* Replace a given occurrence of a regex with a given string.
*
* @private
* @param {number} index - The index of the occurrence that will be replaced
* @param {string} replaceWith - The text that will replace the given occurrence of the regex
* */
self.replace = function(index, replaceWith) {
let els = Array.from(document.querySelectorAll('.find-ext-occr' + index));
if (els.length === 0) {
return;
}
els.shift().innerText = replaceWith;
for (let elsIndex = 0; elsIndex < els.length; elsIndex++) {
els[elsIndex].innerText = '';
}
};
/**
* Replace all occurrences of a regex with a given string.
*
* @private
* @param {string} replaceWith - The text that will replace all occurrences of the regex
* */
self.replaceAll = function(replaceWith) {
let els = Array.from(document.querySelectorAll("[class*='find-ext-occr']"));
let currentOccurrence = null;
for (let index = 0; index < els.length; index++) {
let el = els[index];
let occrClassName = el.getAttribute('class').match(/find-ext-occr\d*/)[0];
let occurrenceFromClass = parseInt(occrClassName.replace('find-ext-occr', ''));
if (occurrenceFromClass !== currentOccurrence) {
currentOccurrence = occurrenceFromClass;
el.innerText = replaceWith
} else {
el.innerText = '';
}
}
};
/**
* Follow the link that is currently highlighted.
*
* @private
* */
self.followLinkUnderFocus = function() {
let els = document.getElementsByClassName(indexHighlight);
for (let index = 0; index < els.length; index++) {
let el = els[index];
while (el.parentElement) {
el = el.parentElement;
if (el.tagName.toLowerCase() === 'a') {
return el.click();
}
}
}
};
/**
* Restore the page by removing any highlighting markup.
*
* @private
* */
self.restore = function() {
let classes = [indexHighlight, allHighlight];
for (let classIndex = 0; classIndex < classes.length; classIndex++) {
let els = Array.from(document.querySelectorAll('.' + classes[classIndex]));
for (let elsIndex = 0; elsIndex < els.length; elsIndex++) {
let el = els[elsIndex];
let parent = el.parentElement;
while (el.firstChild) {
parent.insertBefore(el.firstChild, el);
}
parent.removeChild(el);
parent.normalize();
}
}
};
function isElementInViewport(element) {
let elementBoundingRect = element.getBoundingClientRect();
if (elementBoundingRect.top < 0 || elementBoundingRect.left < 0) {
return false;
}
if (elementBoundingRect.bottom > (window.innerHeight || document.documentElement.clientHeight)) {
return false;
}
if (elementBoundingRect.right > (window.innerWidth || document.documentElement.clientWidth)) {
return false;
}
return true;
}
});
================================================
FILE: content/parser.js
================================================
'use strict';
/**
* Create the Content Parser namespace. This component is injected into the
* page and constructs a representation of the DOM, which will be used for
* occurrence matching by the background script and highlighting by the
* highlighter.
*
* As the document representation object is constructed, text nodes in the page
* are wrapped in a span, and assigned a UUID which is used to reference it.
*
* Once the extension closes, the page is restored using the UUIDs from the
* document representation object.
* */
Find.register('Content.Parser', function(self) {
/**
* Walk the pages DOM tree and construct the document representation object, while
* wrapping text nodes with wrapper elements.
*
* @return {object} the document representation object
* */
self.buildDOMReferenceObject = function() {
let DOMTreeWalker = document.createTreeWalker(document.body, NodeFilter.SHOW_ALL, {acceptNode: nodeFilter}, false);
let DOMModelObject = {};
let reachedEndOfTree = false;
let groupIndex = 0;
let blockLevels = [];
let elementBoundary = false;
let preformatted = {flag: false, index: null};
let hidden = {flag: false, index: null};
let node = DOMTreeWalker.root;
while (!reachedEndOfTree) {
node = DOMTreeWalker.nextNode();
if (!node) {
reachedEndOfTree = true;
}
let textGroup = {group: [], preformatted: false};
while (node) {
let nodeDepth = getNodeTreeDepth(node);
if (!preformatted.flag && isPreformattedElement(node)) {
preformatted.flag = true;
preformatted.index = nodeDepth;
} else if (preformatted.flag && nodeDepth <= preformatted.index) {
preformatted.flag = false;
preformatted.index = null;
}
if (!hidden.flag && isHiddenElement(node)) {
hidden.flag = true;
hidden.index = nodeDepth;
} else if (hidden.flag && nodeDepth <= hidden.index) {
if (!isHiddenElement(node)) {
hidden.flag = false;
hidden.index = null;
} else {
hidden.index = nodeDepth;
}
}
if (hidden.flag) {
node = DOMTreeWalker.nextNode();
continue;
}
if (isElementNode(node)) {
if (nodeDepth <= blockLevels[blockLevels.length - 1]) {
while (nodeDepth <= blockLevels[blockLevels.length - 1]) {
blockLevels.pop();
}
if (!isInlineLevelElement(node)) {
blockLevels.push(nodeDepth);
}
elementBoundary = true;
break;
} else {
if (!isInlineLevelElement(node)) {
blockLevels.push(nodeDepth);
elementBoundary = true;
break;
}
}
} else if (isTextNode(node)) {
if (nodeDepth <= blockLevels[blockLevels.length - 1]) {
while (nodeDepth <= blockLevels[blockLevels.length - 1]) {
blockLevels.pop();
}
DOMTreeWalker.previousNode();
elementBoundary = true;
break;
}
if (!preformatted.flag && isNodeTextValueWhitespaceOnly(node) && node.nodeValue.length !== 1) {
node = DOMTreeWalker.nextNode();
continue;
} else if (node.nodeValue.length === 1 && node.nodeValue.charCodeAt(0) === 10) {
node = DOMTreeWalker.nextNode();
continue;
}
let identifierUUID = generateElementUUID();
let nodeText = formatTextNodeValue(node, preformatted.flag, elementBoundary);
if (nodeText.length === 0) {
node = DOMTreeWalker.nextNode();
continue;
}
let wrapperElement = document.createElement('span');
wrapperElement.style.cssText = 'all: unset;';
wrapperElement.setAttribute('id', identifierUUID);
node.parentNode.insertBefore(wrapperElement, node);
wrapperElement.appendChild(node);
let textNodeInformation = {groupIndex: groupIndex, text: nodeText, elementUUID: identifierUUID};
textGroup.group.push(textNodeInformation);
textGroup.preformatted = preformatted.flag;
}
node = DOMTreeWalker.nextNode();
elementBoundary = false;
if (!node) {
reachedEndOfTree = true;
}
}
if (textGroup.group.length === 0) {
continue;
}
DOMModelObject[groupIndex++] = textGroup;
}
return DOMModelObject;
};
/**
* Restore the web page by removing any wrapper elements.
*
* @param {array} uuids - A list of UUIDs
* */
self.restoreWebPage = function(uuids) {
for (let index = 0; index < uuids.length; index++) {
let el = document.getElementById(uuids[index]);
let parent = el.parentElement;
while (el.firstChild) {
parent.insertBefore(el.firstChild, el);
}
parent.removeChild(el);
parent.normalize();
}
};
/**
* Filter used by the DOM tree walker. Used to skip certain elements.
* @private
* @param {Element} node - The DOM node.
* @return {number} NodeFilter.FILTER_ACCEPT if the node is accepted, or NodeFilter.FILTER_REJECT
* if the node is rejected.
* */
function nodeFilter(node) {
if (isElementNode(node)) {
switch(node.tagName.toLowerCase()) {
case 'script':
case 'noscript':
case 'style':
case 'textarea':
case 'math':
return NodeFilter.FILTER_REJECT;
default:
return NodeFilter.FILTER_ACCEPT;
}
}
if (isTextNode(node)) {
return NodeFilter.FILTER_ACCEPT;
}
return NodeFilter.FILTER_REJECT;
}
/**
* Decode any HTML character entities, strip consecutive whitespaces,
* and return the node text value.
*
* @private
* @param {Node} node - The DOM node.
* @param {boolean} preformatted - Whether or not the node is a preformatted text element.
* @param {boolean} elementBoundary - Whether the element is a boundary element.
* @return {string} the formatted text.
* */
function formatTextNodeValue(node, preformatted, elementBoundary) {
if (isElementNode(node)) {
return;
}
let nodeText = decode(node.nodeValue);
if (preformatted) {
return nodeText;
}
let text = nodeText.replace(/[\t\n\r ]+/g, ' ');
if (elementBoundary) {
text = text.replace(/^[\t\n\r ]+/g, '');
}
return text;
}
/**
* Determine whether a given node is preformatted.
*
* A node is preformatted if it has:
* - tag name 'pre'
* - style 'whitespace: pre'
*
* @private
* @param {Element} node - The DOM node.
* @return {boolean} true of the element is a preformatted element, false if the
* element is not preformatted, and undefined if the node is not an element.
* */
function isPreformattedElement(node) {
if (!isElementNode(node)) {
return undefined;
}
if (node.tagName.toLowerCase() === 'pre' || node.style.whiteSpace.toLowerCase() === 'pre') {
return true;
}
let computedStyle = window.getComputedStyle(node);
if (computedStyle.getPropertyValue('whitespace').toLowerCase() === 'pre') {
return true;
}
return false;
}
/**
* Determine whether a given node is visible in the page.
*
* @private
* @param {Node} node - The DOM node.
* @return {boolean} true if the element is hidden, false if the element is visible,
* and undefined if the not an element.
* */
function isHiddenElement(node) {
if (!isElementNode(node)) {
return undefined;
}
if (node.style.display === 'none' || node.style.display === 'hidden') {
return true;
}
let computedStyle = window.getComputedStyle(node);
if (computedStyle.getPropertyValue('display').toLowerCase() === 'none') {
return true;
}
if (computedStyle.getPropertyValue('display').toLowerCase() === 'hidden') {
return true;
}
return false;
}
/**
* Determine whether or not a given DOM node is an Element.
*
* @private
* @param {Node} node - The DOM node.
* @return {boolean} true if the node is an element, false otherwise.
* */
function isElementNode(node) {
return node.nodeType === Node.ELEMENT_NODE;
}
/**
* Determine whether or not a given DOM node is a text node.
*
* @private
* @param {Node} node - The DOM node.
* @return {boolean} true if the node is a text node, false otherwise.
* */
function isTextNode(node) {
return node.nodeType === Node.TEXT_NODE;
}
/**
* Determine whether or not an element is inline-level or block-level.
*
* @private
* @param {Element} element - The DOM element.
* @return {boolean} true if the element is inline, false otherwise.
* */
function isInlineLevelElement(element) {
if (!isElementNode(element)) {
return false;
}
//Special case: will treat <br> as block element
let elementTagName = element.tagName.toLowerCase();
if (elementTagName === 'br') {
return false;
}
if (window.getComputedStyle(element).display === 'inline') {
return true;
}
return false;
}
/**
* Determine whether a text node value is whitespace only.
*
* @private
* @param {Node} node - The DOM node.
* @return {boolean} true if the node value is whitespace only, false otherwise.
* */
function isNodeTextValueWhitespaceOnly(node) {
return !(/[^\t\n\r ]/.test(node.nodeValue));
}
/**
* Determine the depth of a given node in the DOM tree.
*
* @private
* @param {Node} node - The DOM node.
* @return {number} the depth of the DOM node in the tree.
* */
function getNodeTreeDepth(node) {
let depth = -1;
while (node != null) {
depth++;
node = node.parentNode;
}
return depth;
}
/**
* Generate a UUIDv4.
*
* @private
* @return {string} a new UUIDv4.
* */
function generateElementUUID() {
let generateBlock = (size) => {
let block = '';
for (let index = 0; index < size; index++) {
block += Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
}
return block;
};
const blockSizes = [2, 1, 1, 1, 3];
let uuid = '';
for (let index = 0; index < blockSizes.length; index++) {
uuid += generateBlock(blockSizes[index]) + (index === blockSizes.length - 1 ? '' : '-');
}
return uuid;
}
});
================================================
FILE: docs/_config.yml
================================================
theme: jekyll-theme-slate
================================================
FILE: docs/help.css
================================================
body {
background-color: #292929;
}
@font-face {
font-family: octicons-link;
src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEU0lHAAAGaAAAAAgAAAAIAAAAAUdTVUIAAAZcAAAACgAAAAoAAQAAT1MvMgAAAyQAAABJAAAAYFYEU3RjbWFwAAADcAAAAEUAAACAAJThvmN2dCAAAATkAAAABAAAAAQAAAAAZnBnbQAAA7gAAACyAAABCUM+8IhnYXNwAAAGTAAAABAAAAAQABoAI2dseWYAAAFsAAABPAAAAZwcEq9taGVhZAAAAsgAAAA0AAAANgh4a91oaGVhAAADCAAAABoAAAAkCA8DRGhtdHgAAAL8AAAADAAAAAwGAACfbG9jYQAAAsAAAAAIAAAACABiATBtYXhwAAACqAAAABgAAAAgAA8ASm5hbWUAAAToAAABQgAAAlXu73sOcG9zdAAABiwAAAAeAAAAME3QpOBwcmVwAAAEbAAAAHYAAAB/aFGpk3jaTY6xa8JAGMW/O62BDi0tJLYQincXEypYIiGJjSgHniQ6umTsUEyLm5BV6NDBP8Tpts6F0v+k/0an2i+itHDw3v2+9+DBKTzsJNnWJNTgHEy4BgG3EMI9DCEDOGEXzDADU5hBKMIgNPZqoD3SilVaXZCER3/I7AtxEJLtzzuZfI+VVkprxTlXShWKb3TBecG11rwoNlmmn1P2WYcJczl32etSpKnziC7lQyWe1smVPy/Lt7Kc+0vWY/gAgIIEqAN9we0pwKXreiMasxvabDQMM4riO+qxM2ogwDGOZTXxwxDiycQIcoYFBLj5K3EIaSctAq2kTYiw+ymhce7vwM9jSqO8JyVd5RH9gyTt2+J/yUmYlIR0s04n6+7Vm1ozezUeLEaUjhaDSuXHwVRgvLJn1tQ7xiuVv/ocTRF42mNgZGBgYGbwZOBiAAFGJBIMAAizAFoAAABiAGIAznjaY2BkYGAA4in8zwXi+W2+MjCzMIDApSwvXzC97Z4Ig8N/BxYGZgcgl52BCSQKAA3jCV8CAABfAAAAAAQAAEB42mNgZGBg4f3vACQZQABIMjKgAmYAKEgBXgAAeNpjYGY6wTiBgZWBg2kmUxoDA4MPhGZMYzBi1AHygVLYQUCaawqDA4PChxhmh/8ODDEsvAwHgMKMIDnGL0x7gJQCAwMAJd4MFwAAAHjaY2BgYGaA4DAGRgYQkAHyGMF8NgYrIM3JIAGVYYDT+AEjAwuDFpBmA9KMDEwMCh9i/v8H8sH0/4dQc1iAmAkALaUKLgAAAHjaTY9LDsIgEIbtgqHUPpDi3gPoBVyRTmTddOmqTXThEXqrob2gQ1FjwpDvfwCBdmdXC5AVKFu3e5MfNFJ29KTQT48Ob9/lqYwOGZxeUelN2U2R6+cArgtCJpauW7UQBqnFkUsjAY/kOU1cP+DAgvxwn1chZDwUbd6CFimGXwzwF6tPbFIcjEl+vvmM/byA48e6tWrKArm4ZJlCbdsrxksL1AwWn/yBSJKpYbq8AXaaTb8AAHja28jAwOC00ZrBeQNDQOWO//sdBBgYGRiYWYAEELEwMTE4uzo5Zzo5b2BxdnFOcALxNjA6b2ByTswC8jYwg0VlNuoCTWAMqNzMzsoK1rEhNqByEyerg5PMJlYuVueETKcd/89uBpnpvIEVomeHLoMsAAe1Id4AAAAAAAB42oWQT07CQBTGv0JBhagk7HQzKxca2sJCE1hDt4QF+9JOS0nbaaYDCQfwCJ7Au3AHj+LO13FMmm6cl7785vven0kBjHCBhfpYuNa5Ph1c0e2Xu3jEvWG7UdPDLZ4N92nOm+EBXuAbHmIMSRMs+4aUEd4Nd3CHD8NdvOLTsA2GL8M9PODbcL+hD7C1xoaHeLJSEao0FEW14ckxC+TU8TxvsY6X0eLPmRhry2WVioLpkrbp84LLQPGI7c6sOiUzpWIWS5GzlSgUzzLBSikOPFTOXqly7rqx0Z1Q5BAIoZBSFihQYQOOBEdkCOgXTOHA07HAGjGWiIjaPZNW13/+lm6S9FT7rLHFJ6fQbkATOG1j2OFMucKJJsxIVfQORl+9Jyda6Sl1dUYhSCm1dyClfoeDve4qMYdLEbfqHf3O/AdDumsjAAB42mNgYoAAZQYjBmyAGYQZmdhL8zLdDEydARfoAqIAAAABAAMABwAKABMAB///AA8AAQAAAAAAAAAAAAAAAAABAAAAAA==) format('woff');
}
kbd {
background-color: #fafbfc;
border: 1px solid #d1d5da;
border-bottom-color: #c6cbd1;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #c6cbd1;
color: #444d56;
display: inline-block;
font: 11px SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;
line-height: 10px;
padding: 3px 5px;
vertical-align: middle;
}
table {
overflow: auto;
width: 100%;
border-collapse: collapse;
}
table th {
font-weight: 600;
}
table td,
table th {
border: 1px solid #dfe2e5;
padding: 6px 13px;
}
table tr {
background-color: #fff;
border-top: 1px solid #c6cbd1;
}
table tr:nth-child(2n) {
background-color: #f6f8fa;
}
div#body-container {
background-color: white;
color: black;
max-width: 800px;
margin: auto;
padding: 10px;
border-radius: 10px;
box-shadow: 3px 3px 10px -3px rgba(0,0,0,0.55);
}
@media (max-width: 800px) {
div#body-container {
margin: auto;
padding: 10px;
border-radius: 10px;
box-shadow: 3px 3px 10px -3px rgba(0,0,0,0.55);
}
}
div#body-container h1, h2, h3, h4, h5, h6 {
font-weight: lighter;
}
a#fork-badge {
float: right;
transform: translate(8px, -8px);
}
button#options-icon {
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iNjRweCIKCSBoZWlnaHQ9IjY0cHgiIHZpZXdCb3g9IjAgMCA2NCA2NCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgNjQgNjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPgoJPHBhdGggZmlsbD0iIzFEMUQxQiIgZD0iTTIuNjI5LDU2LjQ5M2w2LjE1Miw2Ljg0NEM5LjE1Niw2My43NTQsOS42OSw2My45OTYsMTAuMjUsNjRjMC4wMDQsMCwwLjAxMiwwLDAuMDE2LDAKCQljMC41NTYsMCwxLjA4NC0wLjIzLDEuNDYzLTAuNjM4bDMxLjk1OC0zNC4zNDVjMC40NjcsMC4wMzIsMS4wNywwLjA2LDEuNzY3LDAuMDZjMy4xOTIsMCw5LjEyOC0wLjU5OSwxMi45OTYtNC42MDQKCQljMi41NTYtMi42NDYsMy43ODQtNi4yNzksMy42NTItMTAuNzk3Yy0wLjAyLTAuNjIyLTAuMzItMS4yLTAuODIxLTEuNTY4Yy0wLjQ5Ny0wLjM2Ni0xLjEzOS0wLjQ4LTEuNzMzLTAuMzFsLTExLjUzOCwzLjMzCgkJbC0xLjA0OS00LjQ0NGwxMS4wNzgtNC4wNzdjMC43Ni0wLjI3OSwxLjI3Ny0wLjk5LDEuMzEzLTEuODAzYzAuMDM1LTAuODEyLTAuNDE5LTEuNTY3LTEuMTUtMS45MTNDNTcuOTUsMi43NzMsNTIuMDExLDAsNDUuODUzLDAKCQljLTYuNjM3LDAtMTEuMTE3LDMuMTY2LTEyLjk0Nyw5LjEyOWMtMC4wNjgsMC4yMTgtMS41NzEsNS4wNDEsMS4wNDUsMTFMMi42NTIsNTMuNzY1QzEuOTM5LDU0LjUyOSwxLjkzLDU1LjcxNSwyLjYyOSw1Ni40OTN6CgkJIE0zNy44MTUsMjEuODcxYzAuNTg3LTAuNjMxLDAuNzA5LTEuNTY0LDAuMzA1LTIuMzI2Yy0yLjY0MS00Ljk3My0xLjQ1MS05LjAxNi0xLjM5NS05LjE5N2MxLjMwNS00LjI1Miw0LjI5MS02LjMxOCw5LjEyNy02LjMxOAoJCWMxLjkwNSwwLDMuODI2LDAuMzI5LDUuNDk5LDAuNzQ3bC03LjQ0MiwyLjczOWMtMC45NTMsMC4zNS0xLjQ5NiwxLjM2My0xLjI2LDIuMzU4bDEuOTQ3LDguMjM5CgkJYzAuMTI3LDAuNTM1LDAuNDY1LDAuOTk2LDAuOTM5LDEuMjczYzAuNDcxLDAuMjc3LDEuMDM3LDAuMzQ5LDEuNTYyLDAuMTk4bDEwLjg1OS0zLjEzNmMtMC4zMDcsMi4xNDQtMS4xMDQsMy44OTMtMi4zODMsNS4yMTcKCQljLTIuODQsMi45NDEtNy41NjEsMy4zODEtMTAuMTIyLDMuMzgxYy0xLjM2MiwwLTIuMjc2LTAuMTIzLTIuMjg0LTAuMTIzYy0wLjY0Ni0wLjA5LTEuMjkzLDAuMTQzLTEuNzM2LDAuNjE5bC0zMS4xNCwzMy40NjYKCQlsLTMuNDU3LTMuODQ1TDM3LjgxNSwyMS44NzF6Ii8+Cjwvc3ZnPgo=) #eaeaea no-repeat center;
background-size: 12px 12px;
border-width: 0;
border-radius: 2px;
width: 25px;
height: 25px;
padding: 0;
vertical-align: middle;
}
button#saved-expressions-icon {
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iNjRweCIgaGVpZ2h0PSI2NHB4IiB2aWV3Qm94PSIwIDAgNjQgNjQiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDY0IDY0IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KCTxnIGlkPSJleWUiPgoJCTxwYXRoIGZpbGw9IiMxRDFEMUIiIGQ9Ik0xNy4xMTQsMC4wMDZjLTEuMTA0LDAtMiwwLjg5Ni0yLDIuMDAydjU5LjU4NGMwLDAuNzM4LDAuNDA4LDEuNDE4LDEuMDYxLDEuNzY2CgkJCWMwLjY1LDAuMzQ2LDEuNDQzLDAuMzA1LDIuMDU1LTAuMTA1bDEzLjQ0My05LjA0N2wxMy40NTcsOS40MzhjMC4zNDQsMC4yNCwwLjc0NiwwLjM2MywxLjE0OCwwLjM2MwoJCQljMC4zMTYsMCwwLjYzMy0wLjA3NCwwLjkyMi0wLjIyN2MwLjY2NC0wLjM0NCwxLjA3OC0xLjAyNywxLjA3OC0xLjc3M1YyLjAwOGMwLTEuMTA1LTAuODk1LTIuMDAyLTItMi4wMDJIMTcuMTE0eiBNNDQuMjc4LDU4LjE1OAoJCQlsLTExLjQzNC04LjAyYy0wLjM0NC0wLjI0LTAuNzQ2LTAuMzYxLTEuMTQ4LTAuMzYxYy0wLjM5MSwwLTAuNzc3LDAuMTEzLTEuMTE3LDAuMzRsLTExLjQ2NSw3LjcxN1Y0LjAwOGgyNS4xNjRWNTguMTU4eiIvPgoJPC9nPgo8L3N2Zz4K) #eaeaea no-repeat center;
background-size: 12px 12px;
border-width: 0;
border-radius: 2px;
width: 25px;
height: 25px;
padding: 0;
vertical-align: middle;
}
.indent {
padding-left: 10px;
}
pre {
background-color: #eee;
display: block;
padding: 10px;
}
/* Collapsible Section Styles */
div.collapsible-section {
padding-bottom: 5px;
}
div.collapsible-content div.content-inner {
background: white;
border: 1px solid #edecee;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
padding: .5rem 1rem;
}
input[type='checkbox'] {
display: none;
}
.lbl-toggle {
display: block;
font-weight: lighter;
font-size: 1.5em;
padding: 0.5rem;
background: #edecee;
cursor: pointer;
border-radius: 4px;
}
.lbl-toggle.example {
background-color: white;
}
.lbl-toggle:hover {
color: #7C5A0B;
}
.lbl-toggle::before {
content: ' ';
display: inline-block;
border-top: 4px solid transparent;
border-bottom: 4px solid transparent;
border-left: 4px solid currentColor;
vertical-align: middle;
margin-right: .7rem;
transform: rotate(90deg) translateX(-3px);
}
.toggle:checked + .lbl-toggle::before {
transform: rotate(0deg) translateY(-3px);
}
.toggle:checked + .lbl-toggle + .collapsible-content {
display: none;
}
.toggle:checked + .lbl-toggle {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
================================================
FILE: docs/index.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Find+ User Guide</title>
<link rel="stylesheet" href="help.css"/>
</head>
<body>
<a id="fork-badge" href="https://github.com/brandon1024/find"><img width="149" height="149"
src="https://github.blog/wp-content/uploads/2008/12/forkme_right_orange_ff7600.png?resize=149%2C149"
class="attachment-full size-full"
alt="Fork me on GitHub" data-recalc-dims="1"></a>
<div id="body-container">
<div class="section">
<h1>Find+ User Guide</h1>
<p>Hi there! Thanks for installing Find+. This is the user guide for the extension, where you will find all the
information you need to start using the extension.</p>
<p>If you are having trouble and can't find a solution here, <a href="https://github.com/brandon1024/find">check
our GitHub page</a>. There are plenty of additional resources there.</p>
</div>
<div class="collapsible-section">
<input id="regex-collapsible" class="toggle" type="checkbox">
<label for="regex-collapsible" class="lbl-toggle">Supported Expressions</label>
<div class="collapsible-content">
<div class="content-inner">
Find+ supports any regular expression supported by JavaScript. If you aren't familiar with JavaScript
regular expressions, <a
href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Cheatsheet">this
guide</a> is a good starting point.
<div>
<input id="example1-collapsible" class="toggle example" type="checkbox" checked>
<label for="example1-collapsible" class="lbl-toggle example">Example</label>
<div class="collapsible-content">
<div class="content-inner">
The following expression matches any text preceded by a colon ':', following by either
"Put", "Get" or "Delete", followed by the word "Object".
<pre>:((Put)|(Get)|(Delete))Object</pre>
<pre>
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::dev.s3.ktb.ca"
]
},{
"Effect": "Allow",
"Action": [
"s3<span style="background-color: #ff9813">:PutObject</span>",
"s3<span style="background-color: #fff000">:GetObject</span>",
"s3<span style="background-color: #fff000">:DeleteObject</span>"
],
"Resource": [
"arn:aws:s3:::dev.s3.ktb.ca/*"
]
}]
}
</pre>
</div>
</div>
</div>
<div>
<input id="example2-collapsible" class="toggle example" type="checkbox" checked>
<label for="example2-collapsible" class="lbl-toggle example">Example</label>
<div class="collapsible-content">
<div class="content-inner">
The following example matches any quoted date with the format "####-##-##".
<pre>"\d{4}-\d{2}-\d{2}"</pre>
<pre>
{
"Version": <span style="background-color: #ff9813">"2012-10-17"</span>,
"Statement": [{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::dev.s3.ktb.ca"
]
},{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3GetObject",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::dev.s3.ktb.ca/*"
]
}]
}
</pre>
</div>
</div>
</div>
<div>
<input id="example3-collapsible" class="toggle example" type="checkbox" checked>
<label for="example3-collapsible" class="lbl-toggle example">Example</label>
<div class="collapsible-content">
<div class="content-inner">
This example matches any JavaScript variable declaration.
<pre>((var)|(let)).*?=.*?;</pre>
<pre>
if (!preformatted.flag && isNodeTextValueWhitespaceOnly(node) && node.nodeValue.length !== 1) {
node = DOMTreeWalker.nextNode();
continue;
} else if (node.nodeValue.length === 1 && node.nodeValue.charCodeAt(0) === 10) {
node = DOMTreeWalker.nextNode();
continue;
}
<span style="background-color: #ff9813">let identifierUUID = generateElementUUID();</span>
<span style="background-color: #ff9813">let nodeText = formatTextNodeValue(node, preformatted.flag, elementBoundary);</span>
if (nodeText.length === 0) {
node = DOMTreeWalker.nextNode();
continue;
}
<span style="background-color: #ff9813">let wrapperElement = document.createElement('span');</span>
wrapperElement.style.cssText = 'all: unset;';
wrapperElement.setAttribute('id', identifierUUID);
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="collapsible-section">
<input id="keyboard-shortcuts-collapsible" class="toggle" type="checkbox">
<label for="keyboard-shortcuts-collapsible" class="lbl-toggle">Keyboard Shortcuts</label>
<div class="collapsible-content">
<div class="content-inner">
<p>In Firefox, you can use <kbd>CTRL</kbd>+<kbd>⇧</kbd>+<kbd>F</kbd> to open the extension popup.</p>
<p>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:</p>
<ol>
<li>Navigate to the `Extensions` settings page in Chrome, or type `chrome://extensions/` into the navigation bar.</li>
<li>In the top left click on the ☰ menu icon, then click `Keyboard shortcuts`.</li>
<li>Locate the shortcut settings for find+. Click the input field located to the right of the label `Activate the extension`.</li>
<li>Press the combination of keys you would like to use, and once complete press `OK`. We recommend using <kbd>CTRL</kbd>+<kbd>⇧</kbd>+<kbd>F</kbd>, since it shouldn't conflict with any other browser keyboard shortcut mappings.</li>
</ol>
<p>When the extension popup is open, there are a number of keyboard shortcuts you can use. These settings cannot be remapped.</p>
<table>
<tr>
<th>Windows Shortcut</th>
<th>macOS Shortcut</th>
<th>Action</th>
</tr>
<tr>
<td><kbd>↵</kbd></td>
<td><kbd>↵</kbd></td>
<td>Advance to the next occurrence of the regular expression in the page.</td>
</tr>
<tr>
<td><kbd>⇧</kbd>+<kbd>↵</kbd></td>
<td><kbd>⇧</kbd>+<kbd>↵</kbd></td>
<td>Return to the previous occurrence of the regular expression in the page.</td>
</tr>
<tr>
<td><kbd>CTRL</kbd>+<kbd>⇧</kbd>+<kbd>↵</kbd></td>
<td><kbd>^</kbd>+<kbd>⇧</kbd>+<kbd>↵</kbd></td>
<td>Follow the first highlighted link in the current occurrence focus.</td>
</tr>
<tr>
<td><kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>C</kbd></td>
<td><kbd>^</kbd>+<kbd>⌥</kbd>+<kbd>C</kbd></td>
<td>Copy to the clipboard the currently highlighted text on the page.</td>
</tr>
<tr>
<td><kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>A</kbd></td>
<td><kbd>^</kbd>+<kbd>⌥</kbd>+<kbd>A</kbd></td>
<td>Copy to the clipboard the all highlighted text on the page.</td>
</tr>
<tr>
<td><kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>O</kbd></td>
<td><kbd>^</kbd>+<kbd>⌥</kbd>+<kbd>O</kbd></td>
<td>Expand or Collapse Options Pane.</td>
</tr>
<tr>
<td><kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>R</kbd></td>
<td><kbd>^</kbd>+<kbd>⌥</kbd>+<kbd>R</kbd></td>
<td>Expand or Collapse Replace Text Pane.</td>
</tr>
<tr>
<td><kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>H</kbd></td>
<td><kbd>^</kbd>+<kbd>⌥</kbd>+<kbd>H</kbd></td>
<td>Expand or Collapse Saved Expressions Pane.</td>
</tr>
<tr>
<td><kbd>CTRL</kbd>+<kbd>↵</kbd> or <kbd>ESC</kbd></td>
<td><kbd>^</kbd>+<kbd>↵</kbd> or <kbd>ESC</kbd></td>
<td>Close the extension popup.</td>
</tr>
</table>
</div>
</div>
</div>
<div class="collapsible-section">
<input id="options-collapsible" class="toggle" type="checkbox">
<label for="options-collapsible" class="lbl-toggle">Options</label>
<div class="collapsible-content">
<div class="content-inner">
<p>Find+ can be configured through the options pane, which can be accessed by clicking the wrench icon
<button id="options-icon"></button>.</p>
<h3>Find by Regular Expression</h3>
<p class="indent">Enabling this option will interpret your search query as a regular expression. If
disabled, your search query will be interpreted as a string rather than a regular expression.</p>
<h3>Match Case</h3>
<p class="indent">This option is used to toggle case sensitivity. Enabling this option will make the
search case sensitive.</p>
<h3>Persistent Highlights</h3>
<p class="indent">This option can be used to keep the highlights in the page, even after the extension
popup closes. If enabled, highlighted occurrences of your search query will remain in the page even
if the extension closes.</p>
<h3>Persistent Storage (Incognito)</h3>
<p class="indent">When incognito, you may still wish that your saved expressions and options are
persisted. By default, this feature is disabled for security purposes. When enabled, your saved
expressions and settings will be persisted and shared between incognito and non-incognito
sessions.</p>
<h3>Hide Option Pane Toggle Button</h3>
<p class="indent">This option can be used to hide the button used to toggle the options pane. If
enabled, you will need to use the shortcut to toggle the pane.</p>
<h3>Hide Saved Expressions Pane Toggle Button</h3>
<p class="indent">This option can be used to hide the button used to toggle the saved expressions pane.
If enabled, you will need to use the shortcut to toggle the pane.</p>
<h3>Hide Copy To Clipboard Button</h3>
<p class="indent">This option can be used to hide the button used to copy occurrences to the clipboard.
If enabled, you will need to use the keyboard shortcut to copy occurrences.</p>
<h3>Max Highlighted Results</h3>
<p class="indent">Limit the number of occurrences in the page. When set, only the first few results will
be highlighted.</p>
<h3>Selected Occurrence Highlight Color</h3>
<p class="indent">This option is used to configure the color of the selected occurrence highlight; that
is, the color of the highlight on the occurrence of the search query you are currently viewing.</p>
<h3>Highlight Color</h3>
<p class="indent">This option is used to configure the color of all other occurrences (all occurrences
except the selected occurrence).</p>
</div>
</div>
</div>
<div class="collapsible-section">
<input id="saved-expressions-collapsible" class="toggle" type="checkbox">
<label for="saved-expressions-collapsible" class="lbl-toggle">Saved Expressions</label>
<div class="collapsible-content">
<div class="content-inner">
<p>You can save frequently used regular expressions using the Saved Expressions pane, which can be
accessed by pressing the bookmark icon
<button id="saved-expressions-icon"></button>
.
</p>
<p>Enter a regular expression in the search field and press 'Save Regex' to save the query to local
storage. You can reuse a query by clicking on the expression entry in the saved expressions
pane.</p>
</div>
</div>
</div>
<div class="collapsible-section">
<input id="find-replace-collapsible" class="toggle" type="checkbox">
<label for="find-replace-collapsible" class="lbl-toggle">Find-and-Replace</label>
<div class="collapsible-content">
<div class="content-inner">
<p>The find-and-replace pane is only accessible though the keyboard shortcut found in the Keyboard
Shortcuts section of this guide.</p>
<p>The find-and-replace feature is used to replace text within a page. To replace text in a page, open
the find-and-replace pane and enter a query in the search field, and enter the text you wish to
replace occurrences of that query with in the replace pane field. Pressing 'Replace' will replace
the current occurrence, while 'Replace All' will replace all occurrences.</p>
<p>Note that replacing text will modify the text in the page, and will require a refresh of the page to
undo.</p>
</div>
</div>
</div>
<div class="collapsible-section">
<input id="copy-collapsible" class="toggle" type="checkbox">
<label for="copy-collapsible" class="lbl-toggle">Copying Occurrences of Regex</label>
<div class="collapsible-content">
<div class="content-inner">
<p>Find+ supports copying the current, or all, occurrences of your query to your clipboard. You will
then be able to paste the occurrences to a text editor for use.</p>
<p>To use this feature, simply perform a search and use one of the keyboard shortcuts for copying
occurrences. The exact shortcuts to use are outlined in the 'Keyboard Shortcuts' section.</p>
<h3>Example</h3>
<pre>
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::dev.s3.ktb.ca"
]
},{
"Effect": "Allow",
"Action": [
"s3<span style="background-color: #ff9813">:PutObject</span>",
"s3<span style="background-color: #fff000">:GetObject</span>",
"s3<span style="background-color: #fff000">:DeleteObject</span>"
],
"Resource": [
"arn:aws:s3:::dev.s3.ktb.ca/*"
]
}]
}
</pre>
<h3>Result in Clipboard</h3>
<pre>
:PutObject
:GetObject
:DeleteObject
</pre>
</div>
</div>
</div>
<div class="collapsible-section">
<input id="omnibox-collapsible" class="toggle" type="checkbox">
<label for="omnibox-collapsible" class="lbl-toggle">Using the Omnibox</label>
<div class="collapsible-content">
<div class="content-inner">
<p>You can also use the omnibox to highlight occurrences of a query in the page, rather than opening the
browser extension popup.</p>
<p>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.</p>
<p>Pressing <kbd>ENTER</kbd> 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 query
entered in the address bar.</p>
</div>
</div>
</div>
<div class="section">
<h2>Reporting Bugs & Contributing</h2>
<p>Found a bug? Have a feature request? You can <a href="https://github.com/brandon1024/find/issues">log an
issue</a> in our GitHub page, and we will look into it right away.</p>
<p>If you are interested in trying to tackle an issue by yourself, have a read through <a
href="https://github.com/brandon1024/find#contributing">our README</a>.</p>
<img src="https://img.shields.io/github/issues/brandon1024/find.svg?color=%23&label=Github%20Issues"/>
<img src="https://img.shields.io/github/issues-pr/brandon1024/find.svg?color=%23&label=Github%20Pull%20Requests"/>
</div>
</div>
</body>
</html>
================================================
FILE: lib/html-entity-handler/entityhandler.js
================================================
const NAMED_CHARACTER_REFERENCES = {
"Á": { "codepoints": [193], "characters": "\u00C1" },
"Á": { "codepoints": [193], "characters": "\u00C1" },
"á": { "codepoints": [225], "characters": "\u00E1" },
"á": { "codepoints": [225], "characters": "\u00E1" },
"Ă": { "codepoints": [258], "characters": "\u0102" },
"ă": { "codepoints": [259], "characters": "\u0103" },
"∾": { "codepoints": [8766], "characters": "\u223E" },
"∿": { "codepoints": [8767], "characters": "\u223F" },
"∾̳": { "codepoints": [8766, 819], "characters": "\u223E\u0333" },
"Â": { "codepoints": [194], "characters": "\u00C2" },
"Â": { "codepoints": [194], "characters": "\u00C2" },
"â": { "codepoints": [226], "characters": "\u00E2" },
"â": { "codepoints": [226], "characters": "\u00E2" },
"´": { "codepoints": [180], "characters": "\u00B4" },
"´": { "codepoints": [180], "characters": "\u00B4" },
"А": { "codepoints": [1040], "characters": "\u0410" },
"а": { "codepoints": [1072], "characters": "\u0430" },
"Æ": { "codepoints": [198], "characters": "\u00C6" },
"Æ": { "codepoints": [198], "characters": "\u00C6" },
"æ": { "codepoints": [230], "characters": "\u00E6" },
"æ": { "codepoints": [230], "characters": "\u00E6" },
"⁡": { "codepoints": [8289], "characters": "\u2061" },
"𝔄": { "codepoints": [120068], "characters": "\uD835\uDD04" },
"𝔞": { "codepoints": [120094], "characters": "\uD835\uDD1E" },
"À": { "codepoints": [192], "characters": "\u00C0" },
"À": { "codepoints": [192], "characters": "\u00C0" },
"à": { "codepoints": [224], "characters": "\u00E0" },
"à": { "codepoints": [224], "characters": "\u00E0" },
"ℵ": { "codepoints": [8501], "characters": "\u2135" },
"ℵ": { "codepoints": [8501], "characters": "\u2135" },
"Α": { "codepoints": [913], "characters": "\u0391" },
"α": { "codepoints": [945], "characters": "\u03B1" },
"Ā": { "codepoints": [256], "characters": "\u0100" },
"ā": { "codepoints": [257], "characters": "\u0101" },
"⨿": { "codepoints": [10815], "characters": "\u2A3F" },
"&": { "codepoints": [38], "characters": "\u0026" },
"&": { "codepoints": [38], "characters": "\u0026" },
"&": { "codepoints": [38], "characters": "\u0026" },
"&": { "codepoints": [38], "characters": "\u0026" },
"⩕": { "codepoints": [10837], "characters": "\u2A55" },
"⩓": { "codepoints": [10835], "characters": "\u2A53" },
"∧": { "codepoints": [8743], "characters": "\u2227" },
"⩜": { "codepoints": [10844], "characters": "\u2A5C" },
"⩘": { "codepoints": [10840], "characters": "\u2A58" },
"⩚": { "codepoints": [10842], "characters": "\u2A5A" },
"∠": { "codepoints": [8736], "characters": "\u2220" },
"⦤": { "codepoints": [10660], "characters": "\u29A4" },
"∠": { "codepoints": [8736], "characters": "\u2220" },
"⦨": { "codepoints": [10664], "characters": "\u29A8" },
"⦩": { "codepoints": [10665], "characters": "\u29A9" },
"⦪": { "codepoints": [10666], "characters": "\u29AA" },
"⦫": { "codepoints": [10667], "characters": "\u29AB" },
"⦬": { "codepoints": [10668], "characters": "\u29AC" },
"⦭": { "codepoints": [10669], "characters": "\u29AD" },
"⦮": { "codepoints": [10670], "characters": "\u29AE" },
"⦯": { "codepoints": [10671], "characters": "\u29AF" },
"∡": { "codepoints": [8737], "characters": "\u2221" },
"∟": { "codepoints": [8735], "characters": "\u221F" },
"⊾": { "codepoints": [8894], "characters": "\u22BE" },
"⦝": { "codepoints": [10653], "characters": "\u299D" },
"∢": { "codepoints": [8738], "characters": "\u2222" },
"Å": { "codepoints": [197], "characters": "\u00C5" },
"⍼": { "codepoints": [9084], "characters": "\u237C" },
"Ą": { "codepoints": [260], "characters": "\u0104" },
"ą": { "codepoints": [261], "characters": "\u0105" },
"𝔸": { "codepoints": [120120], "characters": "\uD835\uDD38" },
"𝕒": { "codepoints": [120146], "characters": "\uD835\uDD52" },
"⩯": { "codepoints": [10863], "characters": "\u2A6F" },
"≈": { "codepoints": [8776], "characters": "\u2248" },
"⩰": { "codepoints": [10864], "characters": "\u2A70" },
"≊": { "codepoints": [8778], "characters": "\u224A" },
"≋": { "codepoints": [8779], "characters": "\u224B" },
"'": { "codepoints": [39], "characters": "\u0027" },
"⁡": { "codepoints": [8289], "characters": "\u2061" },
"≈": { "codepoints": [8776], "characters": "\u2248" },
"≊": { "codepoints": [8778], "characters": "\u224A" },
"Å": { "codepoints": [197], "characters": "\u00C5" },
"Å": { "codepoints": [197], "characters": "\u00C5" },
"å": { "codepoints": [229], "characters": "\u00E5" },
"å": { "codepoints": [229], "characters": "\u00E5" },
"𝒜": { "codepoints": [119964], "characters": "\uD835\uDC9C" },
"𝒶": { "codepoints": [119990], "characters": "\uD835\uDCB6" },
"≔": { "codepoints": [8788], "characters": "\u2254" },
"*": { "codepoints": [42], "characters": "\u002A" },
"≈": { "codepoints": [8776], "characters": "\u2248" },
"≍": { "codepoints": [8781], "characters": "\u224D" },
"Ã": { "codepoints": [195], "characters": "\u00C3" },
"Ã": { "codepoints": [195], "characters": "\u00C3" },
"ã": { "codepoints": [227], "characters": "\u00E3" },
"ã": { "codepoints": [227], "characters": "\u00E3" },
"Ä": { "codepoints": [196], "characters": "\u00C4" },
"Ä": { "codepoints": [196], "characters": "\u00C4" },
"ä": { "codepoints": [228], "characters": "\u00E4" },
"ä": { "codepoints": [228], "characters": "\u00E4" },
"∳": { "codepoints": [8755], "characters": "\u2233" },
"⨑": { "codepoints": [10769], "characters": "\u2A11" },
"≌": { "codepoints": [8780], "characters": "\u224C" },
"϶": { "codepoints": [1014], "characters": "\u03F6" },
"‵": { "codepoints": [8245], "characters": "\u2035" },
"∽": { "codepoints": [8765], "characters": "\u223D" },
"⋍": { "codepoints": [8909], "characters": "\u22CD" },
"∖": { "codepoints": [8726], "characters": "\u2216" },
"⫧": { "codepoints": [10983], "characters": "\u2AE7" },
"⊽": { "codepoints": [8893], "characters": "\u22BD" },
"⌅": { "codepoints": [8965], "characters": "\u2305" },
"⌆": { "codepoints": [8966], "characters": "\u2306" },
"⌅": { "codepoints": [8965], "characters": "\u2305" },
"⎵": { "codepoints": [9141], "characters": "\u23B5" },
"⎶": { "codepoints": [9142], "characters": "\u23B6" },
"≌": { "codepoints": [8780], "characters": "\u224C" },
"Б": { "codepoints": [1041], "characters": "\u0411" },
"б": { "codepoints": [1073], "characters": "\u0431" },
"„": { "codepoints": [8222], "characters": "\u201E" },
"∵": { "codepoints": [8757], "characters": "\u2235" },
"∵": { "codepoints": [8757], "characters": "\u2235" },
"∵": { "codepoints": [8757], "characters": "\u2235" },
"⦰": { "codepoints": [10672], "characters": "\u29B0" },
"϶": { "codepoints": [1014], "characters": "\u03F6" },
"ℬ": { "codepoints": [8492], "characters": "\u212C" },
"ℬ": { "codepoints": [8492], "characters": "\u212C" },
"Β": { "codepoints": [914], "characters": "\u0392" },
"β": { "codepoints": [946], "characters": "\u03B2" },
"ℶ": { "codepoints": [8502], "characters": "\u2136" },
"≬": { "codepoints": [8812], "characters": "\u226C" },
"𝔅": { "codepoints": [120069], "characters": "\uD835\uDD05" },
"𝔟": { "codepoints": [120095], "characters": "\uD835\uDD1F" },
"⋂": { "codepoints": [8898], "characters": "\u22C2" },
"◯": { "codepoints": [9711], "characters": "\u25EF" },
"⋃": { "codepoints": [8899], "characters": "\u22C3" },
"⨀": { "codepoints": [10752], "characters": "\u2A00" },
"⨁": { "codepoints": [10753], "characters": "\u2A01" },
"⨂": { "codepoints": [10754], "characters": "\u2A02" },
"⨆": { "codepoints": [10758], "characters": "\u2A06" },
"★": { "codepoints": [9733], "characters": "\u2605" },
"▽": { "codepoints": [9661], "characters": "\u25BD" },
"△": { "codepoints": [9651], "characters": "\u25B3" },
"⨄": { "codepoints": [10756], "characters": "\u2A04" },
"⋁": { "codepoints": [8897], "characters": "\u22C1" },
"⋀": { "codepoints": [8896], "characters": "\u22C0" },
"⤍": { "codepoints": [10509], "characters": "\u290D" },
"⧫": { "codepoints": [10731], "characters": "\u29EB" },
"▪": { "codepoints": [9642], "characters": "\u25AA" },
"▴": { "codepoints": [9652], "characters": "\u25B4" },
"▾": { "codepoints": [9662], "characters": "\u25BE" },
"◂": { "codepoints": [9666], "characters": "\u25C2" },
"▸": { "codepoints": [9656], "characters": "\u25B8" },
"␣": { "codepoints": [9251], "characters": "\u2423" },
"▒": { "codepoints": [9618], "characters": "\u2592" },
"░": { "codepoints": [9617], "characters": "\u2591" },
"▓": { "codepoints": [9619], "characters": "\u2593" },
"█": { "codepoints": [9608], "characters": "\u2588" },
"=⃥": { "codepoints": [61, 8421], "characters": "\u003D\u20E5" },
"≡⃥": { "codepoints": [8801, 8421], "characters": "\u2261\u20E5" },
"⫭": { "codepoints": [10989], "characters": "\u2AED" },
"⌐": { "codepoints": [8976], "characters": "\u2310" },
"𝔹": { "codepoints": [120121], "characters": "\uD835\uDD39" },
"𝕓": { "codepoints": [120147], "characters": "\uD835\uDD53" },
"⊥": { "codepoints": [8869], "characters": "\u22A5" },
"⊥": { "codepoints": [8869], "characters": "\u22A5" },
"⋈": { "codepoints": [8904], "characters": "\u22C8" },
"⧉": { "codepoints": [10697], "characters": "\u29C9" },
"┐": { "codepoints": [9488], "characters": "\u2510" },
"╕": { "codepoints": [9557], "characters": "\u2555" },
"╖": { "codepoints": [9558], "characters": "\u2556" },
"╗": { "codepoints": [9559], "characters": "\u2557" },
"┌": { "codepoints": [9484], "characters": "\u250C" },
"╒": { "codepoints": [9554], "characters": "\u2552" },
"╓": { "codepoints": [9555], "characters": "\u2553" },
"╔": { "codepoints": [9556], "characters": "\u2554" },
"─": { "codepoints": [9472], "characters": "\u2500" },
"═": { "codepoints": [9552], "characters": "\u2550" },
"┬": { "codepoints": [9516], "characters": "\u252C" },
"╤": { "codepoints": [9572], "characters": "\u2564" },
"╥": { "codepoints": [9573], "characters": "\u2565" },
"╦": { "codepoints": [9574], "characters": "\u2566" },
"┴": { "codepoints": [9524], "characters": "\u2534" },
"╧": { "codepoints": [9575], "characters": "\u2567" },
"╨": { "codepoints": [9576], "characters": "\u2568" },
"╩": { "codepoints": [9577], "characters": "\u2569" },
"⊟": { "codepoints": [8863], "characters": "\u229F" },
"⊞": { "codepoints": [8862], "characters": "\u229E" },
"⊠": { "codepoints": [8864], "characters": "\u22A0" },
"┘": { "codepoints": [9496], "characters": "\u2518" },
"╛": { "codepoints": [9563], "characters": "\u255B" },
"╜": { "codepoints": [9564], "characters": "\u255C" },
"╝": { "codepoints": [9565], "characters": "\u255D" },
"└": { "codepoints": [9492], "characters": "\u2514" },
"╘": { "codepoints": [9560], "characters": "\u2558" },
"╙": { "codepoints": [9561], "characters": "\u2559" },
"╚": { "codepoints": [9562], "characters": "\u255A" },
"│": { "codepoints": [9474], "characters": "\u2502" },
"║": { "codepoints": [9553], "characters": "\u2551" },
"┼": { "codepoints": [9532], "characters": "\u253C" },
"╪": { "codepoints": [9578], "characters": "\u256A" },
"╫": { "codepoints": [9579], "characters": "\u256B" },
"╬": { "codepoints": [9580], "characters": "\u256C" },
"┤": { "codepoints": [9508], "characters": "\u2524" },
"╡": { "codepoints": [9569], "characters": "\u2561" },
"╢": { "codepoints": [9570], "characters": "\u2562" },
"╣": { "codepoints": [9571], "characters": "\u2563" },
"├": { "codepoints": [9500], "characters": "\u251C" },
"╞": { "codepoints": [9566], "characters": "\u255E" },
"╟": { "codepoints": [9567], "characters": "\u255F" },
"╠": { "codepoints": [9568], "characters": "\u2560" },
"‵": { "codepoints": [8245], "characters": "\u2035" },
"˘": { "codepoints": [728], "characters": "\u02D8" },
"˘": { "codepoints": [728], "characters": "\u02D8" },
"¦": { "codepoints": [166], "characters": "\u00A6" },
"¦": { "codepoints": [166], "characters": "\u00A6" },
"𝒷": { "codepoints": [119991], "characters": "\uD835\uDCB7" },
"ℬ": { "codepoints": [8492], "characters": "\u212C" },
"⁏": { "codepoints": [8271], "characters": "\u204F" },
"∽": { "codepoints": [8765], "characters": "\u223D" },
"⋍": { "codepoints": [8909], "characters": "\u22CD" },
"⧅": { "codepoints": [10693], "characters": "\u29C5" },
"\": { "codepoints": [92], "characters": "\u005C" },
"⟈": { "codepoints": [10184], "characters": "\u27C8" },
"•": { "codepoints": [8226], "characters": "\u2022" },
"•": { "codepoints": [8226], "characters": "\u2022" },
"≎": { "codepoints": [8782], "characters": "\u224E" },
"⪮": { "codepoints": [10926], "characters": "\u2AAE" },
"≏": { "codepoints": [8783], "characters": "\u224F" },
"≎": { "codepoints": [8782], "characters": "\u224E" },
"≏": { "codepoints": [8783], "characters": "\u224F" },
"Ć": { "codepoints": [262], "characters": "\u0106" },
"ć": { "codepoints": [263], "characters": "\u0107" },
"⩄": { "codepoints": [10820], "characters": "\u2A44" },
"⩉": { "codepoints": [10825], "characters": "\u2A49" },
"⩋": { "codepoints": [10827], "characters": "\u2A4B" },
"∩": { "codepoints": [8745], "characters": "\u2229" },
"⋒": { "codepoints": [8914], "characters": "\u22D2" },
"⩇": { "codepoints": [10823], "characters": "\u2A47" },
"⩀": { "codepoints": [10816], "characters": "\u2A40" },
"ⅅ": { "codepoints": [8517], "characters": "\u2145" },
"∩︀": { "codepoints": [8745, 65024], "characters": "\u2229\uFE00" },
"⁁": { "codepoints": [8257], "characters": "\u2041" },
"ˇ": { "codepoints": [711], "characters": "\u02C7" },
"ℭ": { "codepoints": [8493], "characters": "\u212D" },
"⩍": { "codepoints": [10829], "characters": "\u2A4D" },
"Č": { "codepoints": [268], "characters": "\u010C" },
"č": { "codepoints": [269], "characters": "\u010D" },
"Ç": { "codepoints": [199], "characters": "\u00C7" },
"Ç": { "codepoints": [199], "characters": "\u00C7" },
"ç": { "codepoints": [231], "characters": "\u00E7" },
"ç": { "codepoints": [231], "characters": "\u00E7" },
"Ĉ": { "codepoints": [264], "characters": "\u0108" },
"ĉ": { "codepoints": [265], "characters": "\u0109" },
"∰": { "codepoints": [8752], "characters": "\u2230" },
"⩌": { "codepoints": [10828], "characters": "\u2A4C" },
"⩐": { "codepoints": [10832], "characters": "\u2A50" },
"Ċ": { "codepoints": [266], "characters": "\u010A" },
"ċ": { "codepoints": [267], "characters": "\u010B" },
"¸": { "codepoints": [184], "characters": "\u00B8" },
"¸": { "codepoints": [184], "characters": "\u00B8" },
"¸": { "codepoints": [184], "characters": "\u00B8" },
"⦲": { "codepoints": [10674], "characters": "\u29B2" },
"¢": { "codepoints": [162], "characters": "\u00A2" },
"¢": { "codepoints": [162], "characters": "\u00A2" },
"·": { "codepoints": [183], "characters": "\u00B7" },
"·": { "codepoints": [183], "characters": "\u00B7" },
"𝔠": { "codepoints": [120096], "characters": "\uD835\uDD20" },
"ℭ": { "codepoints": [8493], "characters": "\u212D" },
"Ч": { "codepoints": [1063], "characters": "\u0427" },
"ч": { "codepoints": [1095], "characters": "\u0447" },
"✓": { "codepoints": [10003], "characters": "\u2713" },
"✓": { "codepoints": [10003], "characters": "\u2713" },
"Χ": { "codepoints": [935], "characters": "\u03A7" },
"χ": { "codepoints": [967], "characters": "\u03C7" },
"ˆ": { "codepoints": [710], "characters": "\u02C6" },
"≗": { "codepoints": [8791], "characters": "\u2257" },
"↺": { "codepoints": [8634], "characters": "\u21BA" },
"↻": { "codepoints": [8635], "characters": "\u21BB" },
"⊛": { "codepoints": [8859], "characters": "\u229B" },
"⊚": { "codepoints": [8858], "characters": "\u229A" },
"⊝": { "codepoints": [8861], "characters": "\u229D" },
"⊙": { "codepoints": [8857], "characters": "\u2299" },
"®": { "codepoints": [174], "characters": "\u00AE" },
"Ⓢ": { "codepoints": [9416], "characters": "\u24C8" },
"⊖": { "codepoints": [8854], "characters": "\u2296" },
"⊕": { "codepoints": [8853], "characters": "\u2295" },
"⊗": { "codepoints": [8855], "characters": "\u2297" },
"○": { "codepoints": [9675], "characters": "\u25CB" },
"⧃": { "codepoints": [10691], "characters": "\u29C3" },
"≗": { "codepoints": [8791], "characters": "\u2257" },
"⨐": { "codepoints": [10768], "characters": "\u2A10" },
"⫯": { "codepoints": [10991], "characters": "\u2AEF" },
"⧂": { "codepoints": [10690], "characters": "\u29C2" },
"∲": { "codepoints": [8754], "characters": "\u2232" },
"”": { "codepoints": [8221], "characters": "\u201D" },
"’": { "codepoints": [8217], "characters": "\u2019" },
"♣": { "codepoints": [9827], "characters": "\u2663" },
"♣": { "codepoints": [9827], "characters": "\u2663" },
":": { "codepoints": [58], "characters": "\u003A" },
"∷": { "codepoints": [8759], "characters": "\u2237" },
"⩴": { "codepoints": [10868], "characters": "\u2A74" },
"≔": { "codepoints": [8788], "characters": "\u2254" },
"≔": { "codepoints": [8788], "characters": "\u2254" },
",": { "codepoints": [44], "characters": "\u002C" },
"@": { "codepoints": [64], "characters": "\u0040" },
"∁": { "codepoints": [8705], "characters": "\u2201" },
"∘": { "codepoints": [8728], "characters": "\u2218" },
"∁": { "codepoints": [8705], "characters": "\u2201" },
"ℂ": { "codepoints": [8450], "characters": "\u2102" },
"≅": { "codepoints": [8773], "characters": "\u2245" },
"⩭": { "codepoints": [10861], "characters": "\u2A6D" },
"≡": { "codepoints": [8801], "characters": "\u2261" },
"∮": { "codepoints": [8750], "characters": "\u222E" },
"∯": { "codepoints": [8751], "characters": "\u222F" },
"∮": { "codepoints": [8750], "characters": "\u222E" },
"𝕔": { "codepoints": [120148], "characters": "\uD835\uDD54" },
"ℂ": { "codepoints": [8450], "characters": "\u2102" },
"∐": { "codepoints": [8720], "characters": "\u2210" },
"∐": { "codepoints": [8720], "characters": "\u2210" },
"©": { "codepoints": [169], "characters": "\u00A9" },
"©": { "codepoints": [169], "characters": "\u00A9" },
"©": { "codepoints": [169], "characters": "\u00A9" },
"©": { "codepoints": [169], "characters": "\u00A9" },
"℗": { "codepoints": [8471], "characters": "\u2117" },
"∳": { "codepoints": [8755], "characters": "\u2233" },
"↵": { "codepoints": [8629], "characters": "\u21B5" },
"✗": { "codepoints": [10007], "characters": "\u2717" },
"⨯": { "codepoints": [10799], "characters": "\u2A2F" },
"𝒞": { "codepoints": [119966], "characters": "\uD835\uDC9E" },
"𝒸": { "codepoints": [119992], "characters": "\uD835\uDCB8" },
"⫏": { "codepoints": [10959], "characters": "\u2ACF" },
"⫑": { "codepoints": [10961], "characters": "\u2AD1" },
"⫐": { "codepoints": [10960], "characters": "\u2AD0" },
"⫒": { "codepoints": [10962], "characters": "\u2AD2" },
"⋯": { "codepoints": [8943], "characters": "\u22EF" },
"⤸": { "codepoints": [10552], "characters": "\u2938" },
"⤵": { "codepoints": [10549], "characters": "\u2935" },
"⋞": { "codepoints": [8926], "characters": "\u22DE" },
"⋟": { "codepoints": [8927], "characters": "\u22DF" },
"↶": { "codepoints": [8630], "characters": "\u21B6" },
"⤽": { "codepoints": [10557], "characters": "\u293D" },
"⩈": { "codepoints": [10824], "characters": "\u2A48" },
"⩆": { "codepoints": [10822], "characters": "\u2A46" },
"≍": { "codepoints": [8781], "characters": "\u224D" },
"∪": { "codepoints": [8746], "characters": "\u222A" },
"⋓": { "codepoints": [8915], "characters": "\u22D3" },
"⩊": { "codepoints": [10826], "characters": "\u2A4A" },
"⊍": { "codepoints": [8845], "characters": "\u228D" },
"⩅": { "codepoints": [10821], "characters": "\u2A45" },
"∪︀": { "codepoints": [8746, 65024], "characters": "\u222A\uFE00" },
"↷": { "codepoints": [8631], "characters": "\u21B7" },
"⤼": { "codepoints": [10556], "characters": "\u293C" },
"⋞": { "codepoints": [8926], "characters": "\u22DE" },
"⋟": { "codepoints": [8927], "characters": "\u22DF" },
"⋎": { "codepoints": [8910], "characters": "\u22CE" },
"⋏": { "codepoints": [8911], "characters": "\u22CF" },
"¤": { "codepoints": [164], "characters": "\u00A4" },
"¤": { "codepoints": [164], "characters": "\u00A4" },
"↶": { "codepoints": [8630], "characters": "\u21B6" },
"↷": { "codepoints": [8631], "characters": "\u21B7" },
"⋎": { "codepoints": [8910], "characters": "\u22CE" },
"⋏": { "codepoints": [8911], "characters": "\u22CF" },
"∲": { "codepoints": [8754], "characters": "\u2232" },
"∱": { "codepoints": [8753], "characters": "\u2231" },
"⌭": { "codepoints": [9005], "characters": "\u232D" },
"†": { "codepoints": [8224], "characters": "\u2020" },
"‡": { "codepoints": [8225], "characters": "\u2021" },
"ℸ": { "codepoints": [8504], "characters": "\u2138" },
"↓": { "codepoints": [8595], "characters": "\u2193" },
"↡": { "codepoints": [8609], "characters": "\u21A1" },
"⇓": { "codepoints": [8659], "characters": "\u21D3" },
"‐": { "codepoints": [8208], "characters": "\u2010" },
"⫤": { "codepoints": [10980], "characters": "\u2AE4" },
"⊣": { "codepoints": [8867], "characters": "\u22A3" },
"⤏": { "codepoints": [10511], "characters": "\u290F" },
"˝": { "codepoints": [733], "characters": "\u02DD" },
"Ď": { "codepoints": [270], "characters": "\u010E" },
"ď": { "codepoints": [271], "characters": "\u010F" },
"Д": { "codepoints": [1044], "characters": "\u0414" },
"д": { "codepoints": [1076], "characters": "\u0434" },
"‡": { "codepoints": [8225], "characters": "\u2021" },
"⇊": { "codepoints": [8650], "characters": "\u21CA" },
"ⅅ": { "codepoints": [8517], "characters": "\u2145" },
"ⅆ": { "codepoints": [8518], "characters": "\u2146" },
"⤑": { "codepoints": [10513], "characters": "\u2911" },
"⩷": { "codepoints": [10871], "characters": "\u2A77" },
"°": { "codepoints": [176], "characters": "\u00B0" },
"°": { "codepoints": [176], "characters": "\u00B0" },
"∇": { "codepoints": [8711], "characters": "\u2207" },
"Δ": { "codepoints": [916], "characters": "\u0394" },
"δ": { "codepoints": [948], "characters": "\u03B4" },
"⦱": { "codepoints": [10673], "characters": "\u29B1" },
"⥿": { "codepoints": [10623], "characters": "\u297F" },
"𝔇": { "codepoints": [120071], "characters": "\uD835\uDD07" },
"𝔡": { "codepoints": [120097], "characters": "\uD835\uDD21" },
"⥥": { "codepoints": [10597], "characters": "\u2965" },
"⇃": { "codepoints": [8643], "characters": "\u21C3" },
"⇂": { "codepoints": [8642], "characters": "\u21C2" },
"´": { "codepoints": [180], "characters": "\u00B4" },
"˙": { "codepoints": [729], "characters": "\u02D9" },
"˝": { "codepoints": [733], "characters": "\u02DD" },
"`": { "codepoints": [96], "characters": "\u0060" },
"˜": { "codepoints": [732], "characters": "\u02DC" },
"⋄": { "codepoints": [8900], "characters": "\u22C4" },
"⋄": { "codepoints": [8900], "characters": "\u22C4" },
"⋄": { "codepoints": [8900], "characters": "\u22C4" },
"♦": { "codepoints": [9830], "characters": "\u2666" },
"♦": { "codepoints": [9830], "characters": "\u2666" },
"¨": { "codepoints": [168], "characters": "\u00A8" },
"ⅆ": { "codepoints": [8518], "characters": "\u2146" },
"ϝ": { "codepoints": [989], "characters": "\u03DD" },
"⋲": { "codepoints": [8946], "characters": "\u22F2" },
"÷": { "codepoints": [247], "characters": "\u00F7" },
"÷": { "codepoints": [247], "characters": "\u00F7" },
"÷": { "codepoints": [247], "characters": "\u00F7" },
"⋇": { "codepoints": [8903], "characters": "\u22C7" },
"⋇": { "codepoints": [8903], "characters": "\u22C7" },
"Ђ": { "codepoints": [1026], "characters": "\u0402" },
"ђ": { "codepoints": [1106], "characters": "\u0452" },
"⌞": { "codepoints": [8990], "characters": "\u231E" },
"⌍": { "codepoints": [8973], "characters": "\u230D" },
"$": { "codepoints": [36], "characters": "\u0024" },
"𝔻": { "codepoints": [120123], "characters": "\uD835\uDD3B" },
"𝕕": { "codepoints": [120149], "characters": "\uD835\uDD55" },
"¨": { "codepoints": [168], "characters": "\u00A8" },
"˙": { "codepoints": [729], "characters": "\u02D9" },
"⃜": { "codepoints": [8412], "characters": "\u20DC" },
"≐": { "codepoints": [8784], "characters": "\u2250" },
"≑": { "codepoints": [8785], "characters": "\u2251" },
"≐": { "codepoints": [8784], "characters": "\u2250" },
"∸": { "codepoints": [8760], "characters": "\u2238" },
"∔": { "codepoints": [8724], "characters": "\u2214" },
"⊡": { "codepoints": [8865], "characters": "\u22A1" },
"⌆": { "codepoints": [8966], "characters": "\u2306" },
"∯": { "codepoints": [8751], "characters": "\u222F" },
"¨": { "codepoints": [168], "characters": "\u00A8" },
"⇓": { "codepoints": [8659], "characters": "\u21D3" },
"⇐": { "codepoints": [8656], "characters": "\u21D0" },
"⇔": { "codepoints": [8660], "characters": "\u21D4" },
"⫤": { "codepoints": [10980], "characters": "\u2AE4" },
"⟸": { "codepoints": [10232], "characters": "\u27F8" },
"⟺": { "codepoints": [10234], "characters": "\u27FA" },
"⟹": { "codepoints": [10233], "characters": "\u27F9" },
"⇒": { "codepoints": [8658], "characters": "\u21D2" },
"⊨": { "codepoints": [8872], "characters": "\u22A8" },
"⇑": { "codepoints": [8657], "characters": "\u21D1" },
"⇕": { "codepoints": [8661], "characters": "\u21D5" },
"∥": { "codepoints": [8741], "characters": "\u2225" },
"⤓": { "codepoints": [10515], "characters": "\u2913" },
"↓": { "codepoints": [8595], "characters": "\u2193" },
"↓": { "codepoints": [8595], "characters": "\u2193" },
"⇓": { "codepoints": [8659], "characters": "\u21D3" },
"⇵": { "codepoints": [8693], "characters": "\u21F5" },
"̑": { "codepoints": [785], "characters": "\u0311" },
"⇊": { "codepoints": [8650], "characters": "\u21CA" },
"⇃": { "codepoints": [8643], "characters": "\u21C3" },
"⇂": { "codepoints": [8642], "characters": "\u21C2" },
"⥐": { "codepoints": [10576], "characters": "\u2950" },
"⥞": { "codepoints": [10590], "characters": "\u295E" },
"⥖": { "codepoints": [10582], "characters": "\u2956" },
"↽": { "codepoints": [8637], "characters": "\u21BD" },
"⥟": { "codepoints": [10591], "characters": "\u295F" },
"⥗": { "codepoints": [10583], "characters": "\u2957" },
"⇁": { "codepoints": [8641], "characters": "\u21C1" },
"↧": { "codepoints": [8615], "characters": "\u21A7" },
"⊤": { "codepoints": [8868], "characters": "\u22A4" },
"⤐": { "codepoints": [10512], "characters": "\u2910" },
"⌟": { "codepoints": [8991], "characters": "\u231F" },
"⌌": { "codepoints": [8972], "characters": "\u230C" },
"𝒟": { "codepoints": [119967], "characters": "\uD835\uDC9F" },
"𝒹": { "codepoints": [119993], "characters": "\uD835\uDCB9" },
"Ѕ": { "codepoints": [1029], "characters": "\u0405" },
"ѕ": { "codepoints": [1109], "characters": "\u0455" },
"⧶": { "codepoints": [10742], "characters": "\u29F6" },
"Đ": { "codepoints": [272], "characters": "\u0110" },
"đ": { "codepoints": [273], "characters": "\u0111" },
"⋱": { "codepoints": [8945], "characters": "\u22F1" },
"▿": { "codepoints": [9663], "characters": "\u25BF" },
"▾": { "codepoints": [9662], "characters": "\u25BE" },
"⇵": { "codepoints": [8693], "characters": "\u21F5" },
"⥯": { "codepoints": [10607], "characters": "\u296F" },
"⦦": { "codepoints": [10662], "characters": "\u29A6" },
"Џ": { "codepoints": [1039], "characters": "\u040F" },
"џ": { "codepoints": [1119], "characters": "\u045F" },
"⟿": { "codepoints": [10239], "characters": "\u27FF" },
"É": { "codepoints": [201], "characters": "\u00C9" },
"É": { "codepoints": [201], "characters": "\u00C9" },
"é": { "codepoints": [233], "characters": "\u00E9" },
"é": { "codepoints": [233], "characters": "\u00E9" },
"⩮": { "codepoints": [10862], "characters": "\u2A6E" },
"Ě": { "codepoints": [282], "characters": "\u011A" },
"ě": { "codepoints": [283], "characters": "\u011B" },
"Ê": { "codepoints": [202], "characters": "\u00CA" },
"Ê": { "codepoints": [202], "characters": "\u00CA" },
"ê": { "codepoints": [234], "characters": "\u00EA" },
"ê": { "codepoints": [234], "characters": "\u00EA" },
"≖": { "codepoints": [8790], "characters": "\u2256" },
"≕": { "codepoints": [8789], "characters": "\u2255" },
"Э": { "codepoints": [1069], "characters": "\u042D" },
"э": { "codepoints": [1101], "characters": "\u044D" },
"⩷": { "codepoints": [10871], "characters": "\u2A77" },
"Ė": { "codepoints": [278], "characters": "\u0116" },
"ė": { "codepoints": [279], "characters": "\u0117" },
"≑": { "codepoints": [8785], "characters": "\u2251" },
"ⅇ": { "codepoints": [8519], "characters": "\u2147" },
"≒": { "codepoints": [8786], "characters": "\u2252" },
"𝔈": { "codepoints": [120072], "characters": "\uD835\uDD08" },
"𝔢": { "codepoints": [120098], "characters": "\uD835\uDD22" },
"⪚": { "codepoints": [10906], "characters": "\u2A9A" },
"È": { "codepoints": [200], "characters": "\u00C8" },
"È": { "codepoints": [200], "characters": "\u00C8" },
"è": { "codepoints": [232], "characters": "\u00E8" },
"è": { "codepoints": [232], "characters": "\u00E8" },
"⪖": { "codepoints": [10902], "characters": "\u2A96" },
"⪘": { "codepoints": [10904], "characters": "\u2A98" },
"⪙": { "codepoints": [10905], "characters": "\u2A99" },
"∈": { "codepoints": [8712], "characters": "\u2208" },
"⏧": { "codepoints": [9191], "characters": "\u23E7" },
"ℓ": { "codepoints": [8467], "characters": "\u2113" },
"⪕": { "codepoints": [10901], "characters": "\u2A95" },
"⪗": { "codepoints": [10903], "characters": "\u2A97" },
"Ē": { "codepoints": [274], "characters": "\u0112" },
"ē": { "codepoints": [275], "characters": "\u0113" },
"∅": { "codepoints": [8709], "characters": "\u2205" },
"∅": { "codepoints": [8709], "characters": "\u2205" },
"◻": { "codepoints": [9723], "characters": "\u25FB" },
"∅": { "codepoints": [8709], "characters": "\u2205" },
"▫": { "codepoints": [9643], "characters": "\u25AB" },
" ": { "codepoints": [8196], "characters": "\u2004" },
" ": { "codepoints": [8197], "characters": "\u2005" },
" ": { "codepoints": [8195], "characters": "\u2003" },
"Ŋ": { "codepoints": [330], "characters": "\u014A" },
"ŋ": { "codepoints": [331], "characters": "\u014B" },
" ": { "codepoints": [8194], "characters": "\u2002" },
"Ę": { "codepoints": [280], "characters": "\u0118" },
"ę": { "codepoints": [281], "characters": "\u0119" },
"𝔼": { "codepoints": [120124], "characters": "\uD835\uDD3C" },
"𝕖": { "codepoints": [120150], "characters": "\uD835\uDD56" },
"⋕": { "codepoints": [8917], "characters": "\u22D5" },
"⧣": { "codepoints": [10723], "characters": "\u29E3" },
"⩱": { "codepoints": [10865], "characters": "\u2A71" },
"ε": { "codepoints": [949], "characters": "\u03B5" },
"Ε": { "codepoints": [917], "characters": "\u0395" },
"ε": { "codepoints": [949], "characters": "\u03B5" },
"ϵ": { "codepoints": [1013], "characters": "\u03F5" },
"≖": { "codepoints": [8790], "characters": "\u2256" },
"≕": { "codepoints": [8789], "characters": "\u2255" },
"≂": { "codepoints": [8770], "characters": "\u2242" },
"⪖": { "codepoints": [10902], "characters": "\u2A96" },
"⪕": { "codepoints": [10901], "characters": "\u2A95" },
"⩵": { "codepoints": [10869], "characters": "\u2A75" },
"=": { "codepoints": [61], "characters": "\u003D" },
"≂": { "codepoints": [8770], "characters": "\u2242" },
"≟": { "codepoints": [8799], "characters": "\u225F" },
"⇌": { "codepoints": [8652], "characters": "\u21CC" },
"≡": { "codepoints": [8801], "characters": "\u2261" },
"⩸": { "codepoints": [10872], "characters": "\u2A78" },
"⧥": { "codepoints": [10725], "characters": "\u29E5" },
"⥱": { "codepoints": [10609], "characters": "\u2971" },
"≓": { "codepoints": [8787], "characters": "\u2253" },
"ℯ": { "codepoints": [8495], "characters": "\u212F" },
"ℰ": { "codepoints": [8496], "characters": "\u2130" },
"≐": { "codepoints": [8784], "characters": "\u2250" },
"⩳": { "codepoints": [10867], "characters": "\u2A73" },
"≂": { "codepoints": [8770], "characters": "\u2242" },
"Η": { "codepoints": [919], "characters": "\u0397" },
"η": { "codepoints": [951], "characters": "\u03B7" },
"Ð": { "codepoints": [208], "characters": "\u00D0" },
"Ð": { "codepoints": [208], "characters": "\u00D0" },
"ð": { "codepoints": [240], "characters": "\u00F0" },
"ð": { "codepoints": [240], "characters": "\u00F0" },
"Ë": { "codepoints": [203], "characters": "\u00CB" },
"Ë": { "codepoints": [203], "characters": "\u00CB" },
"ë": { "codepoints": [235], "characters": "\u00EB" },
"ë": { "codepoints": [235], "characters": "\u00EB" },
"€": { "codepoints": [8364], "characters": "\u20AC" },
"!": { "codepoints": [33], "characters": "\u0021" },
"∃": { "codepoints": [8707], "characters": "\u2203" },
"∃": { "codepoints": [8707], "characters": "\u2203" },
"ℰ": { "codepoints": [8496], "characters": "\u2130" },
"ⅇ": { "codepoints": [8519], "characters": "\u2147" },
"ⅇ": { "codepoints": [8519], "characters": "\u2147" },
"≒": { "codepoints": [8786], "characters": "\u2252" },
"Ф": { "codepoints": [1060], "characters": "\u0424" },
"ф": { "codepoints": [1092], "characters": "\u0444" },
"♀": { "codepoints": [9792], "characters": "\u2640" },
"ffi": { "codepoints": [64259], "characters": "\uFB03" },
"ff": { "codepoints": [64256], "characters": "\uFB00" },
"ffl": { "codepoints": [64260], "characters": "\uFB04" },
"𝔉": { "codepoints": [120073], "characters": "\uD835\uDD09" },
"𝔣": { "codepoints": [120099], "characters": "\uD835\uDD23" },
"fi": { "codepoints": [64257], "characters": "\uFB01" },
"◼": { "codepoints": [9724], "characters": "\u25FC" },
"▪": { "codepoints": [9642], "characters": "\u25AA" },
"fj": { "codepoints": [102, 106], "characters": "\u0066\u006A" },
"♭": { "codepoints": [9837], "characters": "\u266D" },
"fl": { "codepoints": [64258], "characters": "\uFB02" },
"▱": { "codepoints": [9649], "characters": "\u25B1" },
"ƒ": { "codepoints": [402], "characters": "\u0192" },
"𝔽": { "codepoints": [120125], "characters": "\uD835\uDD3D" },
"𝕗": { "codepoints": [120151], "characters": "\uD835\uDD57" },
"∀": { "codepoints": [8704], "characters": "\u2200" },
"∀": { "codepoints": [8704], "characters": "\u2200" },
"⋔": { "codepoints": [8916], "characters": "\u22D4" },
"⫙": { "codepoints": [10969], "characters": "\u2AD9" },
"ℱ": { "codepoints": [8497], "characters": "\u2131" },
"⨍": { "codepoints": [10765], "characters": "\u2A0D" },
"½": { "codepoints": [189], "characters": "\u00BD" },
"½": { "codepoints":
gitextract_xf1_b131/
├── .github/
│ ├── ISSUE_TEMPLATE.md
│ └── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── PRIVACY.md
├── README.md
├── _locales/
│ ├── en/
│ │ └── messages.json
│ └── zh/
│ └── messages.json
├── app.js
├── background/
│ ├── background.js
│ ├── browser-action-proxy.js
│ ├── content-proxy.js
│ ├── omni.js
│ └── service_worker.js
├── build.sh
├── content/
│ ├── content.js
│ ├── highlighter.js
│ └── parser.js
├── docs/
│ ├── _config.yml
│ ├── help.css
│ └── index.html
├── lib/
│ └── html-entity-handler/
│ └── entityhandler.js
├── manifest.json
├── manifest_firefox.json
└── popup/
├── css/
│ ├── extension.css
│ ├── messagepane.css
│ ├── optionspane.css
│ ├── replacepane.css
│ ├── savedexpressionspane.css
│ └── searchpane.css
├── js/
│ ├── background-proxy.js
│ ├── browser-action.js
│ ├── history.js
│ ├── i18n.js
│ ├── message-pane.js
│ ├── options-pane.js
│ ├── replace-pane.js
│ ├── saved-expressions-pane.js
│ ├── search-pane.js
│ └── storage.js
└── popup.html
SYMBOL INDEX (46 symbols across 14 files)
FILE: app.js
function isFunction (line 98) | function isFunction(obj) {
FILE: background/background.js
function buildOccurrenceMap (line 362) | function buildOccurrenceMap(documentRepresentation, regex, options) {
function computeSubsequentIndex (line 419) | function computeSubsequentIndex(index, regexOccurrenceMap, options) {
function computePrecedingIndex (line 438) | function computePrecedingIndex(index, regexOccurrenceMap, options) {
function getUUIDsFromModelObject (line 459) | function getUUIDsFromModelObject(documentRepresentation) {
FILE: background/browser-action-proxy.js
function actionDispatch (line 55) | function actionDispatch(message, tab, sendResponse) {
FILE: background/omni.js
function retrieveOptions (line 85) | function retrieveOptions(callback) {
FILE: content/highlighter.js
function isElementInViewport (line 352) | function isElementInViewport(element) {
FILE: content/parser.js
function nodeFilter (line 170) | function nodeFilter(node) {
function formatTextNodeValue (line 201) | function formatTextNodeValue(node, preformatted, elementBoundary) {
function isPreformattedElement (line 231) | function isPreformattedElement(node) {
function isHiddenElement (line 256) | function isHiddenElement(node) {
function isElementNode (line 284) | function isElementNode(node) {
function isTextNode (line 295) | function isTextNode(node) {
function isInlineLevelElement (line 306) | function isInlineLevelElement(element) {
function isNodeTextValueWhitespaceOnly (line 331) | function isNodeTextValueWhitespaceOnly(node) {
function getNodeTreeDepth (line 342) | function getNodeTreeDepth(node) {
function generateElementUUID (line 359) | function generateElementUUID() {
FILE: lib/html-entity-handler/entityhandler.js
constant NAMED_CHARACTER_REFERENCES (line 1) | const NAMED_CHARACTER_REFERENCES = {
function decode (line 2235) | function decode(string) {
function encode (line 2268) | function encode(string) {
FILE: popup/js/background-proxy.js
function registerPortListener (line 38) | function registerPortListener(port) {
function messageHandler (line 48) | function messageHandler(response) {
FILE: popup/js/browser-action.js
function isWithinBrowserNamespace (line 257) | function isWithinBrowserNamespace(url) {
function isWithinBrowserWebsiteNamespace (line 275) | function isWithinBrowserWebsiteNamespace(url) {
function isPDF (line 293) | function isPDF(url) {
function isLocalFile (line 303) | function isLocalFile(url) {
FILE: popup/js/history.js
function prune (line 117) | function prune(history) {
FILE: popup/js/options-pane.js
function applyOptions (line 290) | function applyOptions() {
function adaptOptions (line 308) | function adaptOptions(newOptions) {
function getIndexHighlightColorCode (line 321) | function getIndexHighlightColorCode() {
function getAllHighlightColorCode (line 335) | function getAllHighlightColorCode() {
function applyToggleOptions (line 348) | function applyToggleOptions() {
function applyMaxResultsSliderOptions (line 369) | function applyMaxResultsSliderOptions() {
function applyIndexHighlightColorSliderOptions (line 384) | function applyIndexHighlightColorSliderOptions() {
function applyAllHighlightColorSliderOptions (line 424) | function applyAllHighlightColorSliderOptions() {
function HSVToRGB (line 513) | function HSVToRGB(hue, saturation, value) {
function RGBToHSV (line 560) | function RGBToHSV(red, green, blue) {
function hexColorCodeToRGB (line 595) | function hexColorCodeToRGB(hexCode) {
function RGBToHexColorCode (line 617) | function RGBToHexColorCode(red, green, blue) {
FILE: popup/js/saved-expressions-pane.js
function buildExpressionEntryElement (line 137) | function buildExpressionEntryElement(regex) {
function buildNullExpressionEntryElement (line 214) | function buildNullExpressionEntryElement() {
FILE: popup/js/search-pane.js
function flashElement (line 243) | function flashElement(el) {
function formatNumber (line 290) | function formatNumber(x) {
FILE: popup/js/storage.js
function retrieve (line 132) | function retrieve(key, callback) {
function save (line 152) | function save(key, data, callback) {
Condensed preview — 43 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (451K chars).
[
{
"path": ".github/ISSUE_TEMPLATE.md",
"chars": 127,
"preview": "## Issue Description\n\n## Steps to Reproduce\n- .\n- .\n- .\n\n## Tasks\n- [ ] t1\n- [ ] t2\n- [ ] t3\n\n## Screenshots and Documen"
},
{
"path": ".github/PULL_REQUEST_TEMPLATE.md",
"chars": 111,
"preview": "## Fixes #\n\n### Changes Proposed in this Pull Request:\n- .\n- .\n- .\n\n### Additional Comments and Documentation:\n"
},
{
"path": ".gitignore",
"chars": 15,
"preview": "/.idea/\n.build/"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 3227,
"preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, w"
},
{
"path": "CONTRIBUTING.md",
"chars": 2011,
"preview": "# Contributing to {find+}\n\nWe need help! We feel this project has great potential, but there is a lot of\nwork to go arou"
},
{
"path": "LICENSE",
"chars": 35141,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
},
{
"path": "PRIVACY.md",
"chars": 378,
"preview": "# Find+ Privacy Policy\n\nFind+ does not collect any data of any kind.\n\n- Find+ is run on the client, only. There are no e"
},
{
"path": "README.md",
"chars": 6459,
"preview": "<img src=\"resources/icon.png\" align=\"right\" width=\"128\" />\n\n# **{find+}**\n\n[;\nimportScripts('./browser-action-proxy.js');\nimportScripts('./content-proxy.js"
},
{
"path": "build.sh",
"chars": 3229,
"preview": "#!/usr/bin/env bash\n\nME=$0\nROOT_DIR=$PWD\nBUILD_DIR=\"$ROOT_DIR/.build\"\nMANIFEST=\"$ROOT_DIR/manifest.json\"\nVERSION=\n\n# Dis"
},
{
"path": "content/content.js",
"chars": 2456,
"preview": "'use strict';\n\n/**\n * Create the Content namespace. This component is injected into the\n * page and delegates messages t"
},
{
"path": "content/highlighter.js",
"chars": 13470,
"preview": "'use strict';\n\n/**\n * Create the Content Highlighter namespace. This component is injected into\n * the page and is used "
},
{
"path": "content/parser.js",
"chars": 9787,
"preview": "'use strict';\n\n/**\n * Create the Content Parser namespace. This component is injected into the\n * page and constructs a "
},
{
"path": "docs/_config.yml",
"chars": 25,
"preview": "theme: jekyll-theme-slate"
},
{
"path": "docs/help.css",
"chars": 8468,
"preview": "body {\n background-color: #292929;\n}\n\n@font-face {\n font-family: octicons-link;\n src: url(data:font/woff;charse"
},
{
"path": "docs/index.html",
"chars": 15442,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n\t<meta charset=\"UTF-8\">\n\t<title>Find+ User Guide</title>\n\t<link rel=\"stylesheet\""
},
{
"path": "lib/html-entity-handler/entityhandler.js",
"chars": 151443,
"preview": "const NAMED_CHARACTER_REFERENCES = {\n \"Á\": { \"codepoints\": [193], \"characters\": \"\\u00C1\" },\n \"Á\": { \""
},
{
"path": "manifest.json",
"chars": 1370,
"preview": "{\n \"name\": \"__MSG_extension_name__\",\n \"short_name\": \"find+\",\n \"version\": \"1\",\n \"author\": [\n \"Michael Walz\",\n \""
},
{
"path": "manifest_firefox.json",
"chars": 1253,
"preview": "{\n \"name\": \"__MSG_extension_name__\",\n \"short_name\": \"find+\",\n \"version\": \"1\",\n \"author\": \"Brandon Richardson, Michae"
},
{
"path": "popup/css/extension.css",
"chars": 1761,
"preview": "/* Styles Common to Entire Extension */\n\nbody {\n margin: 3px;\n width: 410px;\n background-color: white;\n}\n\ndiv.p"
},
{
"path": "popup/css/messagepane.css",
"chars": 460,
"preview": "/* Message Pane Style */\ndiv.pane#extension-message-body {\n padding: 0;\n}\n\ntable#message-table {\n background-color"
},
{
"path": "popup/css/optionspane.css",
"chars": 3446,
"preview": "/* Extension Options Pane */\ntable#regex-options-table {\n width: 100%;\n padding: 5px;\n}\n\ntd.options-table-toggle-c"
},
{
"path": "popup/css/replacepane.css",
"chars": 941,
"preview": "/* Replace Pane Body */\ndiv#replace-body-container {\n max-width: 100%;\n display: flex;\n justify-content: center"
},
{
"path": "popup/css/savedexpressionspane.css",
"chars": 883,
"preview": "/* extension message style */\ndiv#saved-expressions-body {\n overflow: hidden;\n}\n\ndiv#saved-expressions-body-header-co"
},
{
"path": "popup/css/searchpane.css",
"chars": 1700,
"preview": "/* Search Pane Style */\ndiv#popup-body {\n width: 100%;\n}\n\ndiv#popup-body-container {\n max-width: 100%;\n display"
},
{
"path": "popup/js/background-proxy.js",
"chars": 2140,
"preview": "'use strict';\n\n/**\n * Create the Popup BackgroundProxy namespace.\n * */\nFind.register('Popup.BackgroundProxy', function "
},
{
"path": "popup/js/browser-action.js",
"chars": 10864,
"preview": "'use strict';\n\n/**\n * Create the Popup BrowserAction namespace.\n * */\nFind.register('Popup.BrowserAction', function (sel"
},
{
"path": "popup/js/history.js",
"chars": 3686,
"preview": "'use strict';\n\n/**\n * Create the Popup History namespace.\n *\n * This namespace is responsible for retrieving and persist"
},
{
"path": "popup/js/i18n.js",
"chars": 1581,
"preview": "'use strict';\n\n/**\n * Create the Popup BackgroundProxy namespace.\n * */\nFind.register('Popup.i18n', function (self) {\n\n "
},
{
"path": "popup/js/message-pane.js",
"chars": 1214,
"preview": "'use strict';\n\n/**\n * Create the Popup MessagePane namespace.\n * */\nFind.register('Popup.MessagePane', function (self) {"
},
{
"path": "popup/js/options-pane.js",
"chars": 26963,
"preview": "'use strict';\n\n/**\n * Create the Popup OptionsPane namespace.\n * */\nFind.register('Popup.OptionsPane', function (self) {"
},
{
"path": "popup/js/replace-pane.js",
"chars": 2487,
"preview": "'use strict';\n\n/**\n * Create the Popup ReplacePane namespace.\n * */\nFind.register('Popup.ReplacePane', function (self) {"
},
{
"path": "popup/js/saved-expressions-pane.js",
"chars": 8157,
"preview": "'use strict';\n\n/**\n * Create the Popup SavedExpressionsPane namespace.\n * */\nFind.register('Popup.SavedExpressionsPane',"
},
{
"path": "popup/js/search-pane.js",
"chars": 10847,
"preview": "'use strict';\n\n/**\n * Create the Popup SearchPane namespace.\n * */\nFind.register('Popup.SearchPane', function (self) {\n\n"
},
{
"path": "popup/js/storage.js",
"chars": 5538,
"preview": "'use strict';\n\n/**\n * Create the Popup Storage namespace.\n *\n * This storage is lockable. When locked, reads from storag"
},
{
"path": "popup/popup.html",
"chars": 18402,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <title>popup.html</title>\n <sc"
}
]
About this extraction
This page contains the full source code of the brandon1024/find GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 43 files (402.1 KB), approximately 117.4k tokens, and a symbol index with 46 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.