I'm working on an extension and rather than build my own search functionality, I'd rather just use Chrome's for searching a page for text. Is there a way to create a button that says "Search" and when clicked will be the same as a CTRL + F keypress by the user?
I apologize if this is a redundant question. I didn't succeed in finding it here already.
If you're in a document or in a web browser, pressing the Ctrl key + the F key will bring up a search box in the top right corner of the screen. You can then type in a keyword or phrase to find places where that word or phrase is used in the text, often helpful for locating relevant sections.
Browsers 'understand' JavaScript because it is built in. JavaScript understands jQuery because it is, after all, JavaScript under the hood, not a separate, discrete language. It is JS.
Chrome. Open Chrome and navigate to the web page containing the JavaScript you want to view. Right-click an empty area on the web page and select Inspect in the pop-up menu to open the Chrome developer tools.
https://developer.mozilla.org/en/DOM/window.find
Testing test
<form onsubmit="window.find(this.q.value,false,true,true,true,false,true); return false">
<input id="q" type="text" value="test" />
<input type="submit" value="Find" />
</form>
Testing test
Note: I could only make this do a find BEFORE (or after if set to search backwards) the input field for some reason
Update: Had a quick google and this showed up: https://github.com/philc/vimium/wiki/Chromium-bugs-we%27re-tracking
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With