google-chrome-devtools

devtools console: copy is not a function while on youtube

左心房为你撑大大i 提交于 2021-02-20 10:21:04
问题 I know that I can use copy() function on the console to add content to the clipboard. When I am on any other page copy('test') works. When I am on youtube I get: Uncaught TypeError: copy is not a function How can I fix this. E.g. Is there a way to prevent a site from overriding specific functions using devtools? Strangely on firefox copy() works on youtube, so could this be a chrome bug? 回答1: Run this in console: document.querySelector('#copy').remove(); Then use copy() as normal, e.g. copy

devtools console: copy is not a function while on youtube

こ雲淡風輕ζ 提交于 2021-02-20 10:20:40
问题 I know that I can use copy() function on the console to add content to the clipboard. When I am on any other page copy('test') works. When I am on youtube I get: Uncaught TypeError: copy is not a function How can I fix this. E.g. Is there a way to prevent a site from overriding specific functions using devtools? Strangely on firefox copy() works on youtube, so could this be a chrome bug? 回答1: Run this in console: document.querySelector('#copy').remove(); Then use copy() as normal, e.g. copy

Why does google-chrome-devtools identifies less number of elements through XPath then number of elements identified through CssSelector

◇◆丶佛笑我妖孽 提交于 2021-02-19 08:27:37
问题 I am trying to identify the elements containing the reviews on this webpage using google-chrome-devtools. Using the following xpath: //div[@class='text show-more__control'] The number of elements identified are: 15 Snapshot: Using the following css-selectors: div.text.show-more__control The number of elements identified are: 25 Snapshot: So, why does google-chrome-devtools identifies less number of elements through XPath then number of elements identified through CssSelector 回答1: The XPath is

Using puppeteer how do you get all child nodes of a node?

China☆狼群 提交于 2021-02-19 07:54:47
问题 I'm having trouble finding a way to iterate subnodes of a given node in puppeteer. I do not know the html structure beforehand, just the id of the parent element. var elemId = "myelemid"; const doc = await page._client.send('DOM.getDocument'); const node = await page._client.send('DOM.querySelector', { nodeId: doc.root.nodeId, selector: '#' + elemId }); //node.children empty //node['object'].children empty //try requesting childnodes var id = node.nodeId; var childNodes = await page._client

Hover on element and getComputedStyle in Node.js using Puppeteer?

我只是一个虾纸丫 提交于 2021-02-19 05:31:38
问题 I want to hover on some element, let say document.getElementById("abc") and find its hover computed style. How should I do it in Node.js using Puppeteer? 回答1: You can use the following solution to iterate and hover over certain elements to obtain the computed style: const elements = await page.$$('.abc'); const data = []; for (let i = 0; i < elements.length; i++) { await elements[i].hover(); data.push(await page.evaluate(element => window.getComputedStyle(element), elements[i])); } console

Hover on element and getComputedStyle in Node.js using Puppeteer?

自作多情 提交于 2021-02-19 05:31:16
问题 I want to hover on some element, let say document.getElementById("abc") and find its hover computed style. How should I do it in Node.js using Puppeteer? 回答1: You can use the following solution to iterate and hover over certain elements to obtain the computed style: const elements = await page.$$('.abc'); const data = []; for (let i = 0; i < elements.length; i++) { await elements[i].hover(); data.push(await page.evaluate(element => window.getComputedStyle(element), elements[i])); } console

Import autofill data from a file into Chrome

五迷三道 提交于 2021-02-18 19:10:39
问题 I have a CSV file of users (with email and name). Google Chrome stores its autofill data and you can add them manually here: chrome://settings/addresses Is it possible to import the data automatically from the file? 回答1: The settings UI uses an internal API chrome.autofillPrivate.saveAddress (source). go to chrome://settings/addresses open devtools console paste and run the code below that adds an input button in the top right corner where you can select your CSV file: for (const el of

Import autofill data from a file into Chrome

两盒软妹~` 提交于 2021-02-18 19:09:53
问题 I have a CSV file of users (with email and name). Google Chrome stores its autofill data and you can add them manually here: chrome://settings/addresses Is it possible to import the data automatically from the file? 回答1: The settings UI uses an internal API chrome.autofillPrivate.saveAddress (source). go to chrome://settings/addresses open devtools console paste and run the code below that adds an input button in the top right corner where you can select your CSV file: for (const el of

Import autofill data from a file into Chrome

放肆的年华 提交于 2021-02-18 19:09:46
问题 I have a CSV file of users (with email and name). Google Chrome stores its autofill data and you can add them manually here: chrome://settings/addresses Is it possible to import the data automatically from the file? 回答1: The settings UI uses an internal API chrome.autofillPrivate.saveAddress (source). go to chrome://settings/addresses open devtools console paste and run the code below that adds an input button in the top right corner where you can select your CSV file: for (const el of

Content Download time Anomaly in DevTools Timings

自古美人都是妖i 提交于 2021-02-18 17:47:13
问题 I see the following anomaly in Resource Timings panel: Content Download time (from Network time) is unexpectedly high for some resource, which has been requested while loading a page: Content Download time for 1 KB is about 1 sec. although there is no network issue: I've checked that with Wireshark trace + place my browser as close to Server as it was possible. Ping shows about 0.3ms RTT. I'm just wondering if the Network performance is the only reason according to the article by Jonathan