Add 'webkit' CSS class to document when WebKit engine is detected.

This commit is contained in:
ccd0 2015-06-30 21:20:06 -07:00
parent 87db92f55b
commit f84f301336
2 changed files with 6 additions and 1 deletions

View File

@ -126,7 +126,7 @@ Main =
$('link[href*=mobile]', d.head)?.disabled = true
$.addClass doc, 'fourchan-x', 'seaweedchan'
$.addClass doc, if g.VIEW is 'thread' then 'thread-view' else g.VIEW
$.addClass doc, if chrome? then 'blink' else 'gecko'
$.addClass doc, $.engine if $.engine
$.addStyle Main.css, 'fourchanx-css'
keyboard = false

View File

@ -302,6 +302,11 @@ $.minmax = (value, min, max) ->
$.hasAudio = (video) ->
video.mozHasAudio or !!video.webkitAudioDecodedByteCount
$.engine = do ->
return 'blink' if /Chrome\//.test navigator.userAgent
return 'webkit' if /WebKit\//.test navigator.userAgent
return 'gecko' if /Gecko\/|Goanna/.test navigator.userAgent # Goanna = Pale Moon 26+
$.item = (key, val) ->
item = {}
item[key] = val