Tag: google chrome

A very, very, very big div

For a project of mine (see BigPicture.bi or bigpicture.js GitHub project), I have to deal with potentially a very, very, very big <div> container. I knew there was a risk of poor performance with the simple approach I use, but I did not expect it to be mostly present with … Chrome only! If you […]

Chrome Extension Message passing: response not sent

I am trying to pass messages between content script and the extension Here is what I have in content-script chrome.runtime.sendMessage({type: “getUrls”}, function(response) { console.log(response) }); And in the background script I have chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { if (request.type == “getUrls”){ getUrls(request, sender, sendResponse) } }); function getUrls(request, sender, sendResponse){ var resp = sendResponse; $.ajax({ […]

How to show full object in Chrome console?

var functor=function(){ //test } functor.prop=1; console.log(functor); this only show the function part of the functor, cannot show the properties of the functor in console.

Resource interpreted as Document but transferred with MIME type application/zip

With Chrome 12.0.742.112, if I redirect with the following headers: HTTP/1.1 302 Found Location: Content-Type: text/html; charset=utf-8 Cache-Control: no-cache X-Ua-Compatible: IE=Edge X-Runtime: 0.157964 Content-Length: 0 Server: WEBrick/1.3.1 (Ruby/1.9.2/2011-02-18) Date: Tue, 05 Jul 2011 18:42:25 GMT Connection: Keep-Alive Which if followed returns the following header: HTTP/1.1 200 OK Last-Modified: Tue, 05 Jul 2011 18:18:30 GMT […]

Why is Math.pow() (sometimes) not equal to ** in JavaScript?

I’ve just discovered the ECMAScript 7 feature a**b as an alternative for Math.pow(a,b) (MDN Reference) and came across a discussion in that post, in which they apparently behave differently. I’ve tested it in Chrome 55 and can confirm that the results differ. Math.pow(99,99) returns 3.697296376497263e+197 whereas 99**99 returns 3.697296376497268e+197 So logging the difference Math.pow(99,99) – […]

How can I make setInterval also work when a tab is inactive in Chrome?

I have a setInterval running a piece of code 30 times a second. This works great, however when I select another tab (so that the tab with my code becomes inactive), the setInterval is set to an idle state for some reason. I made this simplified test case (http://jsfiddle.net/7f6DX/3/): var $div = $(‘div’); var a […]

Chrome debugging – break on next click event

We have a button. Click events are handled by a 3rd party framework, however, the framework is buggy somehow. We want to debug the framework, however, we don’t know where the corresponding event handler code resides to set a breakpoint. How to generally “break on next click event” and see where and how this click […]

How does the paste image from clipboard functionality work in Gmail and Google Chrome 12+?

I noticed a blog post from Google that mentions the ability to paste images directly from the clipboard into a Gmail message if you’re using the latest version of Chrome. I tried this with my version of Chrome (12.0.742.91 beta-m) and it works great using control keys or the context menu. From that behavior I […]

chrome undo the action of “prevent this page from creating additional dialogs”

I sometimes find that I need to re-enable alerting for debugging. Of course I can close the tab and reload it but Is there a better way?

Secret copy to clipboard JavaScript function in Chrome and Firefox?

Update Looks like browsers are starting to support copy natively in JS In the console windows of both Chrome and Firefox on Mac I can execute copy(“party in your clipboard!”); and the text gets copied to my clipboard. I have searched SO and Google and can’t seem to find anything on this. Are these specific […]