google-chrome-devtools

Unable to Live Edit Javascript in Chrome Developer Tools

余生长醉 提交于 2019-12-04 02:09:55
I have done this a million times, i.e open the javascript file in the "Sources" tab, edit and hit CTRL+S to save it, upon which Chrome would confirm the same with a "Recompilation and Update Succeeded". But I can no longer do this! There is no confirmation message in the console. Also, the source window turns reddish indicating failure to do so. The same script is getting edited from a different system. I am on Chrome 41.0.2272.101m / WIN8. The script is not "prettified", just to rule that answer out.! Try using workspaces: https://developer.chrome.com/devtools/docs/workspaces Add the project

How can I measure wasted renders in React 16?

天大地大妈咪最大 提交于 2019-12-04 02:00:53
I previously used the react-addons-perf package to measure various things like wasted renders via Perf.printWasted() . Unfortunately, this package was retired in React 16 in favor of Chrome's Performance tab which doesn't have equivalent tools. I'm aware of why-did-you-update , but this isn't exactly the same. Is there any way in React 16 to measure wasted renders? Yes, react-addons-perf was retired, and you will not get them for React 16 and further (into Fiber) as stated by Dan Abramov in this issue . Edit 09-2018 : there is a profiler for React DevTools announced recently, now you can use

Layer composition in the chrome dev tools

拟墨画扇 提交于 2019-12-04 01:52:51
问题 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? 回答1: The Compositing event in Timeline is always emitted

How does Chrome dev tools generate CSS selectors?

元气小坏坏 提交于 2019-12-04 01:36:44
问题 When adding a new style rule for an element, the selector that Chrome generates contains the entire hierarchy instead of just the class name. For example: <body> <div class="container"> <span class="helper"></span> </div> </body> Adding a new style rule for .helper will generate a selector like body > div > span instead of just .helper . Why is this? 回答1: It's not possible to give an exact analysis of a browser's implementation unless I look at the source itself. But what I can say is that

How to delete existing text from input using Puppeteer?

左心房为你撑大大i 提交于 2019-12-04 00:54:37
I'm trying to test amending text in an editable input which contains the title of the current record - and I want to able to test editing such text, replacing it with something else. I know I can use await page.type('#inputID', 'blah'); to insert "blah" into the textbox (which in my case, having existing text, only appends "blah"), however, I cannot find any page methods 1 that allow deleting or replacing existing text. You can use page.evaluate to manipulate DOM as you see fit: await page.evaluate( () => document.getElementById("inputID").value = "") However sometimes just manipulating a

How do you apply style rule in Safari Web Inspector?

限于喜欢 提交于 2019-12-04 00:44:30
Chrome Developer Tools allows you to apply a style rule in the Styles pane. I haven't found a way to do this in Safari (Style Rules pane). Any one know if it is possible? Also, does Safari have rulers like Chrome does? Safari 8.0.8 on OS X Right-click any element and select Inspect Element from the pop-up menu Ensure Styles and Rules are selected on the right hand side of the inspector You can then either add individual rules by clicking + New Rule , or simply click and start typing rules where Click to Edit appears (refer to image below) Enter your new rules and these will be applied to the

How to use getEventListeners in Chrome Dev Tool?

ε祈祈猫儿з 提交于 2019-12-04 00:26:10
I tried to trace back which function hooked into a click event of .someclass . I open Chrome Dev Tool and type this getEventListeners(document.querySelector('.someclass')); The result is this Object {} I cannot click and open it to find out the name of the object or the source code that handle click event. Is there a way to find out? UPDATE 1: Followed Krasimir's advise below. There could be only two events: mousemove or mouseover . So how do I find out the exact function handling that event for canvas.overlay ? There are just too many to drill down into. Open the DevTools Open the Elements

How to view css stylesheet injected by a Google Chrome extension using dev tools?

こ雲淡風輕ζ 提交于 2019-12-04 00:23:00
I'm injecting a css file from my chrome extension using the manifest.json ( full source ): "content_scripts": [ { "matches": [ "http://*/*" ], "css":["src/inject/gfi_extension.css"], "js": [/*...*/] } ] In Chrome Dev Tools, if I inspect an element which is affected by the injected css, the rules are visible, but in the upper right where the source filename would normally be, it just says "injected stylesheet." I'd like to view ALL of the rules being injected, even those that affect elements which do not currently exist in the DOM. I would have expected the .css to appear in "sources" under

How can I dump the entire Web DOM in its current state in Chrome?

血红的双手。 提交于 2019-12-03 23:51:03
问题 I want to dump the current DOM to a file and be able to view it offline. Essentially, I have an outdated version of a page that I would like to keep around for comparison. As soon as I close my browser, I'm going to lose it so I would like to save the DOM exactly as it is. There is already an answer for doing this in Firefox but how do I do it in Chrome? 回答1: Using the Web Inspector (F12), go to the Elements tab, right click on the <html> tag in your code and select Copy -> Copy outerHTML .

Chrome Responsive Emulator - How to default zoom to 100%

匆匆过客 提交于 2019-12-03 23:43:49
One of the most annoying things I encounter on a daily basis is constantly having to reset the zoom of the chrome device emulator. For whatever reason, each time I change the device selection, the zoom changes from 100% to the "Fit to Window" size, which is always less than 100% and renders the page and text so tiny its unusable. I've seen the "Edit" menu under the device listing, and this is where I would expect to find the setting to always default the zoom to 100%, however, I'm not seeing it there. What am I missing? Giorgos Ploumakis I had this problem for a while. Go to the right top menu