';
for ( var i = 0; i < newButtonsList.length; i++ ) {
newButtonsHTML = newButtonsHTML.concat( '

');
}
newButtonsHTML = newButtonsHTML.concat( '
' );
}
function letsRock(update) {
var container = document.querySelector('.customSearch');
if (!update && container ) { return }
makeButtonsHTML();
var insertHere = document.querySelector('button[aria-label="Search"]') || document.querySelector('button[aria-label="Google Search"]') || document.querySelector('div[aria-label="Search by image"]');
/* First one is for most results pages such as All, News, Videos, Books, etc. Second one is for the Images results page. Third one is for Google's home page. */
if (container) { container.remove() }
insertHere.insertAdjacentHTML('afterend', newButtonsHTML);
}
const bodyColor = window.getComputedStyle(document.querySelector('body')).backgroundColor;
const buttonWidth = Math.ceil(newButtonsList.length / 2) * 16;
document.body.appendChild(document.createElement('style')).textContent = `
.customSearch {
position: relative;
left: 10px;
display: flex;
flex-flow: column wrap;
align-items: center;
justify-content: space-around;
gap: 4px;
height: 44px;
width: 0;
padding: 0;
}
.customSearchItem:hover {
filter: drop-shadow(1px 1px 1px #000)
drop-shadow(0px 0px 2px #8b9ba1)
drop-shadow(0px 0px 2px #8b9ba1)
drop-shadow(0px 0px 2px #8b9ba1)
drop-shadow(0px 0px 2px #8b9ba1);
}
.customSearchItem {
display: flex;
height: 18px;
width: 18px;
padding: 1px 5px;
margin: 0px;
}
.customSearchItem svg,
.customSearchItem img,
.customSearchItem > span {
height: 16px;
width: 16px;
}
/* .minidiv = when search box is fixed to the top after scrolling down */
.minidiv .RNNXgb {
margin-top: 10px !important;
height: 32px !important;
}
.minidiv .customSearch {
margin: -6px 0;
}
/* for Google.com home page */
div[aria-label="Search by image"] + .customSearch {
left: 20px;
}
/* centering on home page */
.o3j99.ikrT4e.om7nvf .A8SBwf[jscontroller="cnjECf"] {
position: relative;
left: -`+ buttonWidth +`px;
}
.o3j99.ikrT4e.om7nvf .FPdoLc.lJ9FBc {
position: relative;
left: `+ buttonWidth +`px;
}
/* for Google doodle underneath buttons */
.customSearch:before {
z-index: -1;
position: absolute;
left: 0;
content: "";
background-color: `+ bodyColor +`;
opacity: .8;
width: `+ (buttonWidth * 2) +`px;
height: 55px;
}
.minidiv .customSearch:before {
opacity: 0;
}
`;
letsRock();