Last active
October 18, 2023 14:01
-
-
Save mountainash/cc8dfd315bbf967478220f7668bc6081 to your computer and use it in GitHub Desktop.
Arc Boost: You.com to Google.com Search Link
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Take the entered search input from the You.com search bar and pass it to Google's search bar | |
// Intended for use as a "The Browser Company" Arc Boost | |
window.setTimeout(() => { | |
// Get the search input from the You.com search bar | |
const youInput = document.querySelector('#search-input-textarea'); | |
if (!youInput) return; | |
// Create a link to Google.com | |
const googleLink = document.createElement('a'); | |
googleLink.href = `https://www.google.com/search?q=${youInput.value}`; | |
googleLink.rel = 'noopener noreferrer'; | |
googleLink.innerText = 'Google'; | |
googleLink.id = 'y2g'; | |
// Basic Style - you have some other Boost styles right? | |
googleLink.style.display = 'block'; | |
googleLink.style.border = '1px solid #006CE3'; | |
googleLink.style.marginRight = '3px'; | |
googleLink.style.padding = '8px'; | |
googleLink.style.borderRadius = '15px'; | |
googleLink.style.textTransform = 'uppercase !important'; | |
const youParent = youInput.parentNode; | |
youParent.style.alignItems = 'center'; | |
// Inject the link into the DOM | |
youParent.appendChild(googleLink); | |
}, 3000); // wait for a little for the You.com DOM to finish rendering |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use the 'You need more' Boost from the Boost Gallery or add the following CSS yourself to make You.com use up more of your viewport (great for larger screens):