Skip to content

Commit 9a2586f

Browse files
committed
adjust readme add main content.js
1 parent 097a0c6 commit 9a2586f

File tree

3 files changed

+35
-5
lines changed

3 files changed

+35
-5
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
Early on, Google had an advanced search feature easily available from any search results page, allowing one to easily refine their search.
44

5-
Since then, they're incorporated a lot of inline shortcuts to allow to perform much of the same funtionality, though much is still missing.
5+
Since then, they've incorporated a lot of inline shortcuts to allow one to perform much of the same funtionality, though much is still missing.
66

7-
At some point, the advanced search options button was moved inside the settings menu with the gear icon. After several years of believe Google had just completely gotten rid of the advanced search page, I found it ahd been hiding in this menu.
7+
At some point, the advanced search options button was moved inside the settings menu with the gear icon. After several years of believing Google had just completely gotten rid of the advanced search page, I found it had been hiding in this menu.
88

99
This extension re adds the Advanced Search button to the toolbar to make it more easily accessible.

content.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
window.addEventListener('load', function() {
2+
const prefMenus = Array.from(document.getElementsByClassName('q0yked'))
3+
const advancedSearchElement = prefMenus.filter( element => {
4+
return element.children[0].href.includes('advanced')
5+
})[0]
6+
7+
advancedSearchElement.className = 't2vtad'
8+
delete advancedSearchElement.style.padding
9+
advancedSearchElement.style.fontFamily = 'Google Sans,arial,sans-serif'
10+
11+
const advancedTextSpan = advancedSearchElement.children[0].children[0]
12+
13+
advancedTextSpan.className = 't2vtad'
14+
15+
16+
const toolbar = document.getElementsByClassName('IC1Ck')[0]
17+
18+
const buttonContainer = toolbar.children[1]
19+
20+
buttonContainer.appendChild(advancedSearchElement)
21+
22+
buttonContainer.style.display = 'flex'
23+
buttonContainer.style.flexDirection = 'row'
24+
}, false);

manifest.json

+9-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@
44
"version": "1.0",
55
"description": "Makes the advanced search capabilities easily available on the toolbar",
66
"icons": {
7-
"16": "images/icon-16.png",
8-
"32": "images/icon-32.png",
97
"48": "images/icon-48.png",
108
"128": "images/icon-128.png"
11-
}
9+
},
10+
"content_scripts": [
11+
{
12+
"js": ["scripts/content.js"],
13+
"matches": [
14+
"*://*.google.com/search?*"
15+
]
16+
}
17+
]
1218
}

0 commit comments

Comments
 (0)