What I like to do is to programmatically trigger the on-page search functionality of my browser from JavaScript.
I.e. when a page is loaded and the the user presses Ctrl+F, a search field is opened and the user can enter a search term. This usually results, depending on the used browser, in all occurances being highlighted.
I want to do the same on my page:
- Call some JavaScript API of the browser to trigger the search field.
- Call some JavaScript API of the browser to enter values into the search field.
- Actually execute the search.
While I think it is not possible, due to possible security-risks, I still want to be sure.
Therefore my question:
Is it possible to programmatically trigger the on-page search function of a web browser?
(If there is no general API, maybe there are browser-specific ways of doing it)