72

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 order to use r again (though I would obviously just refresh with the button). Does anyone know of a keyboard shortcut to switch from the dev tools back to the page? I know you can use cmd [ to switch panes inside of the dev tools, but can't find a way to switch back to the page.

Kara
  • 6,115
  • 16
  • 50
  • 57
dc-
  • 1,878
  • 1
  • 15
  • 15
  • 1
    I'd also like to find some way to achieve this. It's very annoying that they chose `cmd L` for "jump to line number" in the dev tools, which clobbers the usual behaviour of focusing on the address bar... – Adam Biggs Nov 27 '12 at 02:07
  • 1
    I wrote a generic solution to this. Please check this if you want to move focus to page easily in any case http://stackoverflow.com/a/30567119/524588 – Sanghyun Lee Jun 01 '15 at 06:40
  • 1
    You can [open devtools in a separate windows][1] and then use regular windows switching. [1]: http://stackoverflow.com/questions/23668827/how-to-open-the-chrome-developer-tools-in-a-new-window – sylvain Sep 30 '15 at 16:25
  • related: https://superuser.com/questions/324266/google-chrome-mac-set-keyboard-focus-from-address-bar-back-to-page – Ciro Santilli OurBigBook.com Apr 23 '18 at 17:04

14 Answers14

41
  • When Chrome DevTools is focused, Shift + F6 will focus on the page content.
  • When Chrome DevTools is open and the page content is focused, F6 will focus on Chrome DevTools.

Reference: https://support.google.com/chrome/answer/157179

Google Chrome Feature Shortcuts

F6 Switch focus forward between the Address bar, Bookmarks bar (if showing), and page content
Shift + F6 Switch focus backward between the Address bar, Bookmarks bar (if showing), and page content

Mike
  • 1,495
  • 15
  • 11
  • 9
    Note that this is platform specific (Windows and Linux) and does not work on OSX – JuanCaicedo Aug 30 '17 at 08:24
  • 2
    I can confirm - this works great on Linux and Chromium. Thanks :-) – modulitos Sep 26 '17 at 18:33
  • The @Mike 's method works i can confirm. However i'd like to mention another method as well. Since i am a Front-end developer, i sometimes use my DevTools as "Undocked Seperate Window" Mode and in this mode a quick way to focus between page and DevTools is `Alt+\`` (Linux). Not Sure if same works for Windows and Mac. – Sushmit Sagar Oct 11 '18 at 05:30
  • 1
    On mac go: CMD+L to target the address field then CMD+SHIFT+TAB to cycle backwards in the tab stack to get to the page content. – Hampus Ahlgren Jul 03 '21 at 10:38
  • CMD+SHIFT+TAB opens the MacOS app switcher. What works for me is CMD+L to focus the address bar, then Escape to focus the page. – Huon Oct 06 '22 at 00:12
14

I still haven't found a way to focus page from dev-tools, while leaving dev-tools opened, but:

  • If dev-tools is opened, focus it with Cmd+Opt+c
  • Close dev-tools and focus page with Cmd+Opt+i
  • If dev tools is closed, to jump straight into console: Cmd+Opt+j
  • Switch tabs with Cmd+[ and Cmd+]
  • Esc to toggle console in dev-tools

Reference: https://developers.google.com/chrome-developer-tools/docs/shortcuts

rafi
  • 1,648
  • 2
  • 18
  • 23
12

Shamelessly copied from Hugh Lee


  1. Hit F6 or Cmd + L or Ctrl + L and focus the address bar
  2. Type javascript: and hit the enter key.

Now you can move focus to the page only with j.


But javascript: is too long, isn't it? Then follow this.

Go to Chrome Settings page
Click "Manage search engines..." in the Search section
Add a new search engine with
    any name e.g. Back to page
    any keyword e.g. j
    URL - javascript:

enter image description here

Community
  • 1
  • 1
TMB
  • 4,683
  • 4
  • 25
  • 44
  • this is the best i have found so far, but still annoying i need to press so many keys to just focus the page (cmd+L+j+enter) . Did you find something better? – Doug Jun 18 '19 at 09:30
5

Like I have answered here
New Update: In chrome Version 92.0.4515.131.

  • When DevTools is open and focus.
  • Press (⌘ Command+⌥ Option+↓ Down) Twice.
    First time pressed - the focus will transfer to the URL.
    The second time pressed - the focus will transfer to the page.
Roee Rokah
  • 197
  • 2
  • 9
4

OS X you can natively cycle between application windows using:

Move focus to next window: + `

Move focus to last window: + + `

If this isn't working, check it's enabled in

System Preferences > Keyboard > Keyboard Shortcuts tab > Keyboard section

Community
  • 1
  • 1
4

Does anyone know of a keyboard shortcut to switch from the dev tools back to the page?

Tab is the key you're looking for. Use it to focus the page after pressing Esc to open the console.

vhs
  • 9,316
  • 3
  • 66
  • 70
  • This should be the accepted answer! Faster than Shift + F6, and it's platform-independent (works on OSX as well). – Jackson Holiday Wheeler May 21 '20 at 04:16
  • 5
    Doesn't work on my machine. It just tabs through the various clickables. (And if the DevTools Console input line is ever focused, Tab actually inserts a Tab character.) – JellicleCat Jul 19 '21 at 19:22
2

Chrome Version 35.0.1916.114

On web page, F12. Should show Elements tab, if not switch to it with ctrl+[. Once you get elements tab to show on F12 from page, you can use Esc to get to the console, if need be.

Then, when elements panel is focused, three tabs before you meet anything interesting, I get the styles panel, 'user agent stylesheet'. Two more tabs and I get the little dotted icon in top right, space to show that.

At this point we are 5 tabs away from start. Two more tabs and I get 'find in styles', one more tab and I get the computed properties panel. Then another tab gets to the filter below it.

Now we are at 9 tabs.

Guess what the 10th tab is.

Or, if your pinky is getting tired, it is only 8 shift-tabs going backwards.

That's what we call in the business, 'discoverability'.

Then again, here is the AutoHotkey script:

; Match any part of title
SetTitleMatchMode, 2
#IfWinActive - Google Chrome
;#IfWinActive ahk_class Chrome_WidgetWin_1
  +F10::  ; goto html body, use upper left corner mouse click
    CoordMode, Mouse, Screen
    MouseGetPos, xpos, ypos
    CoordMode, Mouse, Relative
    MouseClick, left,10, 95, 1, 0
    CoordMode, Mouse, Screen
    MouseMove, %xpos%, %ypos%, 0
    Return
  F10:: ; from html, goto dev tools (Elements Panel must be default here, with console open ESC), 
        ; might need to adjust tab number to suit your icons to the right of location bar
    Send, ^l
    Send, {tab 7}
    Return
  ^F10:: ; from html, goto dev tools - previously opened console (Elements Panel must be default here, with console open ESC)
    Send, ^l
    Send, {tab 7}
    Send, {tab 13}
    Return
#IfWinActive ;Chrome
Mark Robbins
  • 2,427
  • 3
  • 24
  • 33
1

There isn't a way to switch from the dev pane to the window, but cmd r accomplishes what was needed (a refresh of the page).

dc-
  • 1,878
  • 1
  • 15
  • 15
1

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.

Cotten
  • 8,787
  • 17
  • 61
  • 98
1

While on Linux, switch to address bar from Dev Tools with Alt+D and then press Shift+Tab twice. This brings you back to main page. Shame it doesn't work on Mac though.

evenfrost
  • 414
  • 5
  • 14
1

If using Windows, the following AHK script will do the job:

#IfWinActive ahk_exe chrome.exe
  !a::Send +{F6}
#IfWinActive

To verify:

  • Focus Chrome DevTools.
  • Press Alt+A.
  • Now the webpage should be focused.
Wenfang Du
  • 8,804
  • 9
  • 59
  • 90
  • 1
    Not sure why AHK is needed... it appears the F6 will do the trick, although it may require pressing it twice as the first seems to focus only the stuff on the address bar row. – Michael Nov 20 '22 at 02:19
  • @Michael Pressing `Shift+F6` once to focus the webpage, but `Alt+A` is more convenient, that's why AHK is needed. – Wenfang Du Nov 20 '22 at 05:50
0

hit f6 to focus on address bar, hit return or f5 to refresh, then hit tab to focus on the browser window elements...

It's roundabout and probably doesn't help in all cases, but if you're testing tab index or something and don't like to use your mouse, this is the only way I figured out how to switch back without closing the console.

bingo
  • 2,298
  • 1
  • 15
  • 21
0

Hit Control + L to focus the addressbar. Then hit F6 once to focus the bookmark bar (if you have one) and F6 again to focus the page.

Chris
  • 1
  • It may take more than two F6 keypresses to make it to the web page depending on which "panes" (e.g., downloads) are open. For example, at this point in time, it requires four F6 presses with chromium to get me from the address bar to a focus on the web page view. – dat Sep 13 '20 at 17:22
0

My solution is based on Upper answers (for Mac users):

  1. Set drawer to Console
  2. With focus in DevTools, press Esc to open drawer (Console)
  3. Press Tab, to switch focus on page
  4. With focus in page input, press Shift + Tab to switch focus in DevTools
Zhao Yinan
  • 1
  • 1
  • 1