File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -11,14 +11,19 @@ function process(details) {
11
11
return ;
12
12
}
13
13
14
+ // Detect if we are in image search, don't do anything.
15
+ // Otherwise this addon breaks image search...
16
+ // Seems to work fine other modes.
17
+ if ( details . url . includes ( 'udm=2' ) ) {
18
+ return ;
19
+ }
20
+
21
+ // add &udm=14 if URL already has search string, otherwise ?udm=14
14
22
let udm14 = ( details . url . includes ( '?' ) ? '&' : '?' ) + 'udm=14' ;
15
23
16
- // check it doesn't have udm=14
17
24
if ( is_active && ! details . url . includes ( 'udm=14' ) ) {
18
- // add &udm=14 if URL already has search string, otherwise ?udm=14
19
25
return { redirectUrl : details . url + udm14 } ;
20
26
} else if ( ! is_active && ! details . url . includes ( 'udm=14' ) ) {
21
- // Otherwise simply remove it
22
27
return { redirectUrl : details . url . replace ( udm14 , '' ) } ;
23
28
}
24
29
}
Original file line number Diff line number Diff line change 3
3
"manifest_version" : 2 ,
4
4
"name" : " Straight to the web" ,
5
5
"homepage_url" : " https://github.com/ShadowMitia/Straight-to-the-web" ,
6
- "version" : " 0.1 " ,
6
+ "version" : " 0.2 " ,
7
7
"description" : " Forces all Google searches to use the new 'Web' mode by appending links with udm=14" ,
8
8
"permissions" : [
9
9
" webRequest" ,
You can’t perform that action at this time.
0 commit comments