Skip to content

Commit 9a505ba

Browse files
Convert tool to Chrome extension
1 parent 279a96d commit 9a505ba

File tree

11 files changed

+659
-0
lines changed

11 files changed

+659
-0
lines changed

.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
VITE_SUPABASE_PROJECT_ID="oomaeqgizcctwrjzfpgr"
2+
VITE_SUPABASE_PUBLISHABLE_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im9vbWFlcWdpemNjdHdyanpmcGdyIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTc0OTQ0NTYsImV4cCI6MjA3MzA3MDQ1Nn0.4NlMI1cJUrgfxfJ2EY86K7tTUdePFD4TLzRQ0ixVdiU"
3+
VITE_SUPABASE_URL="https://oomaeqgizcctwrjzfpgr.supabase.co"

extension/README.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Plagiarism & AI Content Checker - Chrome Extension
2+
3+
A powerful Chrome extension that helps detect AI-generated content and potential plagiarism in selected text across any website.
4+
5+
## Features
6+
7+
- **Right-click Analysis**: Select text on any webpage, right-click, and choose "Plagiarism & AI Content Checker"
8+
- **Instant Detection**: Quickly analyze text for AI generation patterns and plagiarism
9+
- **Detailed Results**: Get percentage scores and highlighted segments showing different content types
10+
- **Clean Interface**: Professional popup design with easy-to-understand results
11+
- **Cross-site Compatibility**: Works on all websites and web pages
12+
13+
## Installation
14+
15+
### From Chrome Web Store (Recommended)
16+
1. Visit the Chrome Web Store
17+
2. Search for "Plagiarism & AI Content Checker"
18+
3. Click "Add to Chrome"
19+
4. Confirm installation
20+
21+
### Manual Installation (Developer Mode)
22+
1. Download or clone this repository
23+
2. Open Chrome and navigate to `chrome://extensions/`
24+
3. Enable "Developer mode" in the top-right corner
25+
4. Click "Load unpacked" and select the `extension` folder
26+
5. The extension will be installed and ready to use
27+
28+
## How to Use
29+
30+
### Method 1: Context Menu (Recommended)
31+
1. Select any text on a webpage
32+
2. Right-click to open the context menu
33+
3. Click "Plagiarism & AI Content Checker"
34+
4. The extension popup will open with your selected text ready for analysis
35+
5. Click "Analyze Text" or wait for automatic analysis
36+
37+
### Method 2: Manual Input
38+
1. Click the extension icon in the Chrome toolbar
39+
2. Paste or type your text in the input area
40+
3. Click "Analyze Text" to start the analysis
41+
4. Review the detailed results
42+
43+
## Results Explanation
44+
45+
The extension provides three main scores:
46+
47+
- **Original Content** (Green): Percentage of text that appears to be originally written
48+
- **AI Generated** (Orange): Percentage of text that shows patterns of AI generation
49+
- **Potentially Plagiarized** (Red): Percentage of text that may be copied from other sources
50+
51+
## Privacy & Security
52+
53+
- **No Data Collection**: Your text is analyzed locally and never sent to external servers
54+
- **Secure Processing**: All analysis happens within your browser
55+
- **No Account Required**: Use the extension without signing up or providing personal information
56+
57+
## Technical Details
58+
59+
- **Manifest Version**: 3 (Latest Chrome Extension standard)
60+
- **Permissions**:
61+
- `contextMenus`: For right-click menu integration
62+
- `activeTab`: For accessing selected text on current page
63+
- `storage`: For temporary text storage between context menu and popup
64+
- **Offline Capable**: Works without internet connection
65+
66+
## Development
67+
68+
### Building for Chrome Web Store
69+
70+
1. Ensure all files are in the `extension/` folder
71+
2. Zip the contents of the `extension/` folder (not the folder itself)
72+
3. The zip file should contain: `manifest.json`, `background.js`, `content.js`, `popup.html`, `popup.js`, and `icons/` folder
73+
4. Upload the zip file to the Chrome Web Store Developer Dashboard
74+
75+
### File Structure
76+
```
77+
extension/
78+
├── manifest.json # Extension configuration
79+
├── background.js # Service worker for context menu
80+
├── content.js # Content script for text selection
81+
├── popup.html # Extension popup interface
82+
├── popup.js # Popup functionality
83+
├── icons/ # Extension icons
84+
│ ├── icon16.png
85+
│ ├── icon32.png
86+
│ ├── icon48.png
87+
│ └── icon128.png
88+
└── README.md # This file
89+
```
90+
91+
## Version History
92+
93+
- **v1.0.0**: Initial release with context menu integration and text analysis
94+
95+
## Support
96+
97+
For issues or feature requests, please visit the Chrome Web Store listing or contact support.
98+
99+
## License
100+
101+
This extension is provided as-is for text analysis purposes. Please ensure you have the right to analyze any text you process.

extension/background.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Background script for Chrome extension
2+
chrome.runtime.onInstalled.addListener(() => {
3+
// Create context menu item
4+
chrome.contextMenus.create({
5+
id: "plagiarismChecker",
6+
title: "Plagiarism & AI Content Checker",
7+
contexts: ["selection"]
8+
});
9+
});
10+
11+
// Handle context menu clicks
12+
chrome.contextMenus.onClicked.addListener((info, tab) => {
13+
if (info.menuItemId === "plagiarismChecker" && info.selectionText) {
14+
// Store selected text
15+
chrome.storage.local.set({
16+
selectedText: info.selectionText,
17+
analysisRequested: true
18+
});
19+
20+
// Open extension popup
21+
chrome.action.openPopup();
22+
}
23+
});
24+
25+
// Listen for messages from content script or popup
26+
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
27+
if (request.action === "getSelectedText") {
28+
chrome.storage.local.get(["selectedText", "analysisRequested"], (result) => {
29+
sendResponse({
30+
text: result.selectedText || "",
31+
autoAnalyze: result.analysisRequested || false
32+
});
33+
34+
// Clear the flag after sending
35+
if (result.analysisRequested) {
36+
chrome.storage.local.set({ analysisRequested: false });
37+
}
38+
});
39+
return true; // Keep message channel open
40+
}
41+
});

extension/content.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Content script for handling text selection
2+
let selectedText = "";
3+
4+
// Track text selection
5+
document.addEventListener('mouseup', () => {
6+
const selection = window.getSelection();
7+
if (selection.toString().trim().length > 0) {
8+
selectedText = selection.toString().trim();
9+
}
10+
});
11+
12+
// Listen for messages from popup
13+
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
14+
if (request.action === "getCurrentSelection") {
15+
const selection = window.getSelection();
16+
const currentText = selection.toString().trim();
17+
sendResponse({ text: currentText || selectedText });
18+
}
19+
});
20+
21+
// Clear selection tracking on page navigation
22+
window.addEventListener('beforeunload', () => {
23+
selectedText = "";
24+
});

extension/icons/icon128.png

12.4 KB
Loading

extension/icons/icon16.png

13.6 KB
Loading

extension/icons/icon32.png

16.4 KB
Loading

extension/icons/icon48.png

13.2 KB
Loading

extension/manifest.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"manifest_version": 3,
3+
"name": "Plagiarism & AI Content Checker",
4+
"version": "1.0.0",
5+
"description": "Detect AI-generated content and potential plagiarism in selected text with advanced analysis.",
6+
"permissions": [
7+
"contextMenus",
8+
"activeTab",
9+
"storage"
10+
],
11+
"background": {
12+
"service_worker": "background.js"
13+
},
14+
"content_scripts": [
15+
{
16+
"matches": ["<all_urls>"],
17+
"js": ["content.js"]
18+
}
19+
],
20+
"action": {
21+
"default_popup": "popup.html",
22+
"default_title": "Plagiarism & AI Content Checker",
23+
"default_icon": {
24+
"16": "icons/icon16.png",
25+
"32": "icons/icon32.png",
26+
"48": "icons/icon48.png",
27+
"128": "icons/icon128.png"
28+
}
29+
},
30+
"icons": {
31+
"16": "icons/icon16.png",
32+
"32": "icons/icon32.png",
33+
"48": "icons/icon48.png",
34+
"128": "icons/icon128.png"
35+
},
36+
"web_accessible_resources": [
37+
{
38+
"resources": ["popup.html"],
39+
"matches": ["<all_urls>"]
40+
}
41+
]
42+
}

0 commit comments

Comments
 (0)