google-chrome-devtools

AJAX works if chrome dev tools open but not if chrome web tools closed?

给你一囗甜甜゛ 提交于 2019-12-01 18:16:03
问题 I'm loading a json file via ajax. If Chrome dev tools is open, everything functions perfectly. If Chrome dev tools is closed it fails. Thankfully dev tools still keeps doing it's thing even when closed so I can still see the exception I get: Failed to load resource: the server responded with a status of 412 (Precondition Failed) http://localhost/experiments/escape/maps/test.json Why would there be a precondition on whether dev tools is open? Also, it seems unlikely that opening and closing

Django development server and MIME types

前提是你 提交于 2019-12-01 16:03:31
Is there anyway of setting MIME types in the django development server? Specifically, I would love to remove this message from the warnings in Chrome dev tools. Resource interpreted as Image but transferred with MIME type image/x-png Turns out it was as simple as adding if DEBUG: import mimetypes mimetypes.add_type("image/png", ".png", True) to settings.py 来源: https://stackoverflow.com/questions/16303098/django-development-server-and-mime-types

Chrome devtools reporting the same CSS on the same line twice

时光毁灭记忆、已成空白 提交于 2019-12-01 16:02:46
Chrome DevTools is reporting the same CSS on the same line twice. Is anyone else seeing this? How can I fix it? The problem occurs in both stable (40) and Canary (42) style.css is being loaded exactly once. It is not minified. arnolds There's a few options here: You may have included the stylesheet twice If that is not the case (you're not using preprocessors or minification) I suspect have you included two references to the same file. Use view source for this - in the network tab they would appear as the same file. HTML <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title

Debugging Revealing Module Pattern: functions not in scope until called?

自闭症网瘾萝莉.ら 提交于 2019-12-01 15:53:26
问题 If I run this code within the Chrome Developer Tools: var test = (function () { var publicFunction, privateFunction1, privateFunction2; privateFunction1 = function privateFunction1() { return true; }; privateFunction2 = function privateFunction2() { return true; }; publicFunction = function publicFunction() { privateFunction1(); debugger; }; return { publicFunction: publicFunction }; })(); why is privateFunction1 in scope at the breakpoint, while privateFunction2 is not? 回答1: Fascinating

Chrome devtools reporting the same CSS on the same line twice

限于喜欢 提交于 2019-12-01 14:50:26
问题 Chrome DevTools is reporting the same CSS on the same line twice. Is anyone else seeing this? How can I fix it? The problem occurs in both stable (40) and Canary (42) style.css is being loaded exactly once. It is not minified. 回答1: There's a few options here: You may have included the stylesheet twice If that is not the case (you're not using preprocessors or minification) I suspect have you included two references to the same file. Use view source for this - in the network tab they would

Inspect helper clone

六眼飞鱼酱① 提交于 2019-12-01 14:13:52
问题 I use the Google Chrome developer tools. When I want to inspect an element, I usually right click it and select "inspect element". This doesn't work for draggable helper clones. My code is as follows: $myElement.draggable({helper: 'clone'}); How can I inspect the helper clone that is only created once I start dragging the element? 回答1: Go to Script Sources tab In the right panel under Event Listener Breakpoints and under DOM Mutation choose DOMNodeInserted 3 . When a jQuery UI drag with clone

Chrome debugger - how to turn off console.log message grouping?

社会主义新天地 提交于 2019-12-01 13:58:28
Say, in my Google Chrome extension I do this: console.log(msg); and the Chrome debugger groups similar messages like so: Is there any any to turn it off and have messages post just as they are? It only collapses consecutive rows that are identical, I don't see it as much of a problem, but with the settings button in the top right corner of the console you can enable 'Show timestamps' which will put them on different lines: You can see they only collapse consecutive duplicates with this: msgs = ['hello', 'world', 'there']; for (i = 0; i < 20; i++) console.log(msgs[Math.floor((i/3)%3)]) The

Layer composition in the chrome dev tools

半世苍凉 提交于 2019-12-01 11:36:09
I have simple transition animation on div element. To prevent unnecessary paint events i applied to it higher z-index and 0 transformation so this div is likely to be on it's own layer. But waterfall chart shows layer composition event thats is likely to occur after each animated tick. I wonder, is this some final layer composition before GPU page render and is inevitable before every change on the page or i just doing sometning wrong? The Compositing event in Timeline is always emitted while updating the animation frame and your former assumption is correct. To validate whether your animated

How can I debug modular TypeScript with source maps?

試著忘記壹切 提交于 2019-12-01 08:47:42
I am having an impossible time trying to get TypeScript debugging working in Chrome Dev Tools. I've generated source maps for all my .ts files, and the javascript looks correct, but Chrome only loads the js file that is referenced in index.html and ignores all the modules. This kinda makes sense, because the Typescript compiler does not seem to be doing anything with my modules. If someone could explain what I'm doing wrong in the following example, that would be great. My project setup is like this: root/ src/ Company.ts User.ts app.ts index.html Company.ts module Company { export class Job {

Enable “Preserve log” in chrome programmatically using chromedriver

别等时光非礼了梦想. 提交于 2019-12-01 08:46:11
How to enable preserve log option for chrome developer settings->Preferences->Preserve log upon navigation, using chromeoptions.add_argument or by adding the pref to DesiredCapabilities or any other way programmatically. You can get redirects from performance logs. According to docs and github answer here is what I've done in C#, should be possible to port in Python: var options = new ChromeOptions(); var cap = DesiredCapabilities.Chrome(); var perfLogPrefs = new ChromePerformanceLoggingPreferences(); perfLogPrefs.AddTracingCategories(new string[] { "devtools.network" }); options