google-chrome-devtools

Chrome devtools extension console

孤人 提交于 2019-12-04 18:58:22
问题 I included this in my chrome extension manifest "devtools_page": "devtools.html" And in devtools.html I include a devtools.js file which creates a panel chrome.devtools.panels.create("Panel", "icon.png", "panel.html", function(panel){}); The panel is indeed created. And in panel.html I include a panel.js file in which I added a listener chrome.devtools.network.onRequestFinished.addListener(function(details){ console.log(details); }); But where can I see the console output of the panel? Or how

What is the difference between a Mobile and a Desktop device?

余生长醉 提交于 2019-12-04 18:12:06
问题 Using Chrome Browser DevTools I wanted to add a custom device in the Emulated devices tab. You can choose several options such as the width and height. And also choose between: Mobile Mobile (no touch) Desktop Desktop (touch) So the difference between Mobile and Desktop doesn't seem to be the touch events . Is a device of 1000*1000px screen size Mobile (no touch) and a device of 1000*1000px screen size Desktop the same? Or a device of 1000*1000px screen size Mobile and a device of 1000*1000px

Start Chrome emulation from command line

一世执手 提交于 2019-12-04 17:46:57
问题 I use Google Chrome with Intern to run automated tests and I would like to know if there is a way to launch Chrome in emulation mode from CLI or using a specific flag to test mobile rendering. If not, do you know a good workaround ? I could directly use the Android Emulator (from Android SDK) with Selenium Webdriver apk or with mobile Chrome but tests are crashing most of the time, emulators don't respond and I have to restart it. Also, I need to test on the largest possible scope, not

How to get screenshot from chrome dev tools performance frame

柔情痞子 提交于 2019-12-04 17:31:42
问题 Using Chrome dev tools, how to get exact screenshot at exact time to share 回答1: switch devtools docking mode to a separate window in the devtools settings three-dot icon. (when this option is activated you can use Ctrl Shift D to toggle docked/undocked state) invoke devtools-for-devtools by pressing Ctrl Shift i when devtools window is focused, and do the following in this new devtools-for-devtools window: open Application tab expand/open Frames - top - Images click any image URL on the left

How to access a known Ember component from console

て烟熏妆下的殇ゞ 提交于 2019-12-04 17:23:31
问题 Using Ember debug Chrome extension, I have identified this component in a website I am trying to automate (but do not have direct access to change the code): <MYAPP@component:zipcode-field::ember592> Which is shown in hierarchy as: application engine myui zipcodeField If I edit the value property of that element in the debugger, it updates the UI and model as desired. Can I do this via a one-liner from the console? Update: So far, I am able to enter this in the console: Ember.lookup.$E

Finding JavaScript function in the global scope

折月煮酒 提交于 2019-12-04 17:09:30
Is there a way to search for a JavaScript attribute (e.g. a named function) in the currently live object model (what Firebug displays on the 'DOM' tab, I couldn't find a direct equivalent in the Chrome Developer Tools) of the currently loaded page, using the common developer tools of the main browsers? An example would be that I search for 'beta' and the developer tools show me something like window.alpha.beta , meaning that some script file has created an object named 'alpha' on the window object, which has an attribute beta. I explicitly do not want to search for strings in all script files

Chrome Dev Tools hitting code but not breakpoints

风格不统一 提交于 2019-12-04 17:06:50
问题 I have breakpoints enabled on chrome dev tools and I have a breakpoint on a line. I know chrome is hitting the line because I put the breakpoint on a line that has the following statement: alert("why is this not breaking") The breakpoint works if I find the file in the localhost. The breakpoints used to function in the local editor but now they won't. Has anyone else had a similar problem? 回答1: I had a similar problem not hitting my breakpoints. Turned out it was because it was a deployed

Chrome Developer Tools Invoke Property Getter

元气小坏坏 提交于 2019-12-04 16:43:18
问题 All of my property values require me to click them in order to see them. How can I fix this? The object I'm trying to view is this Query Object. It seems to do this with most Arcgis objects I'm trying to view. 回答1: The issue is, calling a getter can have side effects e.g. class Dog { get paws() { console.log('paws!'); //side effect this.paws++; // side effect if(this.paws > 4) { throw Error('oh no'); // side effect } return this.paws; } } Every getter can alter the state of the app or break

Chrome Extension: webRequest Redirect to Existing Tab, Without Opening New Tab

走远了吗. 提交于 2019-12-04 16:35:49
When a user opens a certain page, I want to open that page in an existing tab, before a new tab is opened. I've tried with webRequest: chrome.webRequest.onBeforeRequest.addListener( function(details) { chrome.tabs.query({ url: 'https://example.com/' },function (tabs) { chrome.tabs.update(tabs[0].id, { url: details.url, highlighted: true }); }) }, {urls: ['https://example.com/']}, ['blocking'] ); I've also tried with webNavigation: chrome.webNavigation.onBeforeNavigate.addListener(function (details) { if(details.url=="https://example.com/") { chrome.tabs.query({ url: 'https://example.com/' }

How can I see the styles attached to :hover and other pseudo classes in firebug and the chrome debugger

自古美人都是妖i 提交于 2019-12-04 16:33:36
问题 I know there must be a way to do this and I've always just worked around it but, is there some way I can see (and/or edit) the pseudo-class styles applied to an element? For example, Im looking to edit .myclass:hover or #someid:active in the debugger. ps. Im really more concerned with how to do this in the chrome debugger although firebug is appreciated to! 回答1: Inspect the element, and then: For Firebug: Note that the hover CSS code will disappear if you fly over the element again (you must