google-chrome-devtools

Why is Chrome showing a value as being removed from an array before it has been? [duplicate]

泄露秘密 提交于 2019-11-28 04:15:59
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Is Chrome's JavaScript console lazy about evaluating arrays? Chrome's js console is showing an array with a deleted value before the value is deleted. Why? jsFiddle that demonstrates this behavior. var list=[]; list.push("one"); list.push("two"); list.push("three"); console.log(list); //["two", "three", undefined × 1] $("#output").append(JSON.stringify(list));//["one","two","three"] list.shift(); $("#output")

Avoid stepping through javascript file in Chrome Developer Tools?

折月煮酒 提交于 2019-11-28 04:06:44
I am wondering, is there any way to omit a javascript file from Chrome Developer Tools debugger, so it will automatically skip over any function calls made to that script? I ask because my projects often include large libraries such as jQuery. When I step through javascript in Chrome Developer Tools while debugging, I have to step through jQuery's lib every time I make a jQuery call in my script. I end up having to set breakpoints one line after every call to the jQuery object. It's the only way I have found to skip past and it's very annoying. UPDATE 2 There has been an improvement in user

“exclude_matches” in manifest.json does nothing?

…衆ロ難τιáo~ 提交于 2019-11-28 03:59:05
问题 I'm having a problem controlling what pages my content scripts are injected into. The chrome extension developer guide specifies that I can use an "exclude_matches" directive in my manifest.json to exclude certain pages from injection. However, this doesn't seem to have any effect. My content script still executes on pages that I have specified as ignored. I have put the steps to reproduce in a Gist. The code is also available on Github. Any ideas what I'm doing wrong? manifest.json { "name":

Chrome Devpanel Extension Communicating with Background Page

◇◆丶佛笑我妖孽 提交于 2019-11-28 03:51:57
I have an extension to the chrome devtools panel. I can send messages to the page using chrome.devtools.inspectedWindow.eval ... but how do I receive messages in the dev panel? Specifically, I need my devpanel to hook into events that happen on the page. I can't get it to listen to events on my content script, nor the background page. I've tried chrome.extension.sendMessage in the content script, along with chrome.extension.onMessage.addListener in the dev panel script. But sendMessage complains with Port error: Could not establish connection. Receiving end does not exist. The issue persists

Inspecting javascript on jsfiddle.net in Google Chrome

那年仲夏 提交于 2019-11-28 03:38:34
Is it possible to set breakpoints using the google chrome inspector on javascript code entered into jsfiddle.net? When I go to the script tab of the developer tools I see lots of scripts but I don't know where my script would be found or if it can be found in there at all. In the past I have just settled for some console.log action but I would love to set some breakpoints. (If not possible I am interested in other ways of inspecting javascript in this scenario.) mVChr In the Developer Tools, under the Script tab if you select fiddle.jshell.net from the dropdown, around line 20-30 (depending on

Finding JS memory leak in chrome dev tools

浪尽此生 提交于 2019-11-28 03:12:05
I’m using the chrome dev tools to work out if there is a memory leak in some JS code. The memory timeline looks good with memory being reclaimed as expected. However, the memory snapshot is confusing because it appears like there is a leak because there are entries under “Detached DOM Tree”. Is the stuff under “Detached DOM Tree” just waiting to be garbage collected or are these real leaks? Also does anyone know how to find out what function is holding on to a reference to a detached element? Those elements are being referenced in your code but they are disconnected from the page's main DOM

Javascript execution tracking in Chrome - how?

徘徊边缘 提交于 2019-11-28 03:07:53
I have ~ 100-200 javascript functions loaded on a web-site. I want to determine what javascript function is executed when i click one item or another in Google Chrome. How can i do it with Chrome Web Developer Tools? Thanks! Alexander Pavlov One simple approach is to start Chrome Developer Tools, switch to the Sources panel and hit F8 (Pause Execution). This will break on the first executed JavaScript statement. Another approach is to set an event listener breakpoint for mousedown or click: in the same Sources panel, expand the "Event Listener Breakpoints" in the righthand sidebar. Expand the

How to terminate script execution when debugging in Google Chrome?

非 Y 不嫁゛ 提交于 2019-11-28 02:53:10
When stepping through JavaScript code in Google Chrome debugger, how do I terminate script execution if I do not want to continue? The only way I found is closing the browser window. Pressing "Reload this page" runs the rest of the code and even submits forms as if pressing F8 "Continue". UPDATE : When pressing F5 (Refresh) while a script is paused: Google Chrome (v22) runs the script. If the script submits HTTP request, the HTTP response for that request is displayed. The original page is not refreshed. IE 9 just freezes. However IE has an option "Stop Debugging" which, when pressed (provided

Chrome Developer Tools: What is Snippets Support?

余生颓废 提交于 2019-11-28 02:49:53
As of version 19, Chrome's Web Inspector has an experimental feature called "snippets support". Here is how to activate it: Open chrome:flags, enable "Developer Tools experiments", restart. Open Web Inspector (Developer Tools), hit the settings gear icon in the lower right corner, enable "Snippets support", restart. Open the Scripts panel, click the "navigator tree" icon on the left, and find an empty Snippets tab. My question is: What can I use this for? How can I populate this with snippets? In short, snippets are a multi-line console, an iterative JS development workflow, and a persistent

Chrome debugging - break on next click event

孤者浪人 提交于 2019-11-28 02:46:40
We have a button. Click events are handled by a 3rd party framework, however, the framework is buggy somehow. We want to debug the framework, however, we don't know where the corresponding event handler code resides to set a breakpoint. How to generally "break on next click event" and see where and how this click is handled by the 3rd party framework? Konrad Dzwinel What you are looking for are ' Event Listener Breakpoints ' on the Sources tab. These breakpoints are triggered whenever any event listener, that listens for chosen event, is fired. You will find them in the Sources tab. In your