Merge pull request #1547 from MayhemYDG/cr33

Cr33
This commit is contained in:
Mayhem 2014-04-09 02:00:06 +02:00
commit d43714a9f4
2 changed files with 1 additions and 23 deletions

View File

@ -1,21 +1,8 @@
Polyfill =
init: ->
<% if (type === 'crx') { %>
@notificationPermission()
@toBlob()
@visibility()
<% } %>
notificationPermission: ->
return if !window.Notification or 'permission' of Notification or !window.webkitNotifications
Object.defineProperty Notification, 'permission',
get: ->
switch webkitNotifications.checkPermission()
when 0
'granted'
when 1
'default'
when 2
'denied'
toBlob: ->
HTMLCanvasElement::toBlob or= (cb) ->
data = atob @toDataURL()[22..]
@ -25,12 +12,3 @@ Polyfill =
for i in [0...l] by 1
ui8a[i] = data.charCodeAt i
cb new Blob [ui8a], type: 'image/png'
visibility: ->
# page visibility API
return if 'visibilityState' of d
Object.defineProperties HTMLDocument.prototype,
visibilityState:
get: -> @webkitVisibilityState
hidden:
get: -> @webkitHidden
$.on d, 'webkitvisibilitychange', -> $.event 'visibilitychange'

View File

@ -15,7 +15,7 @@
"*://i.4cdn.org/*"
],
"min": {
"chrome": "32",
"chrome": "33",
"firefox": "26",
"greasemonkey": "1.14"
}