google-chrome-devtools

How can we know if a function is called from console or from source code

非 Y 不嫁゛ 提交于 2019-12-29 05:30:07
问题 I want to know if there is a way to check if a javascript function is being called from console of the browser or from source code. I defined a function that can check if it's from console or from the page but it works only in google chrome, it doesn't work in firefox, I didn't test other browsers function fromConsole() { var Caller = arguments.callee.caller; while(Caller.caller != null) Caller = Caller.caller; return (Caller.toString().indexOf("function (expression, objectGroup,"))!=-1; }

Chrome Heap Snapshot - Why it doesn't show all the memory allocated?

半腔热情 提交于 2019-12-29 04:34:08
问题 I'm running some memory usage tests in a WebGL project that I have. If I start the page on Google Chrome and take a heap snapshot on the Profiles tab of Developers Tool, it will say that my page is holding 7.5 MB. The problem is if I look into Task Manager, the real value that it is using is almost 1 GB! It is expected, since I am really forcing the page to have thousands of objects, but the question is: why Chrome shows to me that I am using only 7.5 MB? 回答1: update there was native memory

Access function location programmatically

巧了我就是萌 提交于 2019-12-28 16:36:08
问题 Is it possible in code to access ["[[FunctionLocation]]"] property that google chrome developer tools show when using console log on a function ? 回答1: The answer, for now, is no . The [[FunctionLocation]] property you see in Inspector is added in V8Debugger::internalProperties() in the debugger's C++ code, which uses another C++ function V8Debugger::functionLocation() to gather information about the function. functionLocation() then uses a number of V8-specific C++ APIs such as v8::Function:

How to use chrome web inspector to view hover code

那年仲夏 提交于 2019-12-28 08:37:40
问题 Using chromes web inspector to view code is very useful. But how do you view for example the hover code for a button? You will have to hover the mouse over the button and thus cannot use it (mouse) in the inspector. Are there any shortcuts or other ways to accomplish this in the inspector? 回答1: Now you can see both the pseudo-class style rules and force them on elements. To see the rules like :hover in the Styles pane click the small dotted box button in the top right. To force an element

Google Chrome default console context

北战南征 提交于 2019-12-28 04:19:04
问题 Lately when opening the Google Chrome developer console, the context has been wrong. I load a page, press Ctrl + Shift + J and get this: http://i.imgur.com/2eTJgD0.png It changes extensions sometimes but it should be 'top'. I can change the context manually each time but this is getting kind of annoying to do. 回答1: This issue was reported and fixed on the Chromium issue tracker. The revision #396058 has not made it into Chrome stable yet, but you can see that it is fixed in Chrome Canary. It

Chrome developer tools workspace mappings

时光怂恿深爱的人放手 提交于 2019-12-28 02:32:09
问题 Can anyone tell me how the Chrome developer tools workspace mappings work. I believe it is only available in Canary at the moment. I thought it is supposed to allow me to make changes to the CSS rules in the elements view and have them automatically saved to the local files as demonstrated by Paul Irish at Google IO 2013. I can't get this functionality to work. https://developers.google.com/events/io/sessions/325206725 回答1: It works only in canary at the moment. EDIT: Now in Chrome (since ver

chrome developer tools - undock sources tab

不羁岁月 提交于 2019-12-25 19:58:10
问题 Is there a way to undock the sources tab using Chrome developer tools? If I had 3 monitors, I would like: Webpage to be on monitor 1 Elements tab to be displayed on monitor 2 Sources tab to be shown on monitor 3 回答1: Open several devtools tabs for the same target tab and choose a different view in each one. Preparations: exit Chrome by using the "Exit" command in the browser menu run Chrome with --remote-debugging-port=9222 command line you can use any number in 1024-65535 range, 9222 is the

Change local variable or function parameter in google chrome

左心房为你撑大大i 提交于 2019-12-25 18:14:44
问题 I'm using chrome's devtools to debug/modify a non-local javascript file(so I can't edit it). The code is rather complex and defines function inside of functions and uses these pointers throughout. The point is that I do not know where I'm exactly at in the process but I can set a breakpoint to a variable I need to modify. BUT I can't figure out how to modify it. I can add a watch or modify it under the locals panel BUT it won't actually change (after stepping once the value reverts to

why does a Body Tag shift if you have a child with a top margin

走远了吗. 提交于 2019-12-25 16:54:50
问题 I have spent a good chunk of my time to figure this out. In case you have a div with some margin on the top. The body position as per the chrome dev tools start from the point where the div starts from. Basically it doesn't consider the margin for the offset. Though it does considers the same for height calculation. Eg - <body> <div> my content my content my content my content my content my content my content my </div> </body> I have created a jsFiddle for the same -- http://jsfiddle.net

Using shortcuts in mac for debugging

不问归期 提交于 2019-12-25 09:50:10
问题 I read the following doc and when I use for example the f10 for stepping to the next line /function it doesn't work when I use the ctrl+ ' this is working but I want to use the Fn... buttons ,there is a way to configure it that the F buttons will work in debugging like in windows? https://developers.google.com/web/tools/chrome-devtools/iterate/inspect-styles/shortcuts?hl=en 回答1: Have you tried Fn + f10? On Mac that generally makes the function keys act as normal, rather than changing the