News for hackers. Stuff that matters.
Re:Dimensions – Measure everything you see in the browser by peterjmag on Thursday September 11, 2014 @06:23AM (#8301752)
This is awesome! Such a wonderfully simple idea, and pretty nice execution to boot. I normally rely heavily on Cmd-Shift-4 on OS X for measuring stuff on screen (click, drag, then Esc to cancel before actually taking a screenshot), but I have a feeling this extension will be a pretty significant improvement over my approach. Great work!

For those that don't see a use case: Chrome's dev tools work well for measuring things within the context of the box model, but so much of what I measure on a regular basis isn't captured there. The best example I can think of is measurements relative to some text's baseline—the distance between the bottom baseline of some text and the border of its parent container, including adjustments for line height, padding, and related margins, for instance. This extension would also work for things that aren't even represented in the box model, like the distance between two shapes in a <canvas> element.

One feature suggestion: it'd be great to be able to click or use another keyboard shortcut to set arbitrary anchor points on the page. That way, I could measure the distance between elements that aren't necessarily on the same vertical or horizontal axis. That's one thing that OS X's screenshot utility is great for (though perhaps unintentionally).

Re:Dimensions – Measure everything you see in the browser by crisnoble on Thursday September 11, 2014 @08:28AM (#8302171)
For everyone who uses Cmd-Shift-4, try Cmd-Cntrl-Shift-4 to accomplish the same thing without risking a 31px by 2px file cluttering your desktop when you don't click Esc on time.
Re:Dimensions – Measure everything you see in the browser by ChristianBundy on Thursday September 11, 2014 @02:14PM (#8304147)
Note: this saves the image to your clipboard instead, overwriting anything you've cut/copied.
Re:Dimensions – Measure everything you see in the browser by eli on Friday September 12, 2014 @07:14AM (#8307455)
Another great reason to have a clipboard manager.
Re:Dimensions – Measure everything you see in the browser by Cowicide on Friday September 12, 2014 @10:19AM (#8308127)
Very true and I can't imagine using any device without a multi-clipboard manager. I'm pretty surprised Windows, OS X, Android, iOS, etc. don't already have them built-in by now or at least optional within the system preferences somewhere.
Re:Dimensions – Measure everything you see in the browser by Raphmedia on Thursday September 11, 2014 @08:23AM (#8302151)
Ha! I also uses the screenshot feature as a ruler.
Re:Dimensions – Measure everything you see in the browser by Flenser on Thursday September 11, 2014 @06:02AM (#8301698)
Useful for quick measurements, when you need to measure between several elements at once there's Tape: https://chrome.google.com/webstore/detail/tape/jmfleijdbicil...

And if you just want a box that can be dragged around there's Page Ruler: https://chrome.google.com/webstore/detail/page-ruler/jlpkojj...

Re:Dimensions – Measure everything you see in the browser by LukeB_UK on Thursday September 11, 2014 @07:18AM (#8301887)
I really like tape, been using it for a while now and it's come in handy a lot.
Re:Dimensions – Measure everything you see in the browser by ymir on Thursday September 11, 2014 @06:14AM (#8301723)
Disclaimer: I'ma co-creator of SnapRuler.

Great job, it's amazing how accurate it is. Getting this tool to be reliable had to be a substantial struggle.

If you find this extension useful, there might be a situation when you need to measure stuff that is not inside your browser. SnapRuler (http://www.snaprulerapp.com) is an OSX tool that can measure anything you see on screen.

Re:Dimensions – Measure everything you see in the browser by fuzzywalrus on Thursday September 11, 2014 @01:02PM (#8303703)
Funny, I was about to recommend SnapRuler.

It's become part of my daily work flow. For the price and time saved, I can't recommend it enough.

Its on my list with ColorSnapper (another small dev made utility), between the two, I rarely take screenshots anymore. I find it more useful than browser plugins as often my rendering issues are with old browsers that lack such utilities.

Re:Dimensions – Measure everything you see in the browser by hobarrera on Thursday September 11, 2014 @09:08AM (#8302323)
Any chance we'll ever see a cross-platform version of it? It looks pretty good, with all the little useful features!
Re:Dimensions – Measure everything you see in the browser by ymir on Thursday September 11, 2014 @09:38AM (#8302452)
Unfortunately not anytime soon, screen recognition mechanisms used in the app rely a lot on OSX foundations.
Re:Dimensions – Measure everything you see in the browser by samwillis on Thursday September 11, 2014 @09:02AM (#8302291)
This is rely nice, its unfortunate that it doesn't work on gradients though...

One way to fix that would be to pass the screen shot of the page (what I believe it is doing) though a edge detection filter first before measuring between colour thresholds?

Re:Dimensions – Measure everything you see in the browser by sbarre on Thursday September 11, 2014 @09:44AM (#8302489)
Yeah being able to set some kind of threshold in the edge detection would be super handy.

It also struggles with textured backgrounds..

Re:Dimensions – Measure everything you see in the browser by program on Thursday September 11, 2014 @06:28AM (#8301767)
The very interesting thing is that it goes through transparent portions of png backgrounds. Try it in the google logo.

I am very impressed.

Re:Dimensions – Measure everything you see in the browser by solutionyogi on Thursday September 11, 2014 @07:11AM (#8301870)
What? I could not believe what you wrote but you are right, it does go through transparent background.

http://i.imgur.com/byfmzAJ.png

How did he make it work? I didn't think this would be possible.

Yes, extremely impressed with the tool.

EDIT: Looked at the code. He takes screenshot of the active tab when extension is clicked. And then parses the PNG in measureDistances function when mouse moves.

https://github.com/mrflix/dimensions/blob/master/extension/d...

For a mouse at position X, Y, it tries to find the farthest Top, Bottom, Right, Left points with same color/threshold. This is why it is able to see through 'transparent' Google logo.

https://github.com/mrflix/dimensions/blob/master/js/worker.j...

Great work.

Re:Dimensions – Measure everything you see in the browser by alaskamiller on Thursday September 11, 2014 @07:22AM (#8301900)
Like http://xscopeapp.com/ but in browser
Re:Dimensions – Measure everything you see in the browser by AVTizzle on Thursday September 11, 2014 @06:01AM (#8301696)
The interactive background/header on the landing page is awesome!

It's beautiful, and does a terrific job displaying the tool's functionality in a playful, interactive way. Kudos!

Re:Dimensions – Measure everything you see in the browser by naviehuynh on Thursday September 11, 2014 @07:39AM (#8301967)
Alt+D is my favorite shortcut to focus Chrome omnibox :(
Re:Dimensions – Measure everything you see in the browser by ushi on Thursday September 11, 2014 @08:24AM (#8302156)
Then it is time to learn about Ctrl+L
Re:Dimensions – Measure everything you see in the browser by cozuya on Thursday September 11, 2014 @08:25AM (#8302162)
Or F6. I've doubled your productivity!
Re:Dimensions – Measure everything you see in the browser by hobarrera on Thursday September 11, 2014 @09:07AM (#8302318)
Ctrl+L keeps most of your fingers on the home row. ;-)
Re:Dimensions – Measure everything you see in the browser by palgrave on Thursday September 11, 2014 @10:07AM (#8302620)
Only if you have a mutant right pinky finger.
Re:Dimensions – Measure everything you see in the browser by Smirnoff on Thursday September 11, 2014 @10:27AM (#8302738)
Programmers typically swap capslock for ctrl.

So you press capslock (aka ctrl) with left hand and L with right hand -- all fingers on one row.

Re:Dimensions – Measure everything you see in the browser by smeyer on Thursday September 11, 2014 @11:05AM (#8302980)
>Programmers typically swap capslock for ctrl

I don't think typically is the right word here. I've certainly done it before, but I'd wager that under (and possibly well under) a quarter of programmers actually have this remapping on their machines. This could be totally wrong, but is based on the people I've worked with and gone to school with.

Re:Dimensions – Measure everything you see in the browser by platz on Thursday September 11, 2014 @12:50PM (#8303645)
or, just swap ctrl and alt, and then you get to press ctrl with your thumb, no pinky mutation needed.
Re:Dimensions – Measure everything you see in the browser by panorama on Thursday September 11, 2014 @06:30AM (#8301771)
This is great, installing now. I too use the cmd+shift+4 method but it's pretty unreliable.

Similarly, one thing I often find myself needing to do is find the hex or RGB value of an element of pixel on the fly. I know there are osx apps that do this but they're usually of the paid variety. Are there any good chrome extensions that can accomplish this?

Re:Dimensions – Measure everything you see in the browser by peterjmag on Thursday September 11, 2014 @06:38AM (#8301795)
There's actually a little utility called DigitalColor Meter[1] built in to OS X. It's not perfect, but it gets the job done.

[1] http://www.techrepublic.com/blog/apple-in-the-enterprise/dis...

Re:Dimensions – Measure everything you see in the browser by tomhenderson on Thursday September 11, 2014 @05:36PM (#8305291)
I made a little applescript application so I can open the system colour picker with spotlight. That way I can use the palette at the bottom to save a the colours, and the developer picker extension to copy the code.

To build it just put 'choose color' into script editor and save it as an application.

Re:Dimensions – Measure everything you see in the browser by bvm on Thursday September 11, 2014 @06:47AM (#8301819)
Re:Dimensions – Measure everything you see in the browser by jackmoore on Thursday September 11, 2014 @11:38AM (#8303184)
I use Sip, a free osx app, give it a shot: https://itunes.apple.com/us/app/sip/id507257563?mt=12
Re:Dimensions – Measure everything you see in the browser by zachrose on Thursday September 11, 2014 @06:33AM (#8301784)
I like Digital Color Meter, included with OS X.
Re:Dimensions – Measure everything you see in the browser by lfx on Thursday September 11, 2014 @05:47AM (#8301664)
This is really impressive how it calculates size between letters.

By the way source may be found here https://github.com/mrflix/dimensions

Re:Dimensions – Measure everything you see in the browser by ianbannerman on Thursday September 11, 2014 @08:00AM (#8302046)
This is great! Unforunately, does not work with iframes. A couple sites I'm stuck with are iframe heavy :/
Re:Dimensions – Measure everything you see in the browser by oakio on Thursday September 11, 2014 @10:50AM (#8302886)
I'm sorry. I've been stuck with inception style iframes on a large site. WTF, always frustrating.
Re:Dimensions – Measure everything you see in the browser by MasoInar on Thursday September 11, 2014 @07:19AM (#8301891)
Doesn't work on my machine :(

Uncaught TypeError: Cannot read property '0' of undefined tooltip.js:84

Re:Dimensions – Measure everything you see in the browser by StavrosK on Friday September 12, 2014 @04:24AM (#8307081)
Same here. Can't get this to work.
Re:Dimensions – Measure everything you see in the browser by progx on Thursday September 11, 2014 @07:18AM (#8301885)
Would be nice if you add a "copy size to clipboard" function, when click on an element.
Re:Dimensions – Measure everything you see in the browser by qpleple on Thursday September 11, 2014 @07:30AM (#8301935)
It could copy to clipboard on click, or Cmd+click.
Re:Dimensions – Measure everything you see in the browser by StephenGL on Thursday September 11, 2014 @06:23AM (#8301751)
This is super cool. It will compliment another tool I use called screen ruler very nicely!
Re:Dimensions – Measure everything you see in the browser by klausseiler on Thursday September 11, 2014 @06:37AM (#8301792)
don't know why, but the extension won't work on my retina mbp 13" http://imgur.com/3NHVDv5

on the extension website it works fine :/

Re:Dimensions – Measure everything you see in the browser by singlow on Thursday September 11, 2014 @10:09AM (#8302639)
On my Ubuntu "retina" notebook (ThinkPad) it did not work at first, because I set my default zoom level in Chrome to 175%. Once I scaled back to 100% the extensions works great. I guess it doesn't really make since to do pixel measurements when the pixels arent 1:1, so I'm not sure this should be fixed or just documented.
Re:Dimensions – Measure everything you see in the browser by mindhunter on Thursday September 11, 2014 @08:16AM (#8302106)
I developed it on a mbp 13", just not the retina version. Someone reported the bug that it doesn't work when the browser is zoomed. May that be the case for you?
Re:Dimensions – Measure everything you see in the browser by tobr on Friday September 12, 2014 @03:27AM (#8306920)
Doesn't work on my Retina MBP either, but it works on a connected regular res monitor.

The problem appears to be that it maps 2x pixels to "normal" 1x pixels as output. So all the measurements are scaled up 200%, with the top left corner as the origin.

Re:Dimensions – Measure everything you see in the browser by boernard on Thursday September 11, 2014 @08:04AM (#8302062)
Doesn't work on my mbp 13" either... Also only grabs some random measurements
Re:Dimensions – Measure everything you see in the browser by vlunkr on Thursday September 11, 2014 @10:38AM (#8302815)
I have the exact same problem. Hopefully it gets resolved, this looks really helpful!
Re:Dimensions – Measure everything you see in the browser by msane on Thursday September 11, 2014 @10:55AM (#8302920)
I want one of these that does ems, rems and even vw/vh ...
Re:Dimensions – Measure everything you see in the browser by igl on Thursday September 11, 2014 @11:05AM (#8302977)
Just testet it on a few pages... I'm sorry. It's not going to work out between the two of us.

I was hoping it was really just doing by pixel testing, but it seems to pick up on html elements too.

Or could it be buggy on my retina fisher price here?

Re:Dimensions – Measure everything you see in the browser by mindhunter on Thursday September 11, 2014 @11:10AM (#8302998)
It's picking up everything visible, not just images.
Re:Dimensions – Measure everything you see in the browser by igl on Thursday September 11, 2014 @11:58AM (#8303317)
My problem is that it is picking up invisible elements too.
Re:Dimensions – Measure everything you see in the browser by ellysetaylor21 on Thursday September 11, 2014 @09:35AM (#8302435)
Now I dont't need Crtl+u every time thanks man (Y)
Re:Dimensions – Measure everything you see in the browser by Raphmedia on Thursday September 11, 2014 @08:22AM (#8302145)
Color me impressed.

This is AMAZING.

You have no idea how easier you just made my job!

Re:Dimensions – Measure everything you see in the browser by djrconcepts on Thursday September 11, 2014 @04:32PM (#8304982)
This is a great extension! Very useful.
Re:Dimensions – Measure everything you see in the browser by oakio on Thursday September 11, 2014 @10:45AM (#8302861)
Super handy. Nice work.