Skip to content

Commit a387f1a

Browse files
committed
Abstracted base URLs
1 parent 18f7070 commit a387f1a

File tree

5 files changed

+28
-23
lines changed

5 files changed

+28
-23
lines changed
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
// Launch search.brave.com on toolbar icon click
2-
chrome.action.onClicked.addListener(() =>
3-
chrome.tabs.create({ url: 'https://search.brave.com' }))
1+
const braveSearchURL = 'https://search.brave.com'
2+
3+
// Launch Brave Search on toolbar icon click
4+
chrome.action.onClicked.addListener(() => chrome.tabs.create({ url: braveSearchURL }))
45

56
// Query Brave AI on omnibox query submitted
67
chrome.omnibox.onInputEntered.addListener(query =>
7-
chrome.tabs.update({ url: `https://search.brave.com/search?q=${decodeURIComponent(query)}&summary=1` }))
8+
chrome.tabs.update({ url: `${braveSearchURL}/search?q=${decodeURIComponent(query)}&summary=1` }))
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
// Launch chatgpt.com on toolbar icon click
2-
chrome.action.onClicked.addListener(() =>
3-
chrome.tabs.create({ url: 'https://chatgpt.com' }))
1+
const chatgptURL = 'https://chatgpt.com'
2+
3+
// Launch ChatGPT on toolbar icon click
4+
chrome.action.onClicked.addListener(() => chrome.tabs.create({ url: chatgptURL }))
45

56
// Query ChatGPT on omnibox query submitted
67
chrome.omnibox.onInputEntered.addListener(query =>
7-
chrome.tabs.update({ url: `https://chatgpt.com/?q=${decodeURIComponent(query)}` }))
8+
chrome.tabs.update({ url: `${chatgptURL}/?q=${decodeURIComponent(query)}` }))
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
// Launch perplexity.ai on toolbar icon click
2-
chrome.action.onClicked.addListener(() =>
3-
chrome.tabs.create({ url: 'https://www.perplexity.ai' }))
1+
const perplexityURL = 'https://www.perplexity.ai'
42

5-
// Query perplexity.ai on omnibox query submitted
3+
// Launch Perplexity on toolbar icon click
4+
chrome.action.onClicked.addListener(() => chrome.tabs.create({ url: perplexityURL }))
5+
6+
// Query Perplexity on omnibox query submitted
67
chrome.omnibox.onInputEntered.addListener(query =>
7-
chrome.tabs.update({ url: `https://www.perplexity.ai/search/new?q=${decodeURIComponent(query)}` }))
8+
chrome.tabs.update({ url: `${perplexityURL}/search/new?q=${decodeURIComponent(query)}` }))
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
// Launch phind.com on toolbar icon click
2-
chrome.action.onClicked.addListener(() =>
3-
chrome.tabs.create({ url: 'https://www.phind.com' }))
1+
const phindURL = 'https://www.phind.com'
42

5-
// Query phind.com on omnibox query submitted
3+
// Launch Phind on toolbar icon click
4+
chrome.action.onClicked.addListener(() => chrome.tabs.create({ url: phindURL }))
5+
6+
// Query Phind on omnibox query submitted
67
chrome.omnibox.onInputEntered.addListener(query =>
7-
chrome.tabs.update({ url: `https://www.phind.com/search?q=${decodeURIComponent(query)}` }))
8+
chrome.tabs.update({ url: `${phindURL}/search?q=${decodeURIComponent(query)}` }))
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
// Launch you.com on toolbar icon click
2-
chrome.action.onClicked.addListener(() =>
3-
chrome.tabs.create({ url: 'https://you.com/' }))
1+
const youDotComURL = 'https://you.com/'
42

5-
// Query you.com on omnibox query submitted
3+
// Launch You.com on toolbar icon click
4+
chrome.action.onClicked.addListener(() => chrome.tabs.create({ url: youDotComURL }))
5+
6+
// Query You.com on omnibox query submitted
67
chrome.omnibox.onInputEntered.addListener(query =>
7-
chrome.tabs.update({ url: `https://www.you.com/search?q=${decodeURIComponent(query)}&tbm=youchat` }))
8+
chrome.tabs.update({ url: `${youDotComURL}/search?q=${decodeURIComponent(query)}&tbm=youchat` }))

0 commit comments

Comments
 (0)