File tree 3 files changed +5
-4
lines changed
3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -86,10 +86,11 @@ const Analytics = (() => {
86
86
}
87
87
88
88
function sendMeasurementEvent ( payload : any ) : void {
89
- if ( import . meta. env . DEV ) {
89
+ if ( ( import . meta. env . DEV as unknown as string ) === "development" ) {
90
90
console . log ( 'in dev mode, skipping analytics:' , payload )
91
91
return
92
92
}
93
+
93
94
const url = `https://www.google-analytics.com/mp/collect?measurement_id=${ GA_MEASUREMENT_ID } &api_secret=${ GA_API_SECRET } `
94
95
95
96
fetch ( url , {
Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ import { CiSearch } from 'react-icons/ci'
2
2
import { BookmarkProvider } from '../../context/bookmark.context'
3
3
import { useTheme } from '../../context/theme.context'
4
4
import { BookmarksComponent } from './bookmarks/bookmarks'
5
+ import Browser from 'webextension-polyfill'
5
6
6
7
export function SearchLayout ( ) {
7
- const GOOGLE_URL = 'https://www.google.com/search?q='
8
8
const { theme, themeUtils } = useTheme ( )
9
9
10
10
const getSearchBoxBackground = ( ) => {
@@ -33,7 +33,7 @@ export function SearchLayout() {
33
33
e . preventDefault ( )
34
34
const query = ( e . target as HTMLFormElement ) . search . value
35
35
if ( query . trim ( ) ) {
36
- window . location . href = GOOGLE_URL + encodeURIComponent ( query )
36
+ Browser . search . query ( { text : query } )
37
37
}
38
38
}
39
39
Original file line number Diff line number Diff line change 11
11
"48" : " icons/icon48.png" ,
12
12
"128" : " icons/icon128.png"
13
13
},
14
- "permissions" : [" storage" ],
14
+ "permissions" : [" storage" , " search " ],
15
15
"chrome_url_overrides" : {
16
16
"newtab" : " src/index.html"
17
17
},
You can’t perform that action at this time.
0 commit comments