Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set Execution Context Selector in Chrome via console

I'm working with JavaScript and need to refresh the browser a lot. The Execution Context Selector always jumps back to "top".

Is there a line of code that automatically sets the desired file.

Just to be sure, here is a picture of the Execution Context Selector

Sorry, it's not possible for me to embed yet. Longtime lurker, this is the first time I can't find an answer.

like image 463
Chris Zuidema Avatar asked Nov 24 '25 22:11

Chris Zuidema


2 Answers

You can use debugger; statement in your code devtools will break on this line of code and execution context will be automatically set.

like image 91
Pranay Kumar Avatar answered Nov 27 '25 10:11

Pranay Kumar


I am writing an extension and it's very tedious constantly changing the frame/context from top to my extension's frame. I found that you can unselect "Selected context only" (via the settings cog in the same header as the context switcher), then filtering by url.

Type url: and scroll through the autocompleted options until you find your extension's context. Persists after refreshes too.

devtools filter by context

like image 40
LarryFisherman Avatar answered Nov 27 '25 11:11

LarryFisherman