Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to save to temp variable in chrome developer tool

In chrome developer tool, we can save object values to a variable using "store as global variable". But I have been given an error as follows. "Failed to save to temp variable."

chrome developer tool

like image 463
Pubudu Mahesh Meththananda Avatar asked Jan 20 '17 06:01

Pubudu Mahesh Meththananda


People also ask

How do I add variables to Chrome?

To add a variable to the watch list use the add icon to the right of the section heading. This will open an inline input where you provide the variable name to watch. Once it is filled in press your Enter key to add it to the list. The watcher will show you the current value of the variable as it is added.

How do I change my Chrome variables?

I was having the same issue, went to the 'About Google Chrome'->Help and it said I needed to restart my browser to get the latest updates. I did this, and suddenly, I can now change local variables. Simply click the variable you want to edit in the Scope Variables window, and type in your new value.

How do I debug F12 in Chrome?

The Chrome Web Inspector and Debugger are conveniently built-in with Chrome. You can launch it by hitting F12 while in your browser or by right clicking on a web page and selecting the Inspect menu item. The images below show a few different views that you'll see in the Chrome DevTools browser.

How do I view a variable in Chrome dev tools?

You need to double click the variable name, then right click will reveal the add to watch option.

Are You struggling to keep up with browser Dev Tools?

Browser dev tools are so full of features it’s hard to keep up. I bet every developer knows a different set of features to each other. I wanted to share a few little tips that I use, that you might not know and that if I don’t write down I might forget.

Is it possible to save changes in developer tools?

Developer tools in any browser are for testing only, it is not possible to save changes from this tool. You can only make changes and save the changes in your code only. Our automated system analyzes replies to choose the one that's most likely to answer the question. If it seems to be helpful, we may eventually mark it as a Recommended Answer.

Why does chrome throw an error when I try to reference objects?

In order for Chrome to give you a reference to the object the object still has to be in memory. If that isn't the case it can only throw an error. However, I'm pretty sure that being shown in the console forces V8 to keep a reference to the value.

How do I restart the debugger from the beginning of togglecolorscheme?

In this example, the debugger initially paused at the breakpoint (line 343) near the end of the toggleColorScheme function. To restart the debugging from the beginning of the toggleColorScheme function, expand the Call stack section in the Debugger pane, right click on toggleColorScheme and select Restart frame.


1 Answers

Is your object console.log'd from an iframe? That would make sense since the iframe has its own scope.

Try creating the same object in the root html scope (not in an iframe) and try the "store as a global variable" button.

like image 157
Cade Daniel Avatar answered Oct 23 '22 04:10

Cade Daniel