Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send custom device-pixel-ratio? #38

Closed
kylerove opened this issue Apr 4, 2013 · 3 comments
Closed

send custom device-pixel-ratio? #38

kylerove opened this issue Apr 4, 2013 · 3 comments

Comments

@kylerove
Copy link

kylerove commented Apr 4, 2013

It would be nice to have an option to send a device-pixel-ratio other than 1 (to target retina-scale graphics on compatible sites).

@paulhammond
Copy link
Owner

I just took a quick look at the docs, and there's no obvious way to do this. The backing scale stuff happens at a pretty low level in WebKit and Cocoa - it's not just a case of supplying a scale factor when initializing the web view. That doesn't mean it's impossible, but it's not going to be easy, and I don't know when I'm going to get to it. If someone else can work out how to do it I'd love to merge their code though!

@kylerove
Copy link
Author

kylerove commented Apr 6, 2013

Thats too bad it's so low-level because manipulating it would make it easier to capture retina screenshots on non-retina displays.

Sent from Mailbox for iPhone

On Thu, Apr 4, 2013 at 12:21 PM, Paul Hammond notifications@github.com
wrote:

I just took a quick look at the docs, and there's no obvious way to do this. The backing scale stuff happens at a pretty low level in WebKit and Cocoa - it's not just a case of supplying a scale factor when initializing the web view. That doesn't mean it's impossible, but it's not going to be easy, and I don't know when I'm going to get to it. If someone else can work out how to do it I'd love to merge their code though!

Reply to this email directly or view it on GitHub:
#38 (comment)

@stefanneubig
Copy link

I saw that with phantomJS you simply do this CSS magic to get screenshots with retina resolution. Would this be an idea for webkit2png also?

document.body.style.webkitTransform = "scale(2)";
document.body.style.webkitTransformOrigin = "0% 0%";
/* fix the body width that overflows out of the viewport */
document.body.style.width = "50%";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants