https://github.com/extrawest/chrome-extension-training
https://github.com/extrawest/chrome-extension-training
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/extrawest/chrome-extension-training
- Owner: extrawest
- Created: 2021-10-07T12:13:59.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-07T12:28:03.000Z (over 4 years ago)
- Last Synced: 2025-03-30T17:46:37.589Z (about 1 year ago)
- Language: TypeScript
- Size: 644 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chrome extension training: Currency Converter
### Milestones:
- [Basics](./milestones/basics.md)
- [Webpack configuration](./milestones/webpack.md)
- [Options page](./milestones/options.md)
- [Content and background scripts](./milestones/scripts.md)
- [Browser actions](./milestones/actions.md)
### General use case:
- Once extension get installed *Options page* is opened programmatically.
The page includes title, short description, dropdown select for the base currency and multiple select for the target currencies.
For example, base currency set to UAH and target ones to [USD, EUR].
- If extension is enabled, when user selects any text on any webpage content script checks whether selected text content includes any numeric value.
Parsing result examples:
```javascript
input1 = '...before 1928 measured 7.42 in × 3.125 in (188.5 mm × 79.4 mm)...' // 1928
input2 = '...measured 7.42 in × 3.125 in (188.5 mm × 79.4 mm)...' // 7.42
input3 = '...Today, USD notes are made from cotton fiber paper...' // null
```
- If selection includes the numeric value (for example 100), content script appends a button near the selected text.
- If user clicks outside the button, it disappears.
- If user clicks the button, extension appends a closable popup with a table near the selected area.
- As the base currency is UAH, target ones are USD and EUR and selected value is 100, the table should include two rows:
- USD - 3.6033
- EUR - 2.9711
- When user clicks browser action (extension icon at the toolbar) it shows a popup with:
- a title (extension name)
- a button which allows to activate/deactivate the extension for all the webpages
- a link to the options page
>Currency rates are provided by the [API](https://hovorun.herokuapp.com/).
>As it's free, server falls asleep every hour and initial request may take about 5 seconds.
>Every next request will be executed much faster.
>Mocks and images will be mentioned further can be found in **./assets** folder.