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

Enable for the Safari Web Inspector in the WebKit Nightly #6

Closed
JosephPecoraro opened this issue Apr 17, 2013 · 5 comments
Closed

Enable for the Safari Web Inspector in the WebKit Nightly #6

JosephPecoraro opened this issue Apr 17, 2013 · 5 comments

Comments

@JosephPecoraro
Copy link

The Safari Web Inspector in today's WebKit Nightly now supports "%c" in format strings. http://nightly.webkit.org (r148526 or later). This also works when remotely inspecting iOS devices. Screenshot:

Screen Shot 2013-04-16 at 9 30 19 PM

Currently log.js disables support for Safari. It would be great if this was enabled for WebKit Nighty users using the Safari Web Inspector right now.

A common way to detect a WebKit Nightly user is to check for a + in WebKit number in the UserAgent, e.g. AppleWebKit/537.38+.

Safari 6.0.4:

// js> navigator.userAgent
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/536.29.13 (KHTML, like Gecko) Version/6.0.4 Safari/536.29.13"

WebKit Nightly:

// js> navigator.userAgent
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.38+ (KHTML, like Gecko) Version/6.0.4 Safari/536.29.13"
@adamschwartz
Copy link
Owner

Would detecting for an AppleWebKit version number greater than 537.38 also work? Something like this:

safariSupport = ->
    m = navigator.userAgent.match /AppleWebKit\/(\d+)\.(\d+)(\.|\+|\s)/
    return false unless m
    return 537.38 >= parseInt(m[1], 10) + (parseInt(m[2], 10) / 100)

@adamschwartz
Copy link
Owner

I tested this on my end and it seems to work. Thanks for the help here.

@JosephPecoraro
Copy link
Author

Looks great. Thanks!

@naturalethic
Copy link

Shouldn't that be 537.38 <= ...

(less than, not greater than)

@adamschwartz
Copy link
Owner

0df9ac0

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