Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The extension is now available on the Chrome Web Store! [**Install it directly f

## πŸš€ Stable Release

For the most stable and fully tested version, [**download the latest release here**](https://github.com/sevilayerkan/test-string-extention/releases/tag/1.0.1).
For the most stable and fully tested version, [**download the latest release here**](https://github.com/sevilayerkan/test-string-extention/releases/tag/v0.2.0-alpha).

> **Note:** The `main` branch is pre-production and may include features under development. For production use, always prefer the latest release above.

Expand Down
154 changes: 151 additions & 3 deletions background.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,151 @@
chrome.action.onClicked.addListener(function (tab) {
chrome.runtime.connect({ name: 'popup' });
});
// Background Service Worker for Test String Generator Extension

// Handle extension installation and updates
if (typeof chrome !== 'undefined' && chrome.runtime) {
chrome.runtime.onInstalled.addListener((details) => {
if (details.reason === 'install') {
console.log('Test String Generator extension installed');

// Set default settings
chrome.storage.sync.set({
theme: 'light',
language: 'en'
}).catch(err => {
console.warn('Failed to set default settings:', err);
});
} else if (details.reason === 'update') {
console.log('Test String Generator extension updated');

// Handle version migration if needed
handleVersionUpdate(details.previousVersion);

// Show update notification
showUpdateNotification();
}
});
}

// Handle extension startup
if (typeof chrome !== 'undefined' && chrome.runtime) {
chrome.runtime.onStartup.addListener(() => {
console.log('Test String Generator extension started');
});

// Handle messages from content scripts or popup
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
// Handle any background tasks if needed in the future
console.log('Background received message:', request);

// Always respond to keep the message channel open
sendResponse({ status: 'received' });

return true; // Keep message channel open for async operations
});

// Handle external connections
chrome.runtime.onConnect.addListener((port) => {
if (port.name === 'popup') {
console.log('Popup connected');

port.onDisconnect.addListener(() => {
console.log('Popup disconnected');
});
}
});
}

// Handle context menu creation (if needed in future)
// chrome.contextMenus.create({
// id: 'generate-test-string',
// title: 'Generate Test String',
// contexts: ['editable']
// });

// Keep service worker alive by periodically performing tasks
if (typeof chrome !== 'undefined' && chrome.storage) {
const keepAlive = () => {
// Perform a lightweight operation
chrome.storage.local.set({ lastHeartbeat: Date.now() });
};

// Set up heartbeat every 20 seconds
setInterval(keepAlive, 20000);
}

// Update handling functions
function handleVersionUpdate(previousVersion) {
const currentVersion = chrome.runtime.getManifest().version;
console.log(`Updated from ${previousVersion} to ${currentVersion}`);

// Handle data migration between versions if needed
if (previousVersion && chrome.storage) {
migrateDataIfNeeded(previousVersion, currentVersion);
}
}

function showUpdateNotification() {
// Create a notification for the update
if (chrome.notifications) {
chrome.notifications.create('update-notification', {
type: 'basic',
iconUrl: 'assets/icon48.png',
title: 'Test String Generator Updated!',
message: 'New features and improvements are now available.'
});
}
}

function migrateDataIfNeeded(previousVersion, currentVersion) {
// Example: Migrate old settings format to new format
chrome.storage.sync.get(null).then(data => {
let needsMigration = false;

// Add migration logic here based on version comparisons
if (compareVersions(previousVersion, '1.1.0') < 0) {
// Migrate to v1.1.0 format if needed
console.log('Migrating to v1.1.0 format...');
needsMigration = true;
}

if (needsMigration) {
chrome.storage.sync.set(data).then(() => {
console.log('Data migration completed');
});
}
}).catch(err => {
console.warn('Migration failed:', err);
});
}

function compareVersions(version1, version2) {
const v1parts = version1.split('.').map(Number);
const v2parts = version2.split('.').map(Number);

for (let i = 0; i < Math.max(v1parts.length, v2parts.length); i++) {
const v1part = v1parts[i] || 0;
const v2part = v2parts[i] || 0;

if (v1part < v2part) return -1;
if (v1part > v2part) return 1;
}

return 0;
}

// Check for updates periodically (optional)
function checkForUpdates() {
if (chrome.runtime.requestUpdateCheck) {
chrome.runtime.requestUpdateCheck((status, details) => {
if (status === 'update_available') {
console.log('Update available:', details);
// Optionally restart to apply update immediately
// chrome.runtime.reload();
}
});
}
}

// Set up periodic update checks (every 24 hours)
setInterval(checkForUpdates, 24 * 60 * 60 * 1000);

console.log('Test String Generator background script loaded');
49 changes: 48 additions & 1 deletion data/address.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,53 @@
"Adnan Menderes Bulvarı No: 56, Eskişehir",
"Karaağaç Mahallesi, Zeytin Sokak No: 23, Trabzon",
"Gaziosmanpaşa Caddesi No: 89, Maltepe, İstanbul",
"Menderes Mahallesi, AtatΓΌrk Sokak No: 67, Edirne"
"Menderes Mahallesi, AtatΓΌrk Sokak No: 67, Edirne",
"Cumhuriyet Mahallesi, Γ‡iΓ§ek Sokak No: 15, Konya",
"Zafer BulvarΔ± No: 91, Merkez, Kayseri",
"Doğanbey Mahallesi, Lale Sokak No: 24, Erzurum",
"Fevzi Γ‡akmak Caddesi No: 36, Sivas",
"HΓΌrriyet Mahallesi, Papatya Sokak No: 77, Gaziantep",
"Milli Egemenlik Bulvarı No: 42, Şanlıurfa",
"Barış Mahallesi, Kardelen Sokak No: 18, Van",
"KΓΌltΓΌr Caddesi No: 63, DiyarbakΔ±r",
"Yeşiltepe Mahallesi, Nergis Sokak No: 29, Malatya",
"Güven Bulvarı No: 85, Elazığ",
"Γ‡Δ±narlΔ± Mahallesi, Menekşe Sokak No: 41, Kocaeli",
"Γ–zgΓΌrlΓΌk Caddesi No: 52, Sakarya",
"TekkekΓΆy Mahallesi, Karanfil Sokak No: 73, Samsun",
"AltΔ±nova BulvarΔ± No: 19, Ordu",
"Sahil Mahallesi, MartΔ± Sokak No: 66, Sinop",
"Γ‡ay Caddesi No: 28, Rize",
"Değirmen Mahallesi, Fulya Sokak No: 94, Artvin",
"Akşemsettin Bulvarı No: 37, Kastamonu",
"Toprak Mahallesi, Begonva Sokak No: 59, Γ‡orum",
"YΔ±ldΔ±rΔ±m Caddesi No: 81, Amasya",
"Γ‡ilek Mahallesi, Lavanta Sokak No: 13, Tokat",
"Doğu Bulvarı No: 48, Yozgat",
"KΔ±zΔ±lΔ±rmak Caddesi No: 76, KΔ±rΔ±kkale",
"Şehit Mahallesi, Gül Sokak No: 22, Nevşehir",
"Kapadokya Bulvarı No: 65, Kırşehir",
"Bagdat Caddesi No: 147, Üsküdar, İstanbul",
"Nişantaşı Mahallesi, Teşvikiye Sokak No: 88, Şişli, İstanbul",
"Levent Caddesi No: 201, Beşiktaş, İstanbul",
"Etiler Mahallesi, Akmerkez Sokak No: 35, Beşiktaş, İstanbul",
"Bebek Yolu No: 99, Bebek, Δ°stanbul",
"Ortakây Meydanı No: 17, Beşiktaş, İstanbul",
"Galata Kulesi Caddesi No: 44, Galata, Δ°stanbul",
"Sultanahmet MeydanΔ± No: 8, Fatih, Δ°stanbul",
"Karakây Mahallesi, Banker Sokak No: 52, Beyoğlu, İstanbul",
"Cihangir Mahallesi, Susam Sokak No: 71, Beyoğlu, İstanbul",
"KΔ±zΔ±lay MeydanΔ± No: 25, Γ‡ankaya, Ankara",
"BahΓ§elievler Mahallesi, Adalet Sokak No: 33, Γ‡ankaya, Ankara",
"Γ‡ayyolu BulvarΔ± No: 156, Γ‡ankaya, Ankara",
"Bilkent Üniversitesi Caddesi No: 1, Γ‡ankaya, Ankara",
"TunalΔ± Hilmi Caddesi No: 67, Γ‡ankaya, Ankara",
"Güvenpark Mahallesi, Atatürk Bulvarı No: 123, Altındağ, Ankara",
"Konak MeydanΔ± No: 5, Konak, Δ°zmir",
"Alsancak LimanΔ± Caddesi No: 78, Konak, Δ°zmir",
"FoΓ§a Sahil Yolu No: 34, FoΓ§a, Δ°zmir",
"Γ‡eşme Marina BulvarΔ± No: 92, Γ‡eşme, Δ°zmir",
"AlaΓ§atΔ± Mahallesi, RΓΌzgar Sokak No: 16, Γ‡eşme, Δ°zmir",
"Sığacık Limanı Caddesi No: 41, Seferihisar, İzmir"
]

108 changes: 107 additions & 1 deletion data/email.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,112 @@
"hr@example.com",
"finance@example.com",
"it@example.com",
"security@example.com"
"security@example.com",
"info@teknoloji.com",
"destek@yazilim.net",
"iletisim@proje.org",
"admin@sistem.gov.tr",
"user@domain.edu.tr",
"test@sample.co.uk",
"demo@example.io",
"contact@business.biz",
"help@support.tech",
"mail@webmail.online",
"inbox@messaging.app",
"notification@alerts.system",
"newsletter@updates.news",
"marketing@campaigns.digital",
"sales@ecommerce.shop",
"service@customer.care",
"feedback@review.platform",
"team@collaboration.workspace",
"dev@development.studio",
"api@integration.cloud",
"data@analytics.insights",
"security@protection.shield",
"backup@storage.vault",
"monitoring@performance.metrics",
"logging@tracking.events",
"report@business.intelligence",
"dashboard@visualization.charts",
"mobile@responsive.design",
"frontend@ui.experience",
"backend@server.infrastructure",
"database@sql.management",
"cache@redis.memory",
"queue@messaging.async",
"worker@background.process",
"scheduler@cron.automation",
"webhook@callback.integration",
"oauth@authentication.secure",
"jwt@token.authorization",
"session@state.management",
"cookie@browser.storage",
"localstorage@client.persistence",
"websocket@realtime.communication",
"sse@server.events",
"graphql@query.language",
"rest@api.endpoints",
"soap@legacy.protocol",
"xml@structured.data",
"json@lightweight.format",
"yaml@configuration.files",
"toml@simple.config",
"ini@settings.format",
"env@environment.variables",
"docker@container.platform",
"kubernetes@orchestration.system",
"aws@cloud.services",
"azure@microsoft.cloud",
"gcp@google.platform",
"heroku@deployment.service",
"netlify@static.hosting",
"vercel@frontend.deployment",
"firebase@google.backend",
"supabase@open.alternative",
"mongodb@document.database",
"postgresql@relational.sql",
"mysql@popular.database",
"sqlite@embedded.database",
"redis@inmemory.store",
"elasticsearch@search.engine",
"kafka@streaming.platform",
"rabbitmq@message.broker",
"nginx@web.server",
"apache@http.server",
"nodejs@javascript.runtime",
"python@programming.language",
"java@enterprise.platform",
"csharp@dotnet.framework",
"php@web.development",
"ruby@elegant.language",
"go@google.language",
"rust@systems.programming",
"swift@apple.development",
"kotlin@android.modern",
"typescript@javascript.typed",
"dart@flutter.language",
"scala@jvm.functional",
"clojure@lisp.dialect",
"haskell@pure.functional",
"erlang@concurrent.language",
"elixir@actor.model",
"react@facebook.library",
"vue@progressive.framework",
"angular@google.framework",
"svelte@compile.framework",
"nextjs@react.framework",
"nuxtjs@vue.framework",
"gatsby@static.generator",
"jekyll@ruby.generator",
"hugo@go.generator",
"eleventy@simple.generator",
"wordpress@content.management",
"drupal@flexible.cms",
"joomla@open.cms",
"magento@ecommerce.platform",
"shopify@hosted.ecommerce",
"woocommerce@wordpress.shop",
"prestashop@open.commerce"
]

42 changes: 42 additions & 0 deletions data/enAddress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[
"123 Main Street, New York, NY 10001",
"456 Oak Avenue, Los Angeles, CA 90210",
"789 Pine Road, Chicago, IL 60601",
"321 Elm Street, Houston, TX 77001",
"654 Maple Drive, Phoenix, AZ 85001",
"987 Cedar Lane, Philadelphia, PA 19101",
"147 Birch Way, San Antonio, TX 78201",
"258 Spruce Court, San Diego, CA 92101",
"369 Willow Street, Dallas, TX 75201",
"741 Ash Boulevard, San Jose, CA 95101",
"852 Poplar Avenue, Austin, TX 73301",
"963 Cherry Street, Jacksonville, FL 32099",
"159 Walnut Drive, Fort Worth, TX 76101",
"357 Hickory Lane, Columbus, OH 43085",
"486 Sycamore Road, Charlotte, NC 28201",
"792 Magnolia Court, San Francisco, CA 94102",
"138 Dogwood Street, Indianapolis, IN 46201",
"246 Redwood Avenue, Seattle, WA 98101",
"468 Sequoia Drive, Denver, CO 80201",
"579 Cypress Lane, Washington, DC 20001",
"681 Juniper Way, Boston, MA 02101",
"793 Aspen Street, El Paso, TX 79901",
"135 Beech Court, Detroit, MI 48201",
"247 Fir Boulevard, Nashville, TN 37201",
"359 Hemlock Avenue, Portland, OR 97201",
"471 Larch Drive, Oklahoma City, OK 73101",
"583 Palm Street, Las Vegas, NV 89101",
"695 Yew Lane, Louisville, KY 40201",
"807 Alder Road, Baltimore, MD 21201",
"919 Basswood Court, Milwaukee, WI 53201",
"246 Buckeye Street, Albuquerque, NM 87101",
"357 Catalpa Avenue, Tucson, AZ 85701",
"468 Chestnut Drive, Fresno, CA 93701",
"579 Cottonwood Lane, Sacramento, CA 94203",
"681 Hackberry Way, Long Beach, CA 90801",
"793 Hawthorn Street, Kansas City, MO 64101",
"135 Ironwood Court, Mesa, AZ 85201",
"247 Locust Boulevard, Virginia Beach, VA 23451",
"359 Mesquite Avenue, Atlanta, GA 30301",
"471 Mulberry Drive, Colorado Springs, CO 80901"
]
Loading