google-chrome-devtools

Is there an alternative to preprocessorScript for Chrome DevTools extensions?

本秂侑毒 提交于 2020-01-13 12:00:14
问题 I want to create a custom profiler for Javascript as a Chrome DevTools Extension. To do so, I'd have to instrument all Javascript code of a website (parse to AST, inject hooks, generate new source). This should've been easily possible using chrome.devtools.inspectedWindow.reload() and its parameter preprocessorScript described here: https://developer.chrome.com/extensions/devtools_inspectedWindow. Unfortunately, this feature has been removed (https://bugs.chromium.org/p/chromium/issues/detail

What is the source of the double-dollar sign selector query function in Chrome/Firefox?

最后都变了- 提交于 2020-01-13 10:14:09
问题 Check this jsfiddle, and have a look at the console. $$ is not defined. Now, open a completely new window, and enter $$ into a console. It defines a function for getting a (jquery-like) array of all the dom elements which match the selector: > $$ bound: function () { return document.querySelectorAll.apply(document, arguments) } Is this being added by Dev tools? It is also present when using Firebug in Firefox. Is it used internally by the tools themselves? 回答1: Well, Firebug Lite defines this

Is it possible to audit multiple pages with Chrome Developer tools?

隐身守侯 提交于 2020-01-12 18:51:16
问题 I am trying to find out unused CSS class in my website, and then I found that there is a audit function in Chrome developer tools that will mark unused CSS classes. However, it is only doing one page at a time. Is there a way to make it audit multiple pages so that I can find out CSS classes that are not used in all pages? I know there is a Firefox plugin Dust-Me that do the job. I am asking just to find if I can do that with Chrome alone, as I am more familiar with Chrome Developer tools.

Is it possible to audit multiple pages with Chrome Developer tools?

安稳与你 提交于 2020-01-12 18:50:34
问题 I am trying to find out unused CSS class in my website, and then I found that there is a audit function in Chrome developer tools that will mark unused CSS classes. However, it is only doing one page at a time. Is there a way to make it audit multiple pages so that I can find out CSS classes that are not used in all pages? I know there is a Firefox plugin Dust-Me that do the job. I am asking just to find if I can do that with Chrome alone, as I am more familiar with Chrome Developer tools.

Blue number in Chrome Dev Console?

陌路散爱 提交于 2020-01-12 13:46:26
问题 In javascript I have a variable that I push to console.log then increment it and push it to the log again, which shows the below in the Chrome Dev Tools. This variable has done some freaky stuff, like if I try to use the += operator to add to it, it actually puts the added value after the number (for example if x=5 and I did x+=3 , x would equal 53 ). The really boggling part of this is that incrementing it with ++ works as expected, but my question isn't why that's happening but rather why

Double dollar $$() vs Dollar sign $() in Chrome console behavior

被刻印的时光 ゝ 提交于 2020-01-12 08:09:22
问题 In our project, there is a different functionality when one Dollar sign used $() in Chrome console vs two Dollar signs $$(), besides the known difference that $$() return an array an $() return the first element. For example, selector for specific element, with one dollar and two dollar queries: $$(".my-class[my-attribute='trump']") //works $('.my-class[my-attribute=sanders]') //works $$('.my-class[my-attribute=trump]') //not work What is the source and explanation for this behavior? 回答1:

Double dollar $$() vs Dollar sign $() in Chrome console behavior

早过忘川 提交于 2020-01-12 08:08:10
问题 In our project, there is a different functionality when one Dollar sign used $() in Chrome console vs two Dollar signs $$(), besides the known difference that $$() return an array an $() return the first element. For example, selector for specific element, with one dollar and two dollar queries: $$(".my-class[my-attribute='trump']") //works $('.my-class[my-attribute=sanders]') //works $$('.my-class[my-attribute=trump]') //not work What is the source and explanation for this behavior? 回答1:

Remote debugging - how to create a port proxy?

自古美人都是妖i 提交于 2020-01-12 08:03:07
问题 I'm trying to access remote debugging port running on box A (Debian) from box B (Windows). On box A I'm running Chrome with --remote-debugging-port=9222 flag and I can see that it works correctly (I can access localhost:9222 from another browser on A). Also, I'm sure that boxes A and B are connected because I can access :80 (apache) running on box A from box B just fine. Thing I need to do now is to allow box B access :9222 on box A. I've done research on port forwarding and iptables rules

How to delete existing text from input using Puppeteer?

拟墨画扇 提交于 2020-01-12 06:59:27
问题 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 methods1 that allow deleting or replacing existing text. 回答1: You can use page.evaluate to manipulate DOM as you see fit: await

React.js app using up a lot of memory ( almost double the original implementation )

百般思念 提交于 2020-01-12 01:49:06
问题 I recently ported a heavy page to React. I've kept the html almost identical. The main difference being that, earlier, the server rendered html was directly given to the browser and now, the react rewrite pulls json via a server side API and uses React to manage the DOM. I've seen heap snapshots for the earlier implementation going up to 55 MBs . For the same data, the heap snapshot for the React.js implementation comes to around 100+ MBs (almost double) I understand that the json data held