google-chrome-devtools

customize chrome developer tool javascript debugger keyboard shortcuts?

纵饮孤独 提交于 2019-11-26 19:55:50
问题 I can't believe that neither a Google or SO search has turned up a definitive answer or even much discussion for this, but: Is it possible to edit/customize keyboard shortcuts in the Google Chrome JavaScript debugger? if so, how? I'm used to Eclipse's F5 / F6 / F7 / F8 debugger step into/over/out of/resume keys, and want the same bindings in Google Chrome. F10 / F11 are default Expose keys for OSX and therefore not ideal for debugger control. I'm open to unorthodox solutions, e.g. Quicksilver

Tool to track down JavaScript memory leak

时光毁灭记忆、已成空白 提交于 2019-11-26 19:47:46
I have a web application which has a memory leak somewhere and I am unable to detect it. I already tried the Chrome developer tools which normally works great, but I am unable to track down the lines of code which are responsible. The Chrome tools just give me too much information and I can't relate the objects in memory to my code. Are there any other tools that might be helpful? update: Lets use Record Heap Allocations profile type. open devtools profiler do a warm-up action start profiler repeat action a few times if the action has a leak you will see the same number of groups of blue bars

How to remove all recent console command

那年仲夏 提交于 2019-11-26 19:44:54
to using commands that were previously submitted by bringing focus to the console and pressing up/down key on it. I want to remove all of the recent command. I've tried this command : console.clear(); but it's still not working properly. I even clean the whole cookies and cache in the browser. but these commands still there on the console. does anyone know how? Rob W If you want to clear the list of last typed commands, follow these steps: ( Step 1 and 2 are important, don't skip them! ) Undock the console (click on the icon in the bottom-left corner, ). (if you don't see , but , then hold the

Chrome remote debugging doesn't work with IP

£可爱£侵袭症+ 提交于 2019-11-26 19:29:56
问题 I'm trying to remote debugg a chrome instance using the remote debug option in chrome: chrome.exe --remote-debugging-port=1337 as described on google page: http://code.google.com/chrome/devtools/docs/remote-debugging.html the problem is when i try to access it using IP it doesn't work, while testing it with localhost:1337 does work. any idea? 回答1: You can setup an SSH tunnel in order to debug remotely. On the source machine execute: ssh -L 0.0.0.0:9223:localhost:9222 localhost -N Then on the

Chrome DevTools search all javascript files in website

ぐ巨炮叔叔 提交于 2019-11-26 19:24:49
问题 I'm working on a new client's website that loads Javascript from a CDN so the Javascript is not embedded or inline with the webpage source. I would like to pause everytime getCurrentPosition() is executed in order to determine which external JS file it is contained in. I realize I could use other tools to do a string search through the contents of the JS files but I would rather keep to Chrome's debugging tools. Should I be trying to create a watch expression or is there another way to pin

Javascript execution tracking in Chrome - how?

天大地大妈咪最大 提交于 2019-11-26 18:51:15
问题 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! 回答1: 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

Chrome debugging - break on next click event

一世执手 提交于 2019-11-26 18:46:00
问题 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? 回答1: What you are looking for are 'Event Listener Breakpoints' on the Sources tab. These breakpoints are triggered whenever any event listener,

Making HTTP Requests using Chrome Developer tools

允我心安 提交于 2019-11-26 18:43:16
问题 Is there a way to make an HTTP request using the Chrome Developer tools without using a plugin like POSTER? 回答1: Since the Fetch API is supported by Chrome (and most other browsers), it is now quite easy to make HTTP requests from the devtools console. To GET a JSON file for instance: fetch('https://jsonplaceholder.typicode.com/posts/1') .then(res => res.json()) .then(console.log) Or to POST a new resource: fetch('https://jsonplaceholder.typicode.com/posts', { method: 'POST', body: JSON

Chrome Typescript debugging references wrong 'this'

两盒软妹~` 提交于 2019-11-26 18:32:12
问题 Sometimes when I hit a breakpoint in the Chrome Developer Tools, the TypeScript this is actually _this in the JavaScript. I have to manually put _this in the console to see what is actually being used. Is there a way to fix this? 回答1: the TypeScript this is actually _this in the JavaScript This is due to a bug in the sourcemaps. You can track it here : https://github.com/Microsoft/TypeScript/issues/2859 来源: https://stackoverflow.com/questions/31346989/chrome-typescript-debugging-references

Why {} + {} is NaN only on the client side? Why not in Node.js?

不羁的心 提交于 2019-11-26 18:19:29
While [] + [] is an empty string, [] + {} is "[object Object]" , and {} + [] is 0 . Why is {} + {} NaN? > {} + {} NaN My question isn't why ({} + {}).toString() is "[object Object][object Object]" while NaN.toString() is "NaN" , this part has an answer here already . My question is why does this happen only on the client side? On the server side ( Node.js ) {} + {} is "[object Object][object Object]" . > {} + {} '[object Object][object Object]' Summarizing : On the client side: [] + [] // Returns "" [] + {} // Returns "[object Object]" {} + [] // Returns 0 {} + {} // Returns NaN NaN.toString()