In general, you cannot invoke browser controls from inside the webpage - security, sandboxing, and all that. A trick could be listening to Ctrl + F , prevent
it and then capture all the keys user enters then do what you want to do .
window.addEventListener("keydown",function (e) {
if (e.keyCode === 114 || (e.ctrlKey && e.keyCode === 70)) {
callBackCtrlF();
e.preventDefault();
}
})
then you could use :
function callBackCtrlF() {
// do your stuff
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.