Skip to content

Commit 494e80a

Browse files
author
mcarbonell
committed
fix: use tool.url from tools-loader instead of forcing web redirect
1 parent 39b4400 commit 494e80a

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

extension/newtab/newtab.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -415,11 +415,8 @@ class FastToolsNewTab {
415415
} else if (tool.slug === 'local://notes') {
416416
this.createNewNote();
417417
} else {
418-
// Open all tools in web version (fasttools.ai)
419-
const toolSlug = tool.slug.replace(/^local:\/\//, '').replace(/^tools\//, '');
420-
const langPrefix = this.lang === 'en' ? '' : `${this.lang}/`;
421-
const webUrl = `https://fasttools.ai/${langPrefix}${toolSlug}`;
422-
chrome.tabs.create({ url: webUrl, active: true });
418+
// Use tool.url from tools-loader (local or web)
419+
chrome.tabs.create({ url: tool.url, active: true });
423420
}
424421
}
425422

extension/popup/popup-simple.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,8 @@ class FastToolsPopup {
131131
showModal('notes-modal');
132132
this.loadNotes();
133133
} else {
134-
// Open all tools in web version (fasttools.ai)
135-
const toolSlug = tool.slug.replace(/^local:\/\//, '').replace(/^tools\//, '');
136-
const langPrefix = this.lang === 'en' ? '' : `${this.lang}/`;
137-
const webUrl = `https://fasttools.ai/${langPrefix}${toolSlug}`;
138-
chrome.tabs.create({ url: webUrl, active: true });
134+
// Use tool.url from tools-loader (local or web)
135+
chrome.tabs.create({ url: tool.url, active: true });
139136
window.close();
140137
}
141138
}

extension/shared/tools-loader.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,21 @@ export async function loadTools(lang = 'es') {
4848

4949
// Determine URL based on availability
5050
let url;
51+
let isLocal = false;
52+
5153
if (hasExtension && tool.extensionSlug) {
5254
// Local implementation in extension
5355
url = chrome.runtime.getURL(tool.extensionSlug);
56+
isLocal = true;
57+
console.log(`🔧 ${tool.id}: Local URL = ${url}`);
5458
} else if (hasWeb) {
5559
// Redirect to web version
5660
url = `${BASE_URL}${langPrefix}/${tool.slug}`;
61+
console.log(`🌐 ${tool.id}: Web URL = ${url}`);
5762
} else {
5863
// Should not happen due to filter, but fallback to web
5964
url = `${BASE_URL}${langPrefix}/${tool.slug}`;
65+
console.log(`⚠️ ${tool.id}: Fallback URL = ${url}`);
6066
}
6167

6268
return {
@@ -65,7 +71,7 @@ export async function loadTools(lang = 'es') {
6571
description: tool.description[lang] || tool.description.es,
6672
category: tool.categories[0], // Primary category
6773
url: url,
68-
local: hasExtension && tool.extensionSlug ? true : false
74+
local: isLocal
6975
};
7076
});
7177

0 commit comments

Comments
 (0)