google-chrome-devtools

Interacting with require.js modules from the Firebug/Chrome console?

孤街浪徒 提交于 2019-11-29 22:51:28
I'm just getting started with require.js. I have successfully wrapped jquery, some plugins, and a couple of my own modules. I'm trying to interact with my modules (or jquery) from Firebug (or Google Chrome's JS console), and I'm not having much luck. What is the correct way to access these modules from the console? Say we have module /app/scripts/methodsModule.js that returns a few methods: define({ someMethod: function() { // do stuff }, anotherMethod: function() { // do some more stuff } }); In our data-main file /app/scripts/main.js we have: require(['methodsModule'], function(methods) {

Calling a Javascript Function from Console

送分小仙女□ 提交于 2019-11-29 22:46:49
In Chrome's JavaScript console, how do I call a function that belongs to a .js file included in the webpage I am viewing? If it's inside a closure, i'm pretty sure you can't. Otherwise you just do functionName(); and hit return. An example of where the console will return ReferenceError is putting a function inside a JQuery document ready function //this will fail $(document).ready(function () { myFunction(alert('doing something!')); //other stuff } To succeed move the function outside the document ready function //this will work myFunction(alert('doing something!')); $(document).ready

Break when window.location changes? [duplicate]

十年热恋 提交于 2019-11-29 22:46:40
This question already has an answer here: Break javascript before an inline javascript redirect in Chrome 3 answers I've got a page that's redirecting when it shouldn't be, and I'm trying to figure out who's doing it. First I tried hijacking window.location: window.location = (function (location) { // location is now hidden inside a closure. We can override it var Location = Object.create(location); // Location is now our proxy. We can use it to catch changes window.__defineGetter__('location', function () { return Location }); window.__defineSetter__('location', function (x) { debugger;

Chrome 59+ websocket frames no longer visible in DevTools

此生再无相见时 提交于 2019-11-29 22:04:52
Ever since I upgrade from Chrome 58 => 59 on Mac OS El Capitan, when I use Dev Tools Network inspector to view WebSocket frames, the frames no longer are visible. We build an app that makes heavy use of WS, so I rely heavily on this capability. I thought perhaps it was something maybe we changed in our app -- encoding or protocol that maybe causes it to not show up, so I tried this simple test here: https://websocket.org/echo.html Open DevTools Go to https://websocket.org/echo.html Go to Network tab, filter on WS, go to Frames tab Click Connect in echo app followed by Send Message This results

How can I keep the “Console Drawer” hidden by default every time I open Chrome DevTools?

ぐ巨炮叔叔 提交于 2019-11-29 21:17:07
When I have DevTools open, there is a little button that toggles Hide Drawer. and Show Console. . Besides being inconsistently named, the 'drawer' is very annoying to me because it takes up so much of the little screen real estate allotted for devtools (i'm bottom docked). How can I keep this 'drawer' closed permanently? Or if I can't do that, can I at least keep the height of it as low as possible? (it returns to a default height every time I open it) I solved same problem removing the flag from "Spoof user agent" option under the "Emulation" tab (I don't even know why it was flagged!). At

Show Elements when logging jQuery object in Chrome Dev Tools console?

隐身守侯 提交于 2019-11-29 21:04:42
It seems like something has changed lately with Chrome Dev Tools. Logging a jQuery object with console.log used to show the Element of the DOM node in the console. Something like this: [<a href="#employees">Employees</a>] Now it has changed to a clickable object like this: [<a>, context: <a>] Is there a way to go back to the old style of object logging or even a different method to call on console ? I'm currently using version 23.0.1271.64 . Not sure exactly which version brought the change. J.Wells If you want console.log() to spit out the DOM element, you need to log the DOM element and not

Javascript Memory Leaks: Detached DOM tree

痴心易碎 提交于 2019-11-29 21:03:26
I have noticed that the memory of the browser starts increasing whilst I am in a form (this is noticeable from the task manager). In IE 9, this goes easily over 500MB after some usage, whilst chrome is more resilient (goes to 200MB using same test). I am using the chrome developer tools to debug this issue. I have noticed that there is a large number of Detached DOM tree: I am assuming that this can confirm that there is a memory leak. Would that be correct? Secondly, I would need to find out how to identify the root cause of the problem. I know that you should use the retaining tree to

How can I inspect element in an Android browser?

泪湿孤枕 提交于 2019-11-29 20:52:32
I want to inspect my website CSS/HTML elements in my Android browser. However it will be over a smartphone or the Android SDK. What is the best way to do it? Michael Aaron Safyan Chrome on Android makes it possible to use the Chrome developer tools on the desktop to inspect the HTML that was loaded from the Chrome application on the Android device. See: https://developers.google.com/chrome-developer-tools/docs/remote-debugging Had to debug a site for native Android browser and came here. So I tried weinre on an OS X 10.9 (as weinre server) with Firefox 30.0 (weinre client) and an Android 4.1.2

How to increase number of Call Stack entries in Google Chrome Developer Tools (or Firefox)?

风流意气都作罢 提交于 2019-11-29 20:46:44
How to increase number of Call Stack entries in Google Chrome Developer Tools (or Firefox Firebug)? I am getting a Javascript error in a third party control's Javascript. All the calls in the Call Stack window do not belong to my own code. I want to know which line in my code triggered the sequence of events. The Call Stack is not large enough to display something from my own code. JasonS Chrome solution https://github.com/v8/v8/wiki/Stack%20Trace%20API can set via commandline on startup --js-flags="--stack-trace-limit <value>" or at runtime at loading a page: Error.stackTraceLimit=undefined /

Can I do anything about “repaints on scroll” warning in Chrome for “overflow:scroll” div

巧了我就是萌 提交于 2019-11-29 20:45:50
In Chrome DevTools, under Rendering, there's an option to "Show potential scroll bottlenecks". When I enabled this, some div elements I have on the screen with overflow:scroll show a flag at the top saying "repaints on scroll." I can't find a lot of documentation on this feature, and I don't know whether it's something I can actually fix or improve upon, or just a statement of fact - the divs have content, and they do indeed scroll. lepix You can apply this CSS on the div with overflow: scroll or overflow: auto that create scroll bottlenecks. transform: translateZ(0); -webkit-transform: