1
0
mirror of https://github.com/XFox111/PasswordGeneratorExtension.git synced 2026-04-22 08:08:01 +03:00

Version 1.0 (initial commit)

This commit is contained in:
Michael Gordeev
2020-10-06 16:27:04 +03:00
parent b824eec2dd
commit c56539f618
27 changed files with 1413 additions and 2 deletions
+33
View File
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve the extension
title: ''
labels: bug
assignees: ''
---
### Description
A clear and concise description of what the bug is.
### Reproduction steps
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '...'
3. Scroll down to '...'
4. See error
### Expected behavior
A clear and concise description of what you expected to happen.
### Screenshots
If applicable, add screenshots to help explain your problem.
### Environment
Please provide the following information:
- Operating System: [e.g. Windows 10 Pro 1909 (10.0.18363)]
- Browser: [e.g. Microsoft Edge 83.0.478.56]
- Extension version: [e.g. 1.5]
### Additional context
Add any other context about the problem here.
+20
View File
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when '...'
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
+9
View File
@@ -0,0 +1,9 @@
fixes:
## Changelog
- Item 1
- Item 2
- Item 3
## PR Checklist
- [ ] Change extension version in the manifest
+74
View File
@@ -0,0 +1,74 @@
name: CI
on:
workflow_dispatch:
push:
branches: [ master ]
paths:
# Trigger deploy on manifest change
- 'manifest.json'
jobs:
Firefox:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build Extension for Firefox
id: web-ext-build
uses: kewisch/action-web-ext@v1
with:
cmd: build
- name: Sign build
id: web-ext-sign
uses: kewisch/action-web-ext@v1
with:
cmd: sign
channel: listed
source: ${{ steps.web-ext-build.outputs.target }}
apiKey: ${{ secrets.FIREFOX_API_KEY }}
apiSecret: ${{ secrets.FIREFOX_CLIENT_SECRET }}
- name: Publish to Firefox Webstore
uses: trmcnvn/firefox-addon@v1
with:
uuid: passwordgenerator@xfox111.net
xpi: ${{ steps.web-ext-sign.outputs.target }}
manifest: ./manifest.json
api-key: ${{ secrets.FIREFOX_API_KEY }}
api-secret: ${{ secrets.FIREFOX_CLIENT_SECRET }}
- name: Drop artifacts
uses: actions/upload-artifact@v2
with:
name: 'Firefox Artefacts'
path: ${{ steps.web-ext-sign.outputs.target }}
Chrome:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Pack extension
uses: TheDoctor0/zip-release@0.4.1
with:
filename: ./PasswordGenerator.zip
exclusions: '.git/* .vscode/* .github/* *.md'
- name: Publish to Chrome Webstore
uses: SebastienGllmt/chrome-addon@v3
with:
extension: jnjobgjobffgmgfnkpkjfjkkfhfikmfl
zip: ./PasswordGenerator.zip
client-id: ${{ secrets.CHROME_CLIENT_ID }}
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
- name: Drop artifacts
uses: actions/upload-artifact@v2
with:
name: 'Chrome Artifacts'
path: ./PasswordGenerator.zip
+1
View File
@@ -0,0 +1 @@
.vscode
+76
View File
@@ -0,0 +1,76 @@
# 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, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, 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 opensource@xfox111.net. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and 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 https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
+204
View File
@@ -0,0 +1,204 @@
# Contribution Guidelines
Welcome, and thank you for your interest in contributing to my project!
There are many ways in which you can contribute, beyond writing code. The goal of this document is to provide a high-level overview of how you can get involved.
## Table of Contents
- [Contribution Guidelines](#contribution-guidelines)
- [Table of Contents](#table-of-contents)
- [Asking Questions](#asking-questions)
- [Providing Feedback](#providing-feedback)
- [Reporting Issues](#reporting-issues)
- [Look For an Existing Issue](#look-for-an-existing-issue)
- [Writing Good Bug Reports and Feature Requests](#writing-good-bug-reports-and-feature-requests)
- [Final Checklist](#final-checklist)
- [Follow Your Issue](#follow-your-issue)
- [Contributing to codebase](#contributing-to-codebase)
- [Deploy test version on your browser](#deploy-test-version-on-your-browser)
- [Development workflow](#development-workflow)
- [Release](#release)
- [Coding guidelines](#coding-guidelines)
- [Indentation](#indentation)
- [Names](#names)
- [Comments](#comments)
- [Strings](#strings)
- [Style](#style)
- [Finding an issue to work on](#finding-an-issue-to-work-on)
- [Contributing to translations](#contributing-to-translations)
- [Submitting pull requests](#submitting-pull-requests)
- [Spell check errors](#spell-check-errors)
- [Thank You!](#thank-you)
- [Attribution](#attribution)
## Asking Questions
Have a question? Rather than opening an issue, please ask me directly on opensource@xfox111.net.
## Providing Feedback
Your comments and feedback are welcome.
You can leave your feedbak on feedback@xfox111.net or do it on [Microsoft Edge Add-ons Webstore](https://microsoftedge.microsoft.com/addons/detail/manimdhobjbkfpeeehlhhneookiokpbj), [Chrome Extensions Webstore](https://chrome.google.com/webstore/detail/jnjobgjobffgmgfnkpkjfjkkfhfikmfl) or [Mozilla Add-ons Webstore](https://addons.mozilla.org/en-US/firefox/addon/easy-password-generator/)
## Reporting Issues
Have you identified a reproducible problem in the extension? Have a feature request? I'd like to hear it! Here's how you can make reporting your issue as effective as possible.
### Look For an Existing Issue
Before you create a new issue, please do a search in [open issues](https://github.com/xfox111/PasswordGeneratorExtension/issues) to see if the issue or feature request has already been filed.
Be sure to scan through the [feature requests](https://github.com/XFox111/PasswordGeneratorExtension/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement).
If you find your issue already exists, make relevant comments and add your [reaction](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments). Use a reaction in place of a "+1" comment:
* 👍 - upvote
* 👎 - downvote
If you cannot find an existing issue that describes your bug or feature, create a new issue using the guidelines below.
### Writing Good Bug Reports and Feature Requests
File a single issue per problem and feature request. Do not enumerate multiple bugs or feature requests in the same issue.
Do not add your issue as a comment to an existing issue unless they are the same ones. Many issues look similar, but have different causes.
The more information you can provide, the more likely someone will be successful at reproducing the issue and finding a solution.
Please include the following with each issue:
- Current version of the extension
- Your current browser and OS name
- Reproducible steps (1... 2... 3...) that cause the issue
- What you expected to see, versus what you actually saw
- Images, animations, or a link to a video showing the issue occurring
### Final Checklist
Please remember to do the following:
- [ ] Search the issue repository to ensure your report is a new issue
- [ ] Separate issues reports
- [ ] Include as much information as you can to your report
Don't feel bad if the developers can't reproduce the issue right away. They will simply ask for more information!
### Follow Your Issue
Once your report is submitted, be sure to stay in touch with the devs in case they need more help from you.
## Contributing to codebase
If you are interested in writing code to fix issues or implement new awesome features you can follow this guidelines to get a better result
### Deploy test version on your browser
1. Clone repository to local storage using [Git](https://guides.github.com/introduction/git-handbook/)
```
git clone https://github.com/xfox111/PasswordGeneratorExtension.git
```
2. Enable Developers mode on your browser extensions page
3. Click "Load unpacked" button and navigate to the extension root folder (contains `manifest.json`)
4. Done!
Next time you make any changes to the codebase, reload extension by toggling it off and on or by pressing "Reload" button on extensions list page
### Development workflow
This section represents how contributors should interact with codebase implementing features and fixing bugs
1. Getting assigned to the issue
2. Creating a repository fork
3. Making changes to codebase
5. Creating a pull request to `master`
6. Reviewing & completing PR
7. Done
#### Release
Next stage is release. Release performs on every push to master (which makes functional changes to the source code). Release performs manually by @XFox111 into: Chrome webstore, Edge webstore and GitHub releases
### Coding guidelines
#### Indentation
We use tabs, not spaces.
#### Names
The project naming rules inherit [.NET Naming Guidelines](https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/naming-guidelines). Nevertheless there'is some distinction with the guidelines as well as additions to the one:
- Use `camelCase` for variables instead of `CamelCase` stated in [Capitalization Conventions](https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/capitalization-conventions#capitalization-rules-for-identifiers)
- Use `snake_case` for file names
#### Comments
Leave as more comments as you can. Remember: the more detailed documentation your code has the less programmers will curse you in the future
#### Strings
Use "double quotes" wherever it's possible
#### Style
- Prefer to use lambda functions
- Put curly braces on new lines
- Wrong:
```
if (condition) {
...
}
```
- Correct:
```
if (condition)
{
...
}
```
- Put spaces between operators and before braces in methods declarations, conditionals and loops
- Wrong:
- `y=k*x+b`
- `function FunctionName()`
- Correct:
- `y = k * x + b`
- `function FunctionName ()`
- Use ternary conditionals wherever it's possible
- Wrong:
```
var s;
if (condition)
s = "Life";
else
s = "Death"
```
- Correct:
```
var s = condition ? "Life" : "Death";
```
- Do not surround loop and conditional bodies with curly braces if they can be avoided
- Wrong:
```
if (condition)
{
console.log("Hello, World!");
}
else
{
return;
}
```
- Correct
```
if (condition)
console.log("Hello, World!");
else
return;
```
### Finding an issue to work on
Check out the [full issues list](https://github.com/XFox111/PasswordGeneratorExtension/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue) for a list of all potential areas for contributions. **Note** that just because an issue exists in the repository does not mean we will accept a contribution. There are several reasons we may not accept a pull request like:
- Performance - One of project's core values is to deliver a lightweight extension, that means it should perform well in both real and test environments.
- User experience - Since we want to deliver a lightweight extension, the UX should feel lightweight as well and not be cluttered. Most changes to the UI should go through the issue owner and project owner (@XFox111).
- Architectural - Project owner needs to agree with any architectural impact a change may make. Such things must be discussed with and agreed upon by the project owner.
To improve the chances to get a pull request merged you should select an issue that is labelled with the `help-wanted` or `bug` labels. If the issue you want to work on is not labelled with `help-wanted` or `bug`, you can start a conversation with the project owner asking whether an external contribution will be considered.
To avoid multiple pull requests resolving the same issue, let others know you are working on it by saying so in a comment.
### Contributing to translations
If you want to help us to translate this extension into other languages, please read [this article](https://developer.chrome.com/extensions/i18n)
**Note** that whatever you want to contribute to the codebase, you should do it only after you got assigned on an issue
### Submitting pull requests
To enable us to quickly review and accept your pull requests, always create one pull request per issue and [link the issue in the pull request](https://github.com/blog/957-introducing-issue-mentions). Never merge multiple requests in one unless they have the same root cause. Be sure to follow our [Coding Guidelines](#coding-guidelines) and keep code changes as small as possible. Avoid pure formatting changes to code that has not been modified otherwise. Pull requests should contain tests whenever possible. Fill pull request content according to its template. Deviations from template are not recommended
#### Spell check errors
Pull requests that fix typos are welcomed but please make sure it doesn't touch multiple feature areas, otherwise it will be difficult to review. Pull requests only fixing spell check errors in source code are not recommended.
## Thank You!
Your contributions to open source, large or small, make great projects like this possible. Thank you for taking the time to contribute.
## Attribution
This Contribution Guidelines are adapted from the [Contributing to VS Code](https://github.com/microsoft/vscode/blob/master/CONTRIBUTING.md)
+7
View File
@@ -0,0 +1,7 @@
Password generator Extension Privacy Policy
1. Developers of the extension don't affiliate with Google LLC, Mozilla Foundation or Microsoft Corporation in any way
2. This extension doesn't transfer any personal data (data which may be used to track your location or reveal your identity) to any remote or local server
3. This extension doesn't share any personal data with third parties
4. This extension stores following personal data:
- Browser tabs which have been saved for later by user via this extension (if user click "Set current tabs aside" button). This includes titles, favicons and web links
5. User can delete all saved personal data by removing this extension from his Browser
+59 -2
View File
@@ -1,2 +1,59 @@
# PasswordGeneratorExtension # Password generator
Extension for web browsers which helps you to easily generate strong passwords [![GitHub release (latest by date)](https://img.shields.io/github/v/release/xfox111/PasswordGeneratorExtension)](https://github.com/xfox111/PasswordGeneratorExtension/releases/latest)
![CI](https://github.com/XFox111/PasswordGeneratorExtension/workflows/CI/badge.svg)
[![Chrome Web Store](https://img.shields.io/chrome-web-store/users/jnjobgjobffgmgfnkpkjfjkkfhfikmfl?label=Chrome%20Webstore%20downloads)](https://chrome.google.com/webstore/detail/jnjobgjobffgmgfnkpkjfjkkfhfikmfl)
[![Chrome Web Store](https://img.shields.io/chrome-web-store/rating/jnjobgjobffgmgfnkpkjfjkkfhfikmfl)](https://chrome.google.com/webstore/detail/jnjobgjobffgmgfnkpkjfjkkfhfikmfl)
[![Mozilla Add-on](https://img.shields.io/amo/users/easy-password-generator?label=Firefox%20Webstore%20downloads)](https://addons.mozilla.org/firefox/addon/easy-password-generator/)
[![Mozilla Add-on](https://img.shields.io/amo/rating/easy-password-generator)](https://addons.mozilla.org/firefox/addon/easy-password-generator/)
[![Mozilla Add-on](https://img.shields.io/amo/dw/easy-password-generator)](https://addons.mozilla.org/firefox/addon/easy-password-generator/)
[![GitHub issues](https://img.shields.io/github/issues/xfox111/PasswordGeneratorExtension)](https://github.com/xfox111/PasswordGeneratorExtension/issues)
[![GitHub last commit](https://img.shields.io/github/last-commit/xfox111/PasswordGeneratorExtension)](https://github.com/xfox111/PasswordGeneratorExtension/commits/master)
[![GitHub repo size](https://img.shields.io/github/repo-size/xfox111/PasswordGeneratorExtension?label=repo%20size)](https://github.com/xfox111/PasswordGeneratorExtension)
[![MIT License](https://img.shields.io/github/license/xfox111/PasswordGeneratorExtension)](https://opensource.org/licenses/MIT)
[![Twitter Follow](https://img.shields.io/twitter/follow/xfox111?style=social)](https://twitter.com/xfox111)
[![GitHub followers](https://img.shields.io/github/followers/xfox111?label=Follow%20@xfox111&style=social)](https://github.com/xfox111)
[![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-%40xfox111-orange)](https://buymeacoffee.com/xfox111)
![Password generator](https://xfox111.net/1cj439)
Extension for web browsers which helps you to easily generate strong passwords in one click
## Features
- Create strong passwords in one click
- Customizable generator
- Clean and simple UI
- Dark mode
## Download
- [Google Chrome Webstore](https://chrome.google.com/webstore/detail/jnjobgjobffgmgfnkpkjfjkkfhfikmfl)
- [Microsoft Edge Add-ons Webstore](https://microsoftedge.microsoft.com/addons/detail/manimdhobjbkfpeeehlhhneookiokpbj)
- [Firefox Add-ons](https://addons.mozilla.org/en-US/firefox/addon/easy-password-generator/)
- [GitHub Releases](https://github.com/xfox111/PasswordGeneratorExtension/releases/latest)
## Contributing
There are many ways in which you can participate in the project, for example:
- [Submit bugs and feature requests](https://github.com/xfox111/PasswordGeneratorExtension/issues), and help us verify as they are checked in
- Review [source code changes](https://github.com/xfox111/PasswordGeneratorExtension/pulls)
- Review documentation and make pull requests for anything from typos to new content
If you are interested in fixing issues and contributing directly to the code base, please see the [Contribution Guidelines](https://github.com/XFox111/PasswordGeneratorExtension/blob/master/CONTRIBUTING.md), which covers the following:
- [How to deploy the extension on your browser](https://github.com/XFox111/PasswordGeneratorExtension/blob/master/CONTRIBUTING.md#deploy-test-version-on-your-browser)
- [The development workflow](https://github.com/XFox111/PasswordGeneratorExtension/blob/master/CONTRIBUTING.md#development-workflow), including debugging and running tests
- [Coding guidelines](https://github.com/XFox111/PasswordGeneratorExtension/blob/master/CONTRIBUTING.md#coding-guidelines)
- [Submitting pull requests](https://github.com/XFox111/PasswordGeneratorExtension/blob/master/CONTRIBUTING.md#submitting-pull-requests)
- [Finding an issue to work on](https://github.com/XFox111/PasswordGeneratorExtension/blob/master/CONTRIBUTING.md#finding-an-issue-to-work-on)
- [Contributing to translations](https://github.com/XFox111/PasswordGeneratorExtension/blob/master/CONTRIBUTING.md#contributing-to-translations)
## Code of Conduct
This project has adopted the Contributor Covenant. For more information see the [Code of Conduct](https://github.com/XFox111/PasswordGeneratorExtension/blob/master/CODE_OF_CONDUCT.md)
## Copyrights
> ©2020 Michael "XFox" Gordeev
Font copyrights: Microsoft Corportation ©2019 (Additional ELUA applied)
Licensed under [MIT License](https://opensource.org/licenses/MIT)
+135
View File
@@ -0,0 +1,135 @@
{
"name":
{
"message": "Password generator",
"description": "Extension name. Displayed in the manifest and pane header"
},
"description":
{
"message": "Password generator extension allows you to easily generate long and secure password in one click",
"description": "Extension description"
},
"author":
{
"message": "Michael \"XFox\" Gordeev",
"description": "Author's name"
},
"generate":
{
"message": "Generate password",
"description": "Main action label"
},
"success":
{
"message": "Password has been generated and copied to your clipboard",
"description": "Message which is shown after successful creation of a password"
},
"fail":
{
"message": "Invalid generator settings. No password was generated",
"description": "Message which is shown after a creation of password failed"
},
"generatorOptions":
{
"message": "Generator options",
"description": "Generator options group header"
},
"length":
{
"message": "Password length",
"description": "Input field header"
},
"hint":
{
"message": "Reccommended password length",
"description": "Password length field hint"
},
"includeSymbols":
{
"message": "Include symbols (e.g.",
"description": "Option checkbox label"
},
"includeNumbers":
{
"message": "Include numbers (e.g.",
"description": "Option checkbox label"
},
"includeLowercase":
{
"message": "Include lowercase characters (e.g.",
"description": "Option checkbox label"
},
"includeUppercase":
{
"message": "Include uppercase characters (e.g.",
"description": "Option checkbox label"
},
"excludeSimilar":
{
"message": "Exclude similar characters (e.g.",
"description": "Option checkbox label"
},
"excludeSpecial":
{
"message": "Exclude ambiguous characters (e.g.",
"description": "Option checkbox label"
},
"extOptions":
{
"message": "Extension options",
"description": "Extension options group header"
},
"showButton":
{
"message": "Insert \"Generate password\" button below password fields",
"description": "Option checkbox label"
},
"showContext":
{
"message": "Add \"Generate password\" action to context menu",
"description": "Option checkbox label"
},
"more":
{
"message": "More",
"description": "About section toggle button caption"
},
"about":
{
"message": "About",
"description": "About info header"
},
"developed":
{
"message": "Developed by",
"description": ""
},
"website":
{
"message": "My website",
"description": "My website link caption"
},
"github":
{
"message": "Source code",
"description": "GitHub repo link caption"
},
"changelog":
{
"message": "Changelog",
"description": "Changelog link caption"
},
"feedback":
{
"message": "Leave feedback",
"description": "Feedback CTA button"
},
"bmc":
{
"message": "Buy me a coffee",
"description": "BMC CTA button cation"
}
}
+135
View File
@@ -0,0 +1,135 @@
{
"name":
{
"message": "Генератор паролей",
"description": "Extension name. Displayed in the manifest and pane header"
},
"description":
{
"message": "Расширение, позволяющее вам легко генерировать сложные и надежные пароли в один клик",
"description": "Extension description"
},
"author":
{
"message": "Михаил \"XFox\" Гордеев",
"description": "Author's name"
},
"generate":
{
"message": "Сгенерировать пароль",
"description": "Main action label"
},
"success":
{
"message": "Пароль сгенерирован и скопирован в ваш буфер обмена",
"description": "Message which is shown after successful creation of a password"
},
"fail":
{
"message": "Установлены неправильные настройки генератора. Ничего не было сгенерировано",
"description": "Message which is shown after a creation of password failed"
},
"generatorOptions":
{
"message": "Настройки генератора",
"description": "Generator options group header"
},
"length":
{
"message": "Длина пароля",
"description": "Input field header"
},
"hint":
{
"message": "Рекомендованная длина пароля",
"description": "Password length field hint"
},
"includeSymbols":
{
"message": "Включить символы (например:",
"description": "Option checkbox label"
},
"includeNumbers":
{
"message": "Включить цифры (например:",
"description": "Option checkbox label"
},
"includeLowercase":
{
"message": "Включить буквы нижнего регистра (например:",
"description": "Option checkbox label"
},
"includeUppercase":
{
"message": "Включить буквы верхнего регистра (например:",
"description": "Option checkbox label"
},
"excludeSimilar":
{
"message": "Исключить похожие символы (например:",
"description": "Option checkbox label"
},
"excludeSpecial":
{
"message": "Исключить специальные символы (например:",
"description": "Option checkbox label"
},
"extOptions":
{
"message": "Настройки расширения",
"description": "Extension options group header"
},
"showButton":
{
"message": "Добавлять кнопку \"Сгенерировать пароль\" рядом с каждым полем ввода пароля",
"description": "Option checkbox label"
},
"showContext":
{
"message": "Добавить действие \"Сгенерировать пароль\" в контекстное меню браузера",
"description": "Option checkbox label"
},
"more":
{
"message": "Больше",
"description": "About section toggle button caption"
},
"about":
{
"message": "О расширении",
"description": "About info header"
},
"developed":
{
"message": "Разработал:",
"description": ""
},
"website":
{
"message": "Мой веб-сайт",
"description": "My website link caption"
},
"github":
{
"message": "Исходный код",
"description": "GitHub repo link caption"
},
"changelog":
{
"message": "Список изменений",
"description": "Changelog link caption"
},
"feedback":
{
"message": "Оставить отзыв",
"description": "Feedback CTA button"
},
"bmc":
{
"message": "Поддержать автора",
"description": "BMC CTA button cation"
}
}
+238
View File
@@ -0,0 +1,238 @@
/* Fluent UI styles */
@font-face
{
font-family: "Segoe UI";
src: local("Segoe UI"),
url("fonts/segoeui.ttf") format("truetype"),
}
@font-face
{
font-family: "Segoe MDL2 Assets";
src: local("Segoe MDL2 Assets"),
url("fonts/segoemdl2.ttf") format("truetype"),
}
body
{
font-family: "Segoe UI";
user-select: none;
white-space: nowrap;
font-size: 14px;
line-height: 20px;
color: rgb(50, 49, 48);
border-radius: 2px;
}
h1, h2, h3
{
font-weight: 400;
margin: 0px;
}
h1
{
font-size: 28px;
font-weight: 400;
line-height: 36px;
}
h2
{
font-size: 20px;
font-weight: 400;
line-height: 28px;
}
.group
{
margin-bottom: 10px;
}
.group > *
{
display: block;
}
button.accent, a.button
{
font-weight: 600;
background-color: #0078d4;
cursor: pointer;
color: white !important;
border: 1px solid #0078d4;
border-radius: 2px;
padding: 0px 16px;
height: 32px;
min-width: 80px;
text-align: center;
outline: none !important;
text-decoration: none !important;
}
button.accent:hover, a.button:hover
{
background-color: rgb(16, 110, 190);
border: 1px solid rgb(16, 110, 190);
}
button.accent:active, a.button:active
{
background-color: rgb(0, 90, 158);
border: 1px solid rgb(0, 90, 158);
}
a.button
{
display: inline-block;
line-height: 28px;
vertical-align: bottom;
box-sizing: border-box;
}
button.link, a, a:visited
{
color: rgb(0, 120, 212);
background: none;
outline: none;
border: none;
cursor: pointer;
text-decoration: none;
}
button.link:hover, a:hover, a:visited:hover
{
color: rgb(0, 69, 120);
text-decoration: underline;
}
button.link:hover
{
text-decoration: none;
}
button.link:hover span
{
text-decoration: underline;
}
button.link i
{
font-family: "Segoe MDL2 Assets";
font-style: normal;
font-size: 16px;
margin-left: 4px;
vertical-align: bottom;
}
input[type=number]
{
padding-left: 9px;
padding-right: 9px;
height: 32px;
width: 100%;
border: 1px solid rgb(96, 94, 92);
box-sizing: border-box;
outline: none;
cursor: text;
}
input[type=number]:active, input[type=number]:focus
{
border: 2px solid rgb(0, 120, 212);
}
p
{
margin: 0px;
}
.control.checkbox
{
position: relative;
padding-left: 32px;
cursor: pointer;
margin-bottom: 5px;
}
.control.checkbox input
{
position: absolute;
opacity: 0;
width: 0;
height: 0;
}
.control.checkbox input + span
{
position: absolute;
left: 0;
height: 20px;
width: 20px;
border: 1px solid rgb(50, 49, 48);
border-radius: 2px;
transition-property: background, border, border-color;
transition-duration: 200ms;
transition-timing-function: cubic-bezier(0.4, 0, 0.23, 1);
}
.control.checkbox input + span::after
{
position: absolute;
color: rgb(96, 94, 92);
font-family: "Segoe MDL2 Assets";
content: "\E001";
width: 20px;
height: 20px;
text-align: center;
display: none;
}
.control.checkbox input:checked + span::after
{
display: block;
color: white;
}
.control.checkbox:hover input + span::after
{
display: block;
}
.control.checkbox input:checked + span
{
background-color: rgb(0, 120, 212);
border-color: rgb(0, 120, 212);
}
.control.checkbox:hover input:checked + span
{
background-color: rgb(0, 90, 158);
border-color: rgb(0, 90, 158);
}
/* Custom CSS */
.bmc
{
display: inline-grid !important;
grid-template-columns: auto 1fr;
grid-column-gap: 10px;
align-items: center;
background-color: #FF813F !important;
border-color: #FF813F !important;
color: white !important;
text-decoration: none;
height: 32px;
}
.bmc svg
{
height: 20px;
}
.bmc span
{
margin-bottom: 2px;
}
+42
View File
@@ -0,0 +1,42 @@
body, input
{
color: #EDEBE9;
background-color: rgb(51, 51, 51);
}
input[type=number]:active, input[type=number]:focus
{
border-color: rgb(40, 153, 245);
}
button.link, a, a:visited
{
color: rgb(40, 153, 245);
}
button.link:hover, a:hover, a:visited:hover
{
color: #7DBAE9;
}
.control.checkbox input + span
{
border-color: rgb(243, 242, 241);
}
.control.checkbox input:checked + span
{
background-color: rgb(40, 153, 245);
border-color: rgb(40, 153, 245);
}
.control.checkbox:hover input:checked + span
{
background-color: rgb(108, 184, 246);
border-color: rgb(108, 184, 246);
}
.control.checkbox:hover input + span:after
{
color: rgb(161, 159, 157);
}
.control.checkbox input:checked + span:after
{
color: rgb(27, 26, 25);
}
+1
View File
@@ -0,0 +1 @@
You may use the Segoe MDL2 Assets and Segoe UI fonts or glyphs included in this file (“Software”) solely to design, develop and test your programs for Microsoft Office. Microsoft Office includes but is not limited to any software product or service branded by trademark, trade dress, copyright or some other recognized means, as a product or service of Microsoft Office. This license does not grant you the right to distribute or sublicense all or part of the Software to any third party. By using the Software you agree to these terms. If you do not agree to these terms, do not use the Segoe MDL2 and Segoe UI Fonts or Glyphs.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 641 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

+35
View File
@@ -0,0 +1,35 @@
function AddContextMenu()
{
chrome.contextMenus.create(
{
id: "generate",
contexts: [ "all" ],
title: chrome.i18n.getMessage("generate")
}
);
}
// Setting up context menu event listener
chrome.contextMenus.onClicked.addListener(() => GeneratePassword(null));
// Adding context menu entry if needed
chrome.runtime.onInstalled.addListener(() =>
{
// Adding context menu option
chrome.storage.sync.get({ showContext: true }, (settings) =>
{
if (settings.showContext !== false)
AddContextMenu();
});
});
chrome.storage.onChanged.addListener((changes, area) =>
{
if (area != "sync" || changes["showContext"] == null)
return;
if (changes["showContext"].newValue === false)
chrome.contextMenus.removeAll();
else
AddContextMenu();
});
+64
View File
@@ -0,0 +1,64 @@
// Loading input fields states
chrome.storage.sync.get(
{
// Set of settings keys we retrieve and their default values
// Generator settings
length: 16,
includeSymbols: true,
includeNumbers: true,
includeLowercase: true,
includeUppercase: true,
excludeSimilar: true,
excludeSpecial: true,
// Extension settings
showButton: true,
showContext: true
},
(settings) =>
{
if (window.matchMedia("(prefers-color-scheme: dark)").matches) // Doesn't work on Fiefox
document.querySelector("#darkStylesheet").removeAttribute("disabled");
document.querySelector("#length").value = settings.length; // Setting length value
// Setting checkboxes
[
"includeSymbols",
"includeNumbers",
"includeLowercase",
"includeUppercase",
"excludeSimilar",
"excludeSpecial",
"showButton",
"showContext"
].forEach(i => document.querySelector("#" + i).checked = settings[i]);
SetupEventHandlers();
document.querySelector("#version").textContent = "v" + chrome.runtime.getManifest()["version"]; // Updating display version
document.querySelectorAll("*[loc]").forEach(i => i.textContent = chrome.i18n.getMessage(i.getAttribute("loc"))); // Updating localization
});
function SetupEventHandlers()
{
document.querySelectorAll("input").forEach(i =>
i.addEventListener("input",
() => chrome.storage.sync.set(JSON.parse("{ \"" + i.id + "\": " + (i.type == "checkbox" ? i.checked : i.value) + " }"))));
document.querySelector("#generate").addEventListener("click", () => GeneratePassword(null));
document.querySelector("#more").addEventListener("click", (s) =>
{
let group = document.querySelector("#about");
if (group.hasAttribute("hidden"))
{
group.removeAttribute("hidden");
s.currentTarget.querySelector("i").textContent = "";
}
else
{
group.setAttribute("hidden", "");
s.currentTarget.querySelector("i").textContent = "";
}
});
}
+108
View File
@@ -0,0 +1,108 @@
// Some constants
const upperCase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const lowerCase = upperCase.toLowerCase();
const numbers = "1234567890";
const specialCharacters = "@#$%";
const ambiguousCharacters = "{}[]()/\\'\"`~,;:.<>";
const similarCharacters = "il1Lo0O";
chrome.storage.sync.get({ showButton: true },
(settings) =>
{
if (settings.showButton)
InsertButtons();
}
);
// Adding button below every password field
function InsertButtons()
{
document.querySelectorAll("input[type=password]").forEach(i =>
{
let actionLink = document.createElement("a");
actionLink.innerText = chrome.i18n.getMessage("generate");
actionLink.style.margin = "5px";
actionLink.style.display = "block";
// Since anchor without 'href' attrubute isn't shown as a hyperlink and '#' link potentially can break some sites logic, we add empty JS function
actionLink.href = "javascript:void(0);";
actionLink.addEventListener("click", GeneratePassword);
i.insertAdjacentElement("afterend", actionLink); // Adding button after a password field
});
}
function GeneratePassword(e)
{
// Generating password
let availableCharacters = ""; // Set of available characters to generate a password from
chrome.storage.sync.get(
{
length: 16,
includeSymbols: true,
includeNumbers: true,
includeLowercase: true,
includeUppercase: true,
excludeSimilar: true,
excludeSpecial: true
},
(settings) =>
{
// Adding or excluding characters from the set
if (settings.includeSymbols)
availableCharacters += specialCharacters;
if (settings.includeNumbers)
availableCharacters += numbers;
if (settings.includeLowercase)
availableCharacters += lowerCase;
if (settings.includeUppercase)
availableCharacters += upperCase;
if (settings.excludeSimilar)
similarCharacters.split("").forEach(i => availableCharacters = availableCharacters.replace(i, ""));
if (settings.excludeSpecial === false)
availableCharacters += ambiguousCharacters;
if (availableCharacters.length < 1)
{
alert(chrome.i18n.getMessage("fail"));
return;
}
let password = "";
for (k = 0; k < settings.length; k++)
password += availableCharacters[GetRandomInt(0, availableCharacters.length)]; // Picking random characters
let field = e?.target.previousElementSibling;
// Creating a hidden field if called as standalone
if (!field)
{
field = document.createElement("input");
document.body.appendChild(field);
}
field.value = password; // Setting generated password to the field
field.setAttribute("type", "text"); // Since we cannot copy text from a password field, we'll make it temporarly simple field
// Some JS clipboard copying stuff
field.select();
document.execCommand("copy");
// Setting field type back to 'password'
field.setAttribute("type", "password");
if (!e)
field.remove();
alert(chrome.i18n.getMessage("success"));
});
}
// See https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Math/random
function GetRandomInt(min, max)
{
return Math.floor(Math.random() * (max - min)) + min;
}
+53
View File
@@ -0,0 +1,53 @@
{
"name": "__MSG_name__",
"version": "1.0",
"manifest_version": 2,
"description": "__MSG_description__",
"author": "__MSG_author__",
"default_locale": "en",
"permissions":
[
"storage",
"<all_urls>",
"contextMenus",
"clipboardWrite"
],
"content_scripts":
[
{
"matches": [ "<all_urls>" ],
"js": [ "js/script.js" ],
"run_at": "document_idle",
"all_frames": true
}
],
"background":
{
"scripts": [ "js/background.js", "js/script.js" ],
"persistent": false
},
"icons":
{
"128": "icons/icon-128.png",
"48": "icons/icon-48.png",
"32": "icons/icon-32.png",
"16": "icons/icon-16.png"
},
"browser_action":
{
"default_icon": "icons/icon-32.png",
"default_popup": "options.html"
},
"browser_specific_settings":
{
"gecko":
{
"id": "passwordgenerator@xfox111.net",
"strict_min_version": "58.0"
}
}
}
+119
View File
File diff suppressed because one or more lines are too long