"--builtin-classes": true,
"--processes": "0",
"--warnings-exit-nonzero": true,
- "--external": "HTMLElement,HTMLDocument,Window,File,MouseEvent,KeyboardEvent,HTMLIframeElement,HTMLInputElement,XMLDocument",
+ "--external": "HTMLElement,HTMLDocument,Window,Blob,File,MouseEvent,KeyboardEvent,HTMLIframeElement,HTMLInputElement,XMLDocument",
"--output": "docs/js",
"--": [
"maintenance/jsduck/external.js",
* - It is incompatible with uploads to a foreign wiki using mw.ForeignApi
* - You must pass a HTMLInputElement and not a File for it to be possible
*
- * @param {HTMLInputElement|File} file HTML input type=file element with a file already inside
+ * @param {HTMLInputElement|File|Blob} file HTML input type=file element with a file already inside
* of it, or a File object.
* @param {Object} data Other upload options, see action=upload API docs for more
* @return {jQuery.Promise}
throw new Error( 'No file' );
}
- canUseFormData = formDataAvailable() && file instanceof window.File;
+ // Blobs are allowed in formdata uploads, it turns out
+ canUseFormData = formDataAvailable() && ( file instanceof window.File || file instanceof window.Blob );
if ( !isFileInput && !canUseFormData ) {
throw new Error( 'Unsupported argument type passed to mw.Api.upload' );
/**
* Set the file to be uploaded.
*
- * @param {HTMLInputElement|File} file
+ * @param {HTMLInputElement|File|Blob} file
*/
UP.setFile = function ( file ) {
this.file = file;
/**
* Get the file being uploaded.
*
- * @return {HTMLInputElement|File}
+ * @return {HTMLInputElement|File|Blob}
*/
UP.getFile = function () {
return this.file;