|
1 | 1 | # KozeGaav Chrome Extension
|
2 | 2 |
|
3 |
| -Getting your rides history from [Snapp application][snapppwa]. |
4 |
| - |
5 |
| -<img src="assests/Header.png" width="800"> |
6 |
| -<img src="assests/Info.png" width="800"> |
7 |
| - |
8 |
| -Note: you can see count and price of each bar chart on hover: |
| 3 | +Getting your rides and food orders history from [Snapp application][snapppwa] and [Snappfood][snappfood]. |
9 | 4 |
|
| 5 | +<img src="assests/Summary.png" width="800"> |
10 | 6 | <img src="assests/Hours.png" width="800">
|
| 7 | +<img src="assests/Months.png" width="800"> |
11 | 8 |
|
12 | 9 | # What is Snapp?
|
13 | 10 |
|
14 |
| -You can think of [Iranian version of Uber][snappwiki]. Their public repository is available in [here][snapprepo]. |
| 11 | +You can think of [Iranian version of Uber][snappwiki]. Their public repository is available [here][snapprepo]. |
15 | 12 |
|
16 |
| -# How the Extension Works? |
| 13 | +# What is Snappfood? |
17 | 14 |
|
18 |
| -1. After installing the extension you need to sign in into your Snapp account. |
19 |
| -2. When you open [https://app.snapp.taxi][snapppwa] page a script injects into the HTML `body`. |
20 |
| -3. The script read `access-token` from the page and create a new `CustomEvent` with `access-token` and dispatched by `window`. |
21 |
| -4. In `contentscript` we listen to the upcoming event message from the injected script. After getting the message, we save `access-token` by using [chrome.storage][chromestorage] API. |
22 |
| -5. Every time you click on MySnapp extension's icon we read `access-token` from `chrome.storage` and then set a state in the mounted React component (popup). |
23 |
| -6. Now we have `access-token` as a state in our component. When you click on `Let's Go` button, the App is going request to Snapp API with your `access-token` |
24 |
| -7. After your data received from Snapp API, we use `chrome.storage` for caching. And for the next time when you click on `Let's Go` button, we show your saved data. |
| 15 | +[Snappfood][snappfood] is Iran's leading online food delivery platform, similar to UberEats or DoorDash. It's part of the Snapp! ecosystem, allowing users to order food from thousands of restaurants across Iran. |
25 | 16 |
|
26 |
| -# Privacy Policy |
| 17 | +# Features |
27 | 18 |
|
28 |
| -**All codes executed on the client-side** and the extension is only for **personal usage**. For analyzing the data we need to get your local `access-token` from the Snapp PWA. After signing in the token will be saved in chrome storage API. You can remove the extension to destroy your `accessToken` completely. |
| 19 | +- View your Snapp ride history with detailed statistics |
| 20 | +- View your Snappfood order history with detailed statistics |
| 21 | +- See your biggest Snappfood order |
| 22 | +- View statistics by hour, day, week, month, and year |
| 23 | +- View total spending and count for rides/orders |
| 24 | +- Beautiful charts and visualizations |
| 25 | +- Data caching for faster access |
| 26 | +- Automatic update detection for new rides/orders |
29 | 27 |
|
30 |
| -# Contributing [WIP] |
| 28 | +# Installation |
31 | 29 |
|
32 |
| -Pull requests are welcome. We can discuss what you would like to change. |
| 30 | +## Quick Start (Until we publish in Chrome store) |
33 | 31 |
|
34 |
| -# Installation [WIP] |
| 32 | +<img src="assests/Chrome.png" width="800"> |
35 | 33 |
|
36 |
| -Start: (use dist folder to install on Chrome) |
| 34 | +1. Unzip the extension, you can download it from GitHub releases or telegram channel |
| 35 | +2. Go to Chrome > Extensions > Manage Extensions and enable Developer Mode |
| 36 | +3. Click on "Load Unpacked" on Chrome Manage extensions page and choose the unzipped folder |
| 37 | +4. Sign in to your Snapp account at [app.snapp.taxi][snapppwa] and your Snappfood account at [snappfood.ir][snappfood] |
| 38 | +5. Click on the extension icon in Chrome to view your statistics! |
37 | 39 |
|
38 |
| -``` |
39 |
| -cd my-snapp-extension |
| 40 | +## Development Setup |
| 41 | + |
| 42 | +Start development server (use dist folder to install on Chrome): |
| 43 | +```bash |
| 44 | +cd kozegaav |
40 | 45 | npm ci && cd src/popup && npm ci && cd ../..
|
41 | 46 | npm start
|
42 | 47 | ```
|
43 | 48 |
|
44 |
| -Build: (my-snapp-extension.zip) |
45 |
| - |
46 |
| -``` |
47 |
| -npm run tada |
| 49 | +Build extension package: |
| 50 | +```bash |
| 51 | +npm run tada # Creates kozegaav.zip |
48 | 52 | ```
|
49 | 53 |
|
50 |
| -### Todo |
| 54 | +# How the Extension Works? |
| 55 | + |
| 56 | +## For Snapp Rides: |
| 57 | +1. After installing the extension you need to sign in to your Snapp account |
| 58 | +2. When you open [https://app.snapp.taxi][snapppwa], a script injects into the HTML `body` |
| 59 | +3. The script reads `access-token` from the page and creates a new `CustomEvent` with `access-token` and dispatches it via `window` |
| 60 | +4. In `contentscript` we listen to the upcoming event message from the injected script. After getting the message, we save `access-token` using [chrome.storage][chromestorage] API |
| 61 | +5. Every time you click on the extension's icon, we read `access-token` from `chrome.storage` and set it as a state in the mounted React component (popup) |
| 62 | +6. When you click on "Get Snapp Rides", the app requests data from Snapp API with your `access-token` |
| 63 | +7. After your data is received, we use `chrome.storage` for caching. Next time you click the button, we first check if there are new rides before fetching all data again |
| 64 | + |
| 65 | +## For Snappfood Orders: |
| 66 | +1. Sign in to your Snappfood account at [snappfood.ir][snappfood] |
| 67 | +2. When you click "Get Snappfood Orders" in the extension, we use your browser's cookies to authenticate with Snappfood's API |
| 68 | +3. The app fetches your order history page by page and processes the data |
| 69 | +4. Like with Snapp rides, we cache the data and check for new orders before fetching everything again |
| 70 | +5. All data processing happens locally in your browser |
| 71 | + |
| 72 | +# Privacy Policy |
51 | 73 |
|
52 |
| -- [ ] #feat update new rides manually/automatically (needs to store the last ride id) |
53 |
| -- [ ] #feat porting **MySnapp** to Safari Web Extensions [issue [#1][#1]] |
54 |
| -- [ ] #feat porting **MySnapp** to Firefox Add-ons (maybe we can use it on Android devices) |
| 74 | +**All codes executed on the client-side** and the extension is only for **personal usage**. For analyzing the data: |
| 75 | +- For Snapp rides, we need your local `access-token` from the Snapp PWA |
| 76 | +- For Snappfood orders, we use your browser's cookies to authenticate with Snappfood |
| 77 | +- All authentication data is saved in chrome storage API |
| 78 | +- You can remove the extension at any time to destroy all stored data completely |
| 79 | +- No data is ever sent to any third-party servers |
| 80 | +- All data processing happens locally in your browser |
55 | 81 |
|
56 |
| -### In Progress |
| 82 | +The extension only accesses the minimum required data to show your ride and order statistics. Your privacy and data security are our top priority. |
57 | 83 |
|
58 |
| -- [ ] add a **scroll to bottom** button to the pages |
| 84 | +# Credits & Background |
59 | 85 |
|
60 |
| -### Done |
| 86 | +This extension is a fork and enhancement of [My Snapp](https://github.com/sepehrity/my-snapp-extension), which is no longer maintained. We've built upon the original project by: |
| 87 | +- Fixing compatibility with recent Chrome updates |
| 88 | +- Adding Snappfood integration |
| 89 | +- Adding new statistics and visualizations |
| 90 | +- Improving data caching and performance |
| 91 | +- Enhancing the user interface |
| 92 | +- Implementing automatic update detection |
61 | 93 |
|
62 |
| -- [x] #bug car charts show duplicate data --- resolved in [!3][!3] |
| 94 | +Special thanks to the original My Snapp developers for laying the groundwork for this project. |
63 | 95 |
|
64 | 96 | [snapppwa]: https://app.snapp.taxi
|
65 | 97 | [snappwiki]: https://en.wikipedia.org/wiki/Snapp!
|
66 | 98 | [snapprepo]: https://github.com/snapp-cab
|
67 |
| -[chromestorage]: https://developer.chrome.com/extensions/storage |
| 99 | +[chromestorage]: https://developer.chrome.com/extensions/storage |
| 100 | +[snappfood]: https://snappfood.ir |
0 commit comments