Skip to content

Commit d39c8cd

Browse files
committed
Merge branch 'develop'
2 parents 08af2c6 + ca01429 commit d39c8cd

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/analytics.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,11 @@ const Analytics = (() => {
8686
}
8787

8888
function sendMeasurementEvent(payload: any): void {
89-
if (import.meta.env.DEV) {
89+
if ((import.meta.env.DEV as unknown as string) === "development") {
9090
console.log('in dev mode, skipping analytics:', payload)
9191
return
9292
}
93+
9394
const url = `https://www.google-analytics.com/mp/collect?measurement_id=${GA_MEASUREMENT_ID}&api_secret=${GA_API_SECRET}`
9495

9596
fetch(url, {

src/layouts/search/search.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { CiSearch } from 'react-icons/ci'
22
import { BookmarkProvider } from '../../context/bookmark.context'
33
import { useTheme } from '../../context/theme.context'
44
import { BookmarksComponent } from './bookmarks/bookmarks'
5+
import Browser from 'webextension-polyfill'
56

67
export function SearchLayout() {
7-
const GOOGLE_URL = 'https://www.google.com/search?q='
88
const { theme, themeUtils } = useTheme()
99

1010
const getSearchBoxBackground = () => {
@@ -33,7 +33,7 @@ export function SearchLayout() {
3333
e.preventDefault()
3434
const query = (e.target as HTMLFormElement).search.value
3535
if (query.trim()) {
36-
window.location.href = GOOGLE_URL + encodeURIComponent(query)
36+
Browser.search.query({ text: query })
3737
}
3838
}
3939

src/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"48": "icons/icon48.png",
1212
"128": "icons/icon128.png"
1313
},
14-
"permissions": ["storage"],
14+
"permissions": ["storage","search"],
1515
"chrome_url_overrides": {
1616
"newtab": "src/index.html"
1717
},

0 commit comments

Comments
 (0)