Spaces:
Running
Running
File size: 22,913 Bytes
b43dd2e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Social Profile Data Analyzer - Educational Demo</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
--primary: #5931ea;
--primary-dark: #4a25c7;
--secondary: #ff6b6b;
--success: #51cf66;
--warning: #ffd43b;
--dark: #2d3436;
--light: #f8f9fa;
--border: #dee2e6;
--shadow: rgba(0, 0, 0, 0.1);
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 20px;
}
.container {
max-width: 1200px;
margin: 0 auto;
}
header {
background: white;
border-radius: 20px;
padding: 30px;
margin-bottom: 30px;
box-shadow: 0 20px 40px var(--shadow);
animation: slideDown 0.5s ease;
}
.header-content {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 20px;
}
h1 {
color: var(--dark);
font-size: 2rem;
display: flex;
align-items: center;
gap: 10px;
}
.logo {
width: 40px;
height: 40px;
background: var(--primary);
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-weight: bold;
}
.attribution {
color: var(--primary);
text-decoration: none;
font-weight: 500;
transition: opacity 0.3s;
}
.attribution:hover {
opacity: 0.8;
}
.warning-banner {
background: linear-gradient(135deg, #ff6b6b, #ff8787);
color: white;
padding: 20px;
border-radius: 15px;
margin-bottom: 30px;
animation: pulse 2s infinite;
}
.warning-banner h2 {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 10px;
}
.main-content {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 30px;
margin-bottom: 30px;
}
.card {
background: white;
border-radius: 20px;
padding: 30px;
box-shadow: 0 10px 30px var(--shadow);
animation: fadeIn 0.6s ease;
}
.card h2 {
color: var(--dark);
margin-bottom: 20px;
display: flex;
align-items: center;
gap: 10px;
}
.feature-grid {
display: grid;
gap: 15px;
}
.feature-item {
display: flex;
align-items: center;
gap: 15px;
padding: 15px;
background: var(--light);
border-radius: 10px;
transition: transform 0.3s, box-shadow 0.3s;
}
.feature-item:hover {
transform: translateX(5px);
box-shadow: 0 5px 15px var(--shadow);
}
.feature-icon {
width: 40px;
height: 40px;
background: linear-gradient(135deg, var(--primary), var(--primary-dark));
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 20px;
}
.demo-section {
background: white;
border-radius: 20px;
padding: 30px;
box-shadow: 0 10px 30px var(--shadow);
margin-bottom: 30px;
}
.demo-tabs {
display: flex;
gap: 10px;
margin-bottom: 20px;
border-bottom: 2px solid var(--border);
}
.tab-btn {
padding: 12px 24px;
background: none;
border: none;
color: var(--dark);
font-weight: 500;
cursor: pointer;
position: relative;
transition: color 0.3s;
}
.tab-btn.active {
color: var(--primary);
}
.tab-btn.active::after {
content: '';
position: absolute;
bottom: -2px;
left: 0;
right: 0;
height: 2px;
background: var(--primary);
}
.tab-content {
display: none;
animation: fadeIn 0.3s;
}
.tab-content.active {
display: block;
}
.code-block {
background: #2d3436;
color: #dfe6e9;
padding: 20px;
border-radius: 10px;
overflow-x: auto;
margin-top: 15px;
}
.code-block pre {
margin: 0;
font-family: 'Courier New', monospace;
font-size: 14px;
line-height: 1.5;
}
.install-steps {
display: grid;
gap: 15px;
}
.step-item {
display: flex;
gap: 15px;
padding: 20px;
background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
border-radius: 10px;
align-items: start;
}
.step-number {
width: 30px;
height: 30px;
background: var(--primary);
color: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
flex-shrink: 0;
}
.ethical-section {
background: linear-gradient(135deg, #f093fb, #f5576c);
color: white;
border-radius: 20px;
padding: 30px;
margin-bottom: 30px;
}
.ethical-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
margin-top: 20px;
}
.ethical-item {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
padding: 20px;
border-radius: 10px;
border: 1px solid rgba(255, 255, 255, 0.2);
}
.ethical-item h3 {
margin-bottom: 10px;
display: flex;
align-items: center;
gap: 10px;
}
.btn {
padding: 12px 24px;
background: var(--primary);
color: white;
border: none;
border-radius: 10px;
font-weight: 500;
cursor: pointer;
transition: all 0.3s;
display: inline-flex;
align-items: center;
gap: 10px;
}
.btn:hover {
background: var(--primary-dark);
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(89, 49, 234, 0.3);
}
.btn-secondary {
background: var(--secondary);
}
.btn-secondary:hover {
background: #ff5252;
}
@keyframes slideDown {
from {
opacity: 0;
transform: translateY(-20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes pulse {
0%, 100% {
transform: scale(1);
}
50% {
transform: scale(1.02);
}
}
@media (max-width: 768px) {
.main-content {
grid-template-columns: 1fr;
}
h1 {
font-size: 1.5rem;
}
.ethical-grid {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<div class="container">
<header>
<div class="header-content">
<h1>
<div class="logo">π¦</div>
Social Profile Analyzer - Educational Demo
</h1>
<a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="attribution">
Built with anycoder
</a>
</div>
</header>
<div class="warning-banner">
<h2>β οΈ Important Ethical Notice</h2>
<p>This is an <strong>educational demonstration</strong> only. Real browser extensions that extract private data (passwords, messages, etc.) are illegal and unethical. Always respect user privacy and comply with laws like GDPR and CCPA. This demo only shows publicly available information that's already visible on the page.</p>
</div>
<div class="main-content">
<div class="card">
<h2>π§ Extension Features (Demo)</h2>
<div class="feature-grid">
<div class="feature-item">
<div class="feature-icon">π€</div>
<div>
<h3>Public Profile Info</h3>
<p>Extract publicly visible profile names and bios</p>
</div>
</div>
<div class="feature-item">
<div class="feature-icon">π</div>
<div>
<h3>Public Statistics</h3>
<p>View follower counts and public metrics</p>
</div>
</div>
<div class="feature-item">
<div class="feature-icon">πΌοΈ</div>
<div>
<h3>Public Images</h3>
<p>Display publicly shared profile pictures</p>
</div>
</div>
<div class="feature-item">
<div class="feature-icon">π±</div>
<div>
<h3>Platform Detection</h3>
<p>Identify social media platform type</p>
</div>
</div>
</div>
</div>
<div class="card">
<h2>π‘οΈ Security & Ethics</h2>
<div class="feature-grid">
<div class="feature-item">
<div class="feature-icon">π</div>
<div>
<h3>No Password Access</h3>
<p>Never attempts to access passwords or credentials</p>
</div>
</div>
<div class="feature-item">
<div class="feature-icon">π«</div>
<div>
<h3>No Private Messages</h3>
<p>Does not read or extract private communications</p>
</div>
</div>
<div class="feature-item">
<div class="feature-icon">π</div>
<div>
<h3>GDPR Compliant</h3>
<p>Only processes publicly available information</p>
</div>
</div>
<div class="feature-item">
<div class="feature-icon">β
</div>
<div>
<h3>Transparent</h3>
<p>All actions are visible to the user</p>
</div>
</div>
</div>
</div>
</div>
<div class="demo-section">
<h2>π Extension Code Structure</h2>
<div class="demo-tabs">
<button class="tab-btn active" onclick="switchTab('manifest')">manifest.json</button>
<button class="tab-btn" onclick="switchTab('content')">content.js</button>
<button class="tab-btn" onclick="switchTab('popup')">popup.js</button>
<button class="tab-btn" onclick="switchTab('background')">background.js</button>
</div>
<div id="manifest" class="tab-content active">
<h3>Extension Manifest Configuration</h3>
<div class="code-block">
<pre>{
"manifest_version": 2,
"name": "Social Profile Analyzer (Educational)",
"version": "1.0.0",
"description": "Educational demo for analyzing public social media profiles",
"permissions": [
"activeTab",
"storage"
],
"content_scripts": [{
"matches": ["*://*.facebook.com/*", "*://*.twitter.com/*", "*://*.instagram.com/*"],
"js": ["content.js"]
}],
"browser_action": {
"default_popup": "popup.html",
"default_icon": "icon.png"
},
"background": {
"scripts": ["background.js"]
}
}</pre>
</div>
</div>
<div id="content" class="tab-content">
<h3>Content Script - Public Data Extraction Only</h3>
<div class="code-block">
<pre>// Educational: Extract only PUBLICLY visible information
class PublicProfileAnalyzer {
analyzeProfile() {
const data = {
platform: this.detectPlatform(),
publicInfo: this.extractPublicInfo(),
timestamp: new Date().toISOString()
};
// Only extract what's already visible on the page
return data;
}
detectPlatform() {
const hostname = window.location.hostname;
if (hostname.includes('facebook')) return 'Facebook';
if (hostname.includes('twitter')) return 'Twitter';
if (hostname.includes('instagram')) return 'Instagram';
return 'Unknown';
}
extractPublicInfo() {
// Example: Get profile name from public elements
const nameElement = document.querySelector('h1, [data-testid="UserName"]');
const bioElement = document.querySelector('[data-testid="UserDescription"], .bio');
const followersElement = document.querySelector('[data-testid="UserFollowers"]');
return {
displayName: nameElement?.textContent || 'Not found',
bio: bioElement?.textContent?.substring(0, 100) || 'Not found',
followers: followersElement?.textContent || 'Not found'
};
}
}
// Initialize when page loads
window.addEventListener('load', () => {
const analyzer = new PublicProfileAnalyzer();
console.log('Educational: Analyzing public profile data only');
});</pre>
</div>
</div>
<div id="popup" class="tab-content">
<h3>Popup Interface - User Control Panel</h3>
<div class="code-block">
<pre>// popup.js - Extension popup interface
document.addEventListener('DOMContentLoaded', () => {
const analyzeBtn = document.getElementById('analyzeBtn');
const exportBtn = document.getElementById('exportBtn');
const clearBtn = document.getElementById('clearBtn');
analyzeBtn.addEventListener('click', () => {
chrome.tabs.query({active: true, currentWindow: true}, (tabs) => {
chrome.tabs.sendMessage(tabs[0].id, {
action: 'analyzePublicProfile'
}, (response) => {
displayResults(response);
});
});
});
exportBtn.addEventListener('click', () => {
const data = getCurrentData();
const blob = new Blob([JSON.stringify(data, null, 2)],
{type: 'application/json'});
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'public-profile-data.json';
a.click();
});
clearBtn.addEventListener('click', () => {
chrome.storage.local.clear();
document.getElementById('results').innerHTML = '';
});
});
function displayResults(data) {
const resultsDiv = document.getElementById('results');
resultsDiv.innerHTML = `
<div class="result-item">
<h3>${data.platform} Profile</h3>
<p>Name: ${data.publicInfo.displayName}</p>
<p>Bio: ${data.publicInfo.bio}</p>
<p>Followers: ${data.publicInfo.followers}</p>
</div>
`;
}</pre>
</div>
</div>
<div id="background" class="tab-content">
<h3>Background Script - Service Worker</h3>
<div class="code-block">
<pre>// background.js - Extension background service
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
if (request.action === 'analyzePublicProfile') {
// Log for educational purposes only
console.log('Educational: Processing public profile request');
// Store data locally with user consent
chrome.storage.local.set({
lastAnalysis: {
...request.data,
timestamp: Date.now(),
source: 'educational_demo'
}
});
sendResponse({status: 'success', data: request.data});
}
if (request.action === 'checkPermissions') {
chrome.permissions.contains({
permissions: ['activeTab']
}, (hasPermission) => {
sendResponse({allowed: hasPermission});
});
}
return true;
});
// Handle extension installation
chrome.runtime.onInstalled.addListener(() => {
console.log('Educational Extension Installed');
chrome.storage.local.set({
educationalMode: true,
privacyNoticeShown: false
});
});</pre>
</div>
</div>
</div>
<div class="ethical-section">
<h2>π Ethical Development Guidelines</h2>
<div class="ethical-grid">
<div class="ethical-item">
<h3>π Privacy First</h3>
<p>Always prioritize user privacy. Never collect or store sensitive personal information without explicit consent.</p>
</div>
<div class="ethical-item">
<h3>βοΈ Legal Compliance</h3>
<p>Follow GDPR, CCPA, and other privacy regulations. Ensure your extension complies with platform terms of service.</p>
</div>
<div class="ethical-item">
<h3>π User Control</h3>
<p>Give users full control over their data. Provide clear opt-outs and easy data deletion options.</p>
</div>
<div class="ethical-item">
<h3>π Transparency</h3>
<p>Be transparent about what your extension does. Provide clear documentation and privacy policies.</p>
</div>
</div>
</div>
<div class="demo-section">
<h2>π₯ Installation Instructions (Educational Demo)</h2>
<div class="install-steps">
<div class="step-item">
<div class="step-number">1</div>
<div>
<h3>Create Extension Folder</h3>
<p>Create a new folder on your computer and save the manifest.json, content.js, popup.html, popup.js, and background.js files.</p>
</div>
</div>
<div class="step-item">
<div class="step-number">2</div>
<div>
<h3>Open Firefox Extensions</h3>
<p>Type about:debugging in Firefox address bar and click "This Firefox" β "Load Temporary Add-on".</p>
</div>
</div>
<div class="step-item">
<div class="step-number">3</div>
<div>
<h3>Select Manifest</h3>
<p>Navigate to your extension folder and select the manifest.json file to load the extension.</p>
</div>
</div>
<div class="step-item">
<div class="step-number">4</div>
<div>
<h3>Test on Social Media</h3>
<p>Visit a social media site and click the extension icon to see the educational demo in action.</p>
</div>
</div>
</div>
<div style="margin-top: 20px; display: flex; gap: 10px;">
<button class="btn" onclick="downloadDemo()">
π₯ Download Demo Files
</button>
<button class="btn btn-secondary" onclick="showMoreInfo()">
π Learn More
</button>
</div>
</div>
</div>
<script>
function switchTab(tabName) {
// Hide all tabs
document.querySelectorAll('.tab-content').forEach(tab => {
tab.classList.remove('active');
});
// Remove active class from all buttons
document.querySelectorAll('.tab-btn').forEach(btn => {
btn.classList.remove('active');
});
// Show selected tab
document.getElementById(tabName).classList.add('active');
// Add active class to clicked button
event.target.classList.add('active');
}
function downloadDemo() {
alert('Demo files would be downloaded here. In a real implementation, this would bundle the extension files into a ZIP for download.');
}
function showMoreInfo() {
alert('For more information on ethical browser extension development, visit Mozilla Add-ons Developer Hub and review their policies on privacy and data collection.');
}
// Add some interactivity
document.querySelectorAll('.feature-item').forEach(item => {
item.addEventListener('click', function() {
this.style.transform = 'scale(0.95)';
setTimeout(() => {
this.style.transform = '';
}, 200);
});
});
</script>
</body>
</html> |