Keyboard shortcut to switch focus from web developer tools to page in Chrome

前端 未结 12 603
慢半拍i
慢半拍i 2020-12-12 21:50

I use Vimium for Chrome, which allows me to refresh with the r key. When I am using the dev tools I lose focus of the page, and have to click in the page in or

12条回答
  •  佛祖请我去吃肉
    2020-12-12 22:13

    I got pretty frustrated with this too, but my problem is a bit different though. I have dev tools detached (in a separate window) and I always need to click to get back to the page.

    I wrote a small applescript that works for me:

    tell application "Google Chrome"
        activate second window -- if I have dev tools open "second window" is the page
        tell second window to tell active tab
            set the URL to "Javascript:window.focus();"
        end tell
    end tell
    

    I have it bound to a shortcut using Spark.

    So whenever I'm in a detached dev tools window, I hit my shortcut and focus is put back to the page and I can use Vimium again.

提交回复
热议问题