🛡️ A Chrome extension designed to analyze online shopping risks on platforms like Shopee using AI. It provides users with a quantitative Trust Score and highlights common issues found in 1-star reviews, helping them make safer purchasing decisions.
- AI-Powered Analysis: Leverages the Google Gemini API to analyze 1-star review text.
- Risk Classification: Identifies specific risk categories:
NonDelivery,Counterfeit,WrongItem,Damaged. - Bayesian Trust Score: Calculates a quantitative Trust Score using a hybrid Bayesian average formula, combining star ratings and AI-identified risks.
- Risk Level Indication: Provides clear "Low", "Medium", or "High" risk labels based on the Trust Score.
- On-Page Summary: Displays a concise summary and risk level directly on the product page via a non-intrusive banner (with minimize option).
- Detailed Popup Analytics: Offers a detailed view in the extension popup, including:
- A short, one-sentence summary of 1-star reviews.
- Sentiment analysis of 1-star reviews.
- A visual horizontal bar chart showing the top 3 identified issues.
- Original product star rating and total review count.
- Caching: Caches analysis results locally to avoid repeated API calls for the same product within a time window.
- Privacy Focused: Only analyzes publicly visible review data; no personal user data is collected or transmitted.
- JavaScript (ES6+): Core logic for content scripts, background script, and popup.
- HTML5: Structure for the popup UI.
- CSS3: Styling and layout, including flexbox and animations.
- Chrome Extension APIs: For content injection, background processing, popup, storage, and messaging.
- Google Gemini API: For AI-powered review analysis and classification.
- Git: Version control.
Prerequisites: A Google Chrome browser.
- Download: Click the green "Code" button on this repository and select "Download ZIP".
- Extract: Unzip the downloaded file to a folder on your computer (e.g.,
e-com-sentinel-main). - Open Chrome: Launch Google Chrome.
- Navigate to Extensions: Type
chrome://extensionsin the address bar and press Enter. - Enable Developer Mode: Toggle the "Developer mode" switch in the top-right corner.
- Load Unpacked: Click the "Load unpacked" button.
- Select Folder: Navigate to and select the extracted folder (e.g.,
e-com-sentinel-main). - Install: The extension should now appear in your list of extensions.
Warning
This step is crucial for the extension to work.
- Obtain an API Key: Visit Google AI Studio and create an API key for the Gemini API.
- Edit
background.js: Inside the extracted folder, open thebackground.jsfile in a text editor (like Notepad, VS Code, etc.). - Find the API Key Line: Look for the line containing
const GEMINI_API_KEY = "YOUR_API_KEY_HERE";. - Replace the Placeholder: Replace
"YOUR_API_KEY_HERE"with your actual Google Gemini API key.const GEMINI_API_KEY = "your_actual_api_key_here";
- Save the File: Save the changes to
background.js. - Reload Extension: Go back to
chrome://extensions, find E-Com Sentinel, and click the "Reload" button (or pressCtrl+Ron the extensions page).
The extension is now ready to use.
- Navigate to a product page on Shopee (or any supported platform if the script is adapted).
- The extension will automatically start analyzing the 1-star reviews (if enabled).
- A banner will appear at the top of the page showing the risk level, a short summary, and the Trust Score.
- Click the extension icon in the Chrome toolbar to open the popup for detailed analytics.
- Data Fetching: The
page-context-script.jsfetches 1-star review text from the Shopee product page API. - Data Processing: The
content.jsscript receives this data and sends it to thebackground.jsscript. - AI Analysis: The
background.jsscript uses the Google Gemini API to:- Classify review text into risk categories (
NonDelivery,Counterfeit, etc.). - Generate a short summary of the 1-star reviews.
- Classify review text into risk categories (
- Trust Score Calculation: A Bayesian formula is applied, combining the product's overall star rating, the number of reviews, and the severity/quantity of issues found by the AI in 1-star reviews.
- UI Display: The calculated Trust Score, risk level, summary, and top issues are sent back to
content.js(for the page banner) and stored locally for the popup (popup.html,popup.js). - Caching: The analysis results are cached using
chrome.storage.localfor the current product URL.