google-chrome-devtools

Why does debuggers give you “undefined is not a function” instead of just telling you the name of the property/variable that is not a function?

笑着哭i 提交于 2019-12-11 13:43:03
问题 What is the reason js debuggers gives you "undefined is not a function" instead of just telling you the name of the property/variable that is not a function? example: a = { aFunction: function(){...} notAFunction: "foo" } a.notAFunction() Gives: undefined is not a function This is more helpful: property "notAFunction" of object "a" is not a function What are the exact obstacles? 回答1: This is going to be changing very soon, it might already be in Canary too. Improved exception messages: https:

Where can I find the real memory use of a page (including images and multimedia)?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 13:19:33
问题 I noticed something odd in the Memory inspector of both Chrome and Firefox. On a large page, it will tell you how much various JavaScript objects take up, but doesn't seem to list any image/multimedia objects. In fact, in this screenshot taking from the Profiles panel in Chrome's DevTools you can see most of the memory isn't in what it reported. (You can see this even on this page, going to Profiles -> Take Heap Snapshot, selecting Statistics from the top dropdown.) Is there a more proper way

Different source from requests?

微笑、不失礼 提交于 2019-12-11 11:59:13
问题 I have a service: angular.module('services', [ ]) .service('userService', function ($http, $q, auth, userFactory) { var user = null; if(!user){ userFactory.getUser2(auth.currentUser()).getValue(function(result){ //console.log(result); user = result; console.log("request"); }); } this.getUser = function() { //console.log(user); return user; } }) ; This service calls a factory function: userFactory.getUser2 = function(usr){ return{ getValue: function(callback){ $http({ method: 'POST', url:'http

Invalid javascript/JSONP response from Soundcloud API

自作多情 提交于 2019-12-11 11:41:29
问题 When I include this url as a <script> in my HTML document, Chrome does not call my callback function, whereas it works perfectly for other urls returned by soundcloud's resolve api. After a long investigation using Chrome Dev Tools, I finally found out that the javascript returned by that call fires a SyntaxError (cf the screenshot below). How can I get my callback function to be called as usual for that file? 回答1: DevTools actually pinpoint the issue: There is an unallowed character (\u2028)

Connect external js lib to chrome event page

一曲冷凌霜 提交于 2019-12-11 11:36:01
问题 EDIT - problem solved. I just not reloaded extension properly after changing my manifest. Shame on me. I'm trying to connect some libs like JQuery to my background.js in chrome extension. Well, I found lots of tips how to do it, but I receive an error. My manifest.json: { "manifest_version": 2, "name": "Chrome WM", "version": "0.1", "content_scripts": [{ "matches": ["http://*/*","https://*/*"], "js": [ "s/jquery-1.11.1.min.js", "s/jquery.soap.js" ] }], "background": { "scripts": ["s/jquery-1

Set breakpoint to event in google chrome debugger

喜夏-厌秋 提交于 2019-12-11 11:23:54
问题 Sorry if this question was mentioned. I have web page with bunch of javascript files. One of it has function that sets value to some input on HTML file. Is it possible to see via debugger which javascript function invokes changing of value of the input HTML element? 回答1: Right click on the input tag that you are willing to observe and select Break On and then Attribute Modifications . Your scripts will stop if they try to modify the input value. 来源: https://stackoverflow.com/questions

Can't get Chrome Context Menu item to show on Chrome Extension

拈花ヽ惹草 提交于 2019-12-11 11:23:14
问题 I have a Chrome extension that opens a KML/KMZ file in Google Maps. The extension is triggered when the user right-clicks a link to the KML document. But the context menu does not appear. It uses a background script. Here is the manifest.json : { "manifest_version": 2, "name": "KML/KMZ Viewer", "version": "1.0.0", "description": "Can be used to view KML/KMZ Files.", "icons": { "19": "tiny.jpg", "24": "icon.png", "128": "image.png" }, "permissions": [ "tabs", "contextMenus", "activeTab",

chrome.webRequest cross-origin disallowed scheme on redirect to data:

烈酒焚心 提交于 2019-12-11 10:37:21
问题 I'm using chrome.webRequest api to intercept xhr's and redirect to a saved blob i have in chrome.storage.local and get this error: XMLHttpRequest cannot load http://test.com/bla.xml. The request was redirected to a URL ('data:text/xml;base64,sdfkldsfjdslfjsfsjf') which has a disallowed scheme for cross-origin requests. the chrome.webRequest api states that "Redirections to non-HTTP schemes such as data: are allowed." I've tried adding data:* or : to the permissions in the manifest with no

Google Dev Tools is stopping execution when/where no breakpoints are set

别等时光非礼了梦想. 提交于 2019-12-11 10:34:10
问题 My Google Dev Tools has recently (after an apparent upgrade to v.32.0.1700.76) started [annoyingly] stopping script execution as if a breakpoint is set (see screenshot below). Furthermore it is ignoring the “Deactivate Breakpoints” since with this option enabled script execution still stops at these phantom breakpoints. I have no breakpoints set in any of the Dev Tools options – i.e., DOM breakpoints, XHR breakpoings, Event Listener breakpoints. If I close the Dev Tools everything functions

Calling chrome.devtools.inspectedWindow.reload with injection causes Aw Snap

南笙酒味 提交于 2019-12-11 09:16:08
问题 I'm trying to create a tool that monitors the usage of some JavaScript APIs in web pages. My plan is to override the JavaScript API's, store the call information into a global variable, and then send it to content script via postMessage. However, injecting code something like below into the web page causes an "Aw Snap" error. chrome.devtools.panels.create("Test Dev Panel", "icon.png", "panel.html", function (panel) { var code = [ "window.counter = 0;", "Array.prototype.push = function () {",