google-chrome-devtools

Phantomjs page.onConsoleMessage doesn't log warnings

回眸只為那壹抹淺笑 提交于 2019-12-08 05:46:17
问题 I'm using Phantomjs to detect errors/warnings on my pages by hooking console messages : page.onConsoleMessage = function(msg, line, source) { console.log(msg); } page.open(page.address, function (status) { if (status !== 'success') { console.log('Fail to load the address'); } else { for(var i=0;i<page.errors.length;i++) { console.log(page.errors[i]); } } phantom.exit(); }); It works fine with the errors, but it does not record the warnings. By errors and warnings, I mean what Chrome console

AngularJS ngModelController

♀尐吖头ヾ 提交于 2019-12-08 05:30:24
问题 What is the correct way to check ngModelController validity? I have a valid controller object inside of a directive. If I log the object to the console from inside the directive I get: console.log(ctrl) $dirty: false $invalid: true $modelValue: "" $name: undefined $pristine: true $valid: false $viewValue: "" ... then, if I ask if( ctrl.$valid === true ) to log the object to the console again, it does with the exact same output. console.log(ctrl); //ctrl.$valid is false if(ctrl.$valid == true)

How to get notified on window resize in chrome browser

☆樱花仙子☆ 提交于 2019-12-08 05:20:35
问题 I am writing an extension for chrome browser where , I wanted to add event listener for the window resize event. I am getting my method executed for window load event , but not getting for resize event. Below mention is code for my manifest.json file { "name": "A browser action", "version": "1.0", "background": { "scripts": ["background.js"] }, "permissions": [ "tabs", "http://*/*" ], "manifest_version": 2 } Below mention is code for my background.js file. var myExtension = { init: function()

Extra render time in Chrome Dev Tools Timeline Frames

时光总嘲笑我的痴心妄想 提交于 2019-12-08 03:36:42
问题 There are plenty of videos and tutorials out there geared towards reducing the compositing, layout, and paint times for a frame using Dev tools, but I'm not clear of what to do once those times are well below the allotted time, but the frame still takes far too long to render. Any tips on determining what exactly is happening in a frame that causes it to render so slowly? 回答1: Paul Irish and Paul Lewis touch this topic briefly here. According to this video, white bar indicates browser waiting

How to modify content under a devtools panel in a Chrome extension?

老子叫甜甜 提交于 2019-12-08 02:13:40
问题 I am working on Google Extension where I am adding new panel to the developer tools and it seems to be working fine for me. But I don't know how to modify the content of the panel through JavaScript. Could anyone enlighten me? 回答1: Displaying content in a panel is not that hard. First, I assume that you've created the base extension (consisting of manifest.json , devtools.html and devtools.js ) following the documentation. devtools.html contains at least <script src="/devtools.js"></script> .

Cannot use Chrome Live Edit with Webpack source maps

北城以北 提交于 2019-12-08 01:49:16
问题 I have a webpack 4 configuration that generates source maps for my app's JavaScript. While debugging my app in Chrome, the source maps get loaded so I can see my unimified code. I'll set a breakpoint in a function and in the Sources tab I'll make edits to the code. I hit CMD+S to save my edits. Normally, I would expect Chrome to think for a little bit while it processes my edits and then I can continue debugging my session with my code changes. But that doesn't happen. I get a little yellow

How Self & Total time is calculated having Google Chrome's devtools profile report (cpuprofile file)

两盒软妹~` 提交于 2019-12-08 00:26:55
问题 I'm writing tool to parse and extract some data from cpuprofile file (file produced when I save profile report) and I'm having some troubles with precision of Self & Total times calculations. So, time depends on the value from field hitCount , but. When hitCount is small (<300) the coefficient between hitCount and Self time ~1.033. But as hitCount grows, coefficient also grows. So, when hitCount=3585, k is 1.057. When hitCount=7265: k=1.066. Currently I'm using 1.035 as coefficient, I tried

extension using background, content and devtools together

梦想的初衷 提交于 2019-12-07 20:06:37
问题 I've been trying to figure this out from the docs and samples but there just isn't enough there yet (or maybe I'm missing something?). I want to create a devtools panel but I still want access to the inspected window's dom like I get in content scripts. Right now my option is eval something in the context of the inspected window, but i would really rather not do that if I can avoid it. If I can just use a content script along with my devtools page/scripts that would be idea, but it doesn't

Google Chrome DevTools Extension - Detect Page Change

我怕爱的太早我们不能终老 提交于 2019-12-07 18:25:42
问题 I am trying to detect when the webpage has changed from a Google Chrome DevTools Extension. I currently have a devtools.html & devtools.js that detects if a condition is true and if it is, it adds the dev tool panel. chrome.devtools.inspectedWindow.eval(/*my test*/, function (result, exception) { if ( exception === undefined && result === true ) { chrome.devtools.panels.create("My Panel", "", "panel.html", function (panel) { ... The problem is, if I open up the dev tool, and then navigate to

Chrome: this extension loaded itself too frequently

旧时模样 提交于 2019-12-07 14:44:25
问题 I’m building a custom Chrome extension. Sporadically my extension shows this message. This extension loaded itself too frequently What does this mean? Maybe I’m exceeding some threshold which disables the extension? 回答1: You've called chrome.runtime.reload too often. Chrome considers a reload a "fast reload" when you call chrome.runtime.reload within ten seconds after loading the extension. When your extension triggers more than five "fast reloads", then the following warning will be shown in