More fixes
This commit is contained in:
parent
a439ecf4f2
commit
fe4b037536
@ -270,15 +270,15 @@ QR =
|
|||||||
|
|
||||||
handleUrl: ->
|
handleUrl: ->
|
||||||
url = prompt("Insert an url:")
|
url = prompt("Insert an url:")
|
||||||
return if url == null
|
return if url is null
|
||||||
<% if (type === 'crx') { %>
|
<% if (type === 'crx') { %>
|
||||||
xhr = new XMLHttpRequest();
|
xhr = new XMLHttpRequest();
|
||||||
xhr.open('GET', url, true)
|
xhr.open('GET', url, true)
|
||||||
xhr.responseType = 'blob'
|
xhr.responseType = 'blob'
|
||||||
xhr.onload = (e) ->
|
xhr.onload = (e) ->
|
||||||
if @readyState is @DONE && xhr.status is 200
|
if @readyState is @DONE && xhr.status is 200
|
||||||
urlBlob = new Blob([this.response], {type : this.getResponseHeader('content-type')})
|
urlBlob = new Blob([@response], {type : @getResponseHeader('content-type')})
|
||||||
return if urlBlob.type == null
|
return if urlBlob.type is null
|
||||||
unless urlBlob.type in QR.mimeTypes
|
unless urlBlob.type in QR.mimeTypes
|
||||||
QR.error "Unsupported file type."
|
QR.error "Unsupported file type."
|
||||||
urlBlob.name = url.substr(url.lastIndexOf('/')+1, url.length)
|
urlBlob.name = url.substr(url.lastIndexOf('/')+1, url.length)
|
||||||
@ -328,7 +328,6 @@ QR =
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
|
|
||||||
handleFiles: (files) ->
|
handleFiles: (files) ->
|
||||||
if @ isnt QR # file input
|
if @ isnt QR # file input
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user