Adjusting devicePixelRatio to test media queries

133 views
Skip to first unread message

Kevin

unread,
Sep 28, 2012, 10:20:41 AM9/28/12
to chromium...@chromium.org
Hi,

I was wondering if there is a way to set the devicePixelRatio before the DOM is loaded in Chrome? The use case is so that I can easily test media queries for high density devices from within my Chrome browser that has a pixel ratio of 1.

I've tried creating an extension that uses content scripts to run before the page loads and setting window.devicePixelRatio but this did not work. Perhaps this cannot be done in JavaScript alone and is actually something that is implemented in the main codebase?

Kevin

Nico Weber

unread,
Sep 30, 2012, 8:20:26 PM9/30/12
to kbra...@googlemail.com, chromium...@chromium.org
That's currently not possible. http://crbug.com/144635 is a feature
request to enable changing the device scale factor via devtools, you
can star this issue to be notified when this becomes available.

Nico
> --
> Chromium Discussion mailing list: chromium...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-discuss
Reply all
Reply to author
Forward
0 new messages