Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome devtools: How to call a function from another snippet?

I have created many snippets in the Chrome devtool's "Elements > Snippets" panel.

I have a snippet with utility functions like loadJquery, loadUnderscore, etc. I would like to call these functions from another snippet. Is this possible?

like image 606
dips Avatar asked Sep 05 '25 02:09

dips


1 Answers

Came here cause I struggle with the same question.

I think the correct answer would be yes, if you run each one of them individually and in dependency order.

For example, I have a snippet with a pickDeep() functionality that I got from here. And then I created some other snippets which use that function. So what I do is just run the one with the pickDeep() declaration first, and then run any other snippet which use it.

It's the exact same thing as if you had typed and run everything on the console directly. So it does not matter where the declaration comes from, as long as it has been declared some way in the current session.

Of course is not the desirable way, but I want to point out there is a workaround.

like image 108
Patrick Bard Avatar answered Sep 07 '25 17:09

Patrick Bard