diff --git a/app/manifest.json b/app/manifest.json index 4a7ebd7..81d5d83 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -3,7 +3,7 @@ "name": "ChromeMyAdmin", "short_name": "MyAdmin", "description": "This application provides you 'MySQL GUI Admin console' windows.", - "version": "2.5.0", + "version": "2.5.1", "author": "Yoichiro Tanaka", "app": { "background": { diff --git a/app/scripts/lib/mysql_js_driver_1.8.0.min.js b/app/scripts/lib/mysql_js_driver_1.8.1.min.js similarity index 87% rename from app/scripts/lib/mysql_js_driver_1.8.0.min.js rename to app/scripts/lib/mysql_js_driver_1.8.1.min.js index f9364ad..17341aa 100644 --- a/app/scripts/lib/mysql_js_driver_1.8.0.min.js +++ b/app/scripts/lib/mysql_js_driver_1.8.1.min.js @@ -1,3 +1,3 @@ -/*! MySQL JavaScript Driver 1.8.0 Copyright (c) 2014 Yoichiro Tanaka. Apache License Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) */ +/*! MySQL JavaScript Driver 1.8.1 Copyright (c) 2014 Yoichiro Tanaka. Apache License Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) */ !function(){"use strict";var a={};"undefined"==typeof module?window.MySQL=a:module.exports=a}(),function(){"use strict";var a=function(){this.errorCodeMap={"-1":"IO_PENDING","-2":"FAILED","-3":"ABORTED","-4":"INVALID_ARGUMENT","-5":"INVALID_HANDLE","-6":"FILE_NOT_FOUND","-7":"TIMED_OUT","-8":"FILE_TOO_BIG","-9":"UNEXPECTED","-10":"ACCESS_DENIED","-11":"NOT_IMPLEMENTED","-12":"INSUFFICIENT_RESOURCES","-13":"OUT_OF_MEMORY","-14":"UPLOAD_FILE_CHANGED","-15":"SOCKET_NOT_CONNECTED","-16":"FILE_EXISTS","-17":"FILE_PATH_TOO_LONG","-18":"FILE_NO_SPACE","-19":"FILE_VIRUS_INFECTED","-20":"BLOCKED_BY_CLIENT","-21":"NETWORK_CHANGED","-22":"BLOCKED_BY_ADMINISTRATOR","-23":"SOCKET_IS_CONNECTED","-100":"CONNECTION_CLOSED","-101":"CONNECTION_RESET","-102":"CONNECTION_REFUSED","-103":"CONNECTION_ABORTED","-104":"CONNECTION_FAILED","-105":"NAME_NOT_RESOLVED","-106":"INTERNET_DISCONNECTED","-107":"SSL_PROTOCOL_ERROR","-108":"ADDRESS_INVALID","-109":"ADDRESS_UNREACHABLE","-110":"SSL_CLIENT_AUTH_CERT_NEEDED","-111":"TUNNEL_CONNECTION_FAILED","-112":"NO_SSL_VERSIONS_ENABLED","-113":"SSL_VERSION_OR_CIPHER_MISMATCH","-114":"SSL_RENEGOTIATION_REQUESTED","-115":"PROXY_AUTH_UNSUPPORTED","-116":"CERT_ERROR_IN_SSL_RENEGOTIATION","-117":"BAD_SSL_CLIENT_AUTH_CERT","-118":"CONNECTION_TIMED_OUT","-119":"HOST_RESOLVER_QUEUE_TOO_LARGE","-120":"SOCKS_CONNECTION_FAILED","-121":"SOCKS_CONNECTION_HOST_UNREACHABLE","-122":"NPN_NEGOTIATION_FAILED","-123":"SSL_NO_RENEGOTIATION","-124":"WINSOCK_UNEXPECTED_WRITTEN_BYTES","-125":"SSL_DECOMPRESSION_FAILURE_ALERT","-126":"SSL_BAD_RECORD_MAC_ALERT","-127":"PROXY_AUTH_REQUESTED","-128":"SSL_UNSAFE_NEGOTIATION","-129":"SSL_WEAK_SERVER_EPHEMERAL_DH_KEY","-130":"PROXY_CONNECTION_FAILED","-131":"MANDATORY_PROXY_CONFIGURATION_FAILED","-133":"PRECONNECT_MAX_SOCKET_LIMIT","-134":"SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED","-135":"SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY","-136":"PROXY_CERTIFICATE_INVALID","-137":"NAME_RESOLUTION_FAILED","-138":"NETWORK_ACCESS_DENIED","-139":"TEMPORARILY_THROTTLED","-140":"HTTPS_PROXY_TUNNEL_RESPONSE","-141":"SSL_CLIENT_AUTH_SIGNATURE_FAILED","-142":"MSG_TOO_BIG","-143":"SPDY_SESSION_ALREADY_EXISTS","-145":"WS_PROTOCOL_ERROR","-146":"PROTOCOL_SWITCHED","-147":"ADDRESS_IN_USE","-148":"SSL_HANDSHAKE_NOT_COMPLETED","-149":"SSL_BAD_PEER_PUBLIC_KEY","-150":"SSL_PINNED_KEY_NOT_IN_CERT_CHAIN","-151":"CLIENT_AUTH_CERT_TYPE_UNSUPPORTED","-152":"ORIGIN_BOUND_CERT_GENERATION_TYPE_MISMATCH","-153":"SSL_DECRYPT_ERROR_ALERT","-154":"WS_THROTTLE_QUEUE_TOO_LARGE","-155":"TOO_MANY_SOCKET_STREAMS","-156":"SSL_SERVER_CERT_CHANGED","-157":"SSL_INAPPROPRIATE_FALLBACK","-158":"CT_NO_SCTS_VERIFIED_OK","-159":"SSL_UNRECOGNIZED_NAME_ALERT","-200":"CERT_COMMON_NAME_INVALID","-201":"CERT_DATE_INVALID","-202":"CERT_AUTHORITY_INVALID","-203":"CERT_CONTAINS_ERRORS","-204":"CERT_NO_REVOCATION_MECHANISM","-205":"CERT_UNABLE_TO_CHECK_REVOCATION","-206":"CERT_REVOKED","-207":"CERT_INVALID","-208":"CERT_WEAK_SIGNATURE_ALGORITHM","-210":"CERT_NON_UNIQUE_NAME","-211":"CERT_WEAK_KEY","-212":"CERT_NAME_CONSTRAINT_VIOLATION","-213":"CERT_END","-300":"INVALID_URL","-301":"DISALLOWED_URL_SCHEME","-302":"UNKNOWN_URL_SCHEME","-310":"TOO_MANY_REDIRECTS","-311":"UNSAFE_REDIRECT","-312":"UNSAFE_PORT","-320":"INVALID_RESPONSE","-321":"INVALID_CHUNKED_ENCODING","-322":"METHOD_NOT_SUPPORTED","-323":"UNEXPECTED_PROXY_AUTH","-324":"EMPTY_RESPONSE","-325":"RESPONSE_HEADERS_TOO_BIG","-326":"PAC_STATUS_NOT_OK","-327":"PAC_SCRIPT_FAILED","-328":"REQUEST_RANGE_NOT_SATISFIABLE","-329":"MALFORMED_IDENTITY","-330":"CONTENT_DECODING_FAILED","-331":"NETWORK_IO_SUSPENDED","-332":"SYN_REPLY_NOT_RECEIVED","-333":"ENCODING_CONVERSION_FAILED","-334":"UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT","-335":"INVALID_SPDY_STREAM","-336":"NO_SUPPORTED_PROXIES","-337":"SPDY_PROTOCOL_ERROR","-338":"INVALID_AUTH_CREDENTIALS","-339":"UNSUPPORTED_AUTH_SCHEME","-340":"ENCODING_DETECTION_FAILED","-341":"MISSING_AUTH_CREDENTIALS","-342":"UNEXPECTED_SECURITY_LIBRARY_STATUS","-343":"MISCONFIGURED_AUTH_ENVIRONMENT","-344":"UNDOCUMENTED_SECURITY_LIBRARY_STATUS","-345":"RESPONSE_BODY_TOO_BIG_TO_DRAIN","-346":"RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH","-347":"INCOMPLETE_SPDY_HEADERS","-348":"PAC_NOT_IN_DHCP","-349":"RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION","-350":"RESPONSE_HEADERS_MULTIPLE_LOCATION","-351":"SPDY_SERVER_REFUSED_STREAM","-352":"SPDY_PING_FAILED","-353":"PIPELINE_EVICTION","-354":"CONTENT_LENGTH_MISMATCH","-355":"INCOMPLETE_CHUNKED_ENCODING","-356":"QUIC_PROTOCOL_ERROR","-357":"RESPONSE_HEADERS_TRUNCATED","-358":"QUIC_HANDSHAKE_FAILED","-400":"CACHE_MISS","-401":"CACHE_READ_FAILURE","-402":"CACHE_WRITE_FAILURE","-403":"CACHE_OPERATION_NOT_SUPPORTED","-404":"CACHE_OPEN_FAILURE","-405":"CACHE_CREATE_FAILURE","-406":"CACHE_RACE","-407":"CACHE_CHECKSUM_READ_FAILURE","-408":"CACHE_CHECKSUM_MISMATCH","-501":"INSECURE_RESPONSE","-502":"NO_PRIVATE_KEY_FOR_CERT","-503":"ADD_USER_CERT_FAILED","-601":"FTP_FAILED","-602":"FTP_SERVICE_UNAVAILABLE","-603":"FTP_TRANSFER_ABORTED","-604":"FTP_FILE_BUSY","-605":"FTP_SYNTAX_ERROR","-606":"FTP_COMMAND_NOT_SUPPORTED","-607":"FTP_BAD_COMMAND_SEQUENCE","-701":"PKCS12_IMPORT_BAD_PASSWORD","-702":"PKCS12_IMPORT_FAILED","-703":"IMPORT_CA_CERT_NOT_CA","-704":"IMPORT_CERT_ALREADY_EXISTS","-705":"IMPORT_CA_CERT_FAILED","-706":"IMPORT_SERVER_CERT_FAILED","-707":"PKCS12_IMPORT_INVALID_MAC","-708":"PKCS12_IMPORT_INVALID_FILE","-709":"PKCS12_IMPORT_UNSUPPORTED","-710":"KEY_GENERATION_FAILED","-711":"ORIGIN_BOUND_CERT_GENERATION_FAILED","-712":"PRIVATE_KEY_EXPORT_FAILED","-713":"SELF_SIGNED_CERT_GENERATION_FAILED","-714":"CERT_DATABASE_CHANGED","-800":"DNS_MALFORMED_RESPONSE","-801":"DNS_SERVER_REQUIRES_TCP","-802":"DNS_SERVER_FAILED","-803":"DNS_TIMED_OUT","-804":"DNS_CACHE_MISS","-805":"DNS_SEARCH_EMPTY","-806":"DNS_SORT_ERROR"}};a.prototype.getErrorMessage=function(a){return this.errorCodeMap[String(a)]},MySQL.networkErrorCode=new a}(),function(){"use strict";var a=function(){};a.prototype.sha1ToWordArray=function(a){return CryptoJS.SHA1(a)},a.prototype.sha1ToUint8Array=function(a){var b=this.sha1ToWordArray(a);return this.wordArrayToUnit8Array(b)},a.prototype.sha1Uint8ArrayToUint8Array=function(a){var b=this.uint8ArrayToWords(a),c=CryptoJS.lib.WordArray.create(b,a.length);return this.sha1ToUint8Array(c)},a.prototype.uint8ArrayToWords=function(a){for(var b=a.length,c=[],d=0;b>d;d++)c[d>>>2]|=a[d]<<24-d%4*8;return c},a.prototype.wordArrayToUnit8Array=function(a){for(var b=new ArrayBuffer(a.sigBytes),c=new DataView(b,0,b.byteLength),d=0;d=0&&250>=a)return b=new Uint8Array(1),b[0]=a,b;var d=new ArrayBuffer(4),e=new DataView(d);e.setUint32(0,a,!1);var f=new Uint8Array(d),g=4;for(c=0;c=251&&2==g){for(b=new Uint8Array(3),b[0]=252,c=0;g>c;c++)b[c+1]=f[f.length-1-c];return b}if(3==g){for(b=new Uint8Array(4),b[0]=253,c=0;g>c;c++)b[c+1]=f[f.length-1-c];return b}for(b=new Uint8Array(9),b[0]=254,c=0;g>c;c++)b[c+1]=f[f.length-1-c];return b},b.prototype.createNullEndString=function(b){var c=a.stringToArrayBuffer(b);return this.createNullEndValue(c)},b.prototype.getNullEndString=function(b,c){for(var d=new Uint8Array(b),e=c;e=d)return{result:d,nextPosition:b+1};var e=0;e=252==d?2:253==d?3:8;for(var f=c.subarray(b+1,b+1+e),g=new ArrayBuffer(8),h=new Uint8Array(g),i=0;ih.nextPosition+4){var m=d-h.nextPosition+4;l=b.getFixedLengthString(a,h.nextPosition+4,m)}return new e(g,i,j,k,l)},m=function(a,c,d){var e=b.getFixedLengthInteger(a,c,2),g=b.getFixedLengthString(a,c+2,1),h=b.getFixedLengthString(a,c+3,5),i=d-c-8,j=b.getFixedLengthString(a,c+8,i);return new f(e,g,h,j)};k.prototype.generateStatisticsRequest=function(){var a=new ArrayBuffer(1),b=new Uint8Array(a);return b[0]=9,b},k.prototype.generateQueryRequest=function(b){var c=a.stringToArrayBuffer(b),d=new Uint8Array(c),e=a.createUint8Array(1+d.length);return e[0]=3,e.set(d,1),e},k.prototype.generateInitDBRequest=function(b){var c=a.stringToArrayBuffer(b),d=new Uint8Array(c),e=a.createUint8Array(1+d.length);return e[0]=2,e.set(d,1),e},k.prototype.generateSSLRequest=function(a,c){var d=559617;c&&(d|=65536,d|=131072);var e=b.createFixedLengthInteger(d,4),f=b.createFixedLengthInteger(16777215,4),g=b.createLengthEncodedInteger(33),h=e.length+f.length+g.length+23,i=new ArrayBuffer(h),j=new Uint8Array(i),k=0;return j.set(e,k),k+=e.length,j.set(f,k),k+=f.length,j.set(g,k),j},k.prototype.generateHandshakeResponse=function(a,c,d,e){var f=557569;e&&(f|=65536,f|=131072);var g,h=b.createFixedLengthInteger(f,4),i=b.createFixedLengthInteger(16777215,4),j=b.createLengthEncodedInteger(33),k=b.createNullEndString(c);g=null===d?0:b.createLengthEncodedInteger(d.length);var l=b.createNullEndString(a.authPluginName),m=h.length+i.length+j.length+23+k.length+l.length;m+=null===d?1:g.length+d.length;var n=new ArrayBuffer(m),o=new Uint8Array(n),p=0;return o.set(h,p),p+=h.length,o.set(i,p),p+=i.length,o.set(j,p),p+=j.length,p+=23,o.set(k,p),p+=k.length,null===d?(o.set([0],p),p+=1):(o.set(g,p),p+=g.length,o.set(d,p),p+=d.length),o.set(l,p),o},k.prototype.generatePasswordHash=function(a,b){var d=c.sha1ToUint8Array(b),e=c.sha1Uint8ArrayToUint8Array(d),f=a.authPluginDataPart1,g=a.authPluginDataPart2,h=new ArrayBuffer(f.length+g.length+e.length),i=new Uint8Array(h);i.set(f,0),i.set(g,f.length),i.set(e,f.length+g.length);for(var j=c.sha1Uint8ArrayToUint8Array(i),k=new Uint8Array(d.length),l=0;la?d.call(this,a,b,c,e,f):e(c)}.bind(this),f)},e=function(a,c,d){f.call(this,a,function(d){var e=b.getFixedLengthInteger(d.data,0,a);c(e)}.bind(this),d)},f=function(a,b,c){this.socketImpl.read(a,b,c)};c.prototype.setSocketImpl=function(a){this.socketImpl=a},c.prototype.connect=function(a,b,c){this.socketImpl.connect(a,b,c)},c.prototype.disconnect=function(a){this.socketImpl.disconnect(a)},c.prototype.isConnected=function(){return this.socketImpl.isConnected()},c.prototype.readPacket=function(b,c){e.call(this,3,function(d){e.call(this,1,function(e){this.incrementSequenceNumber(e),f.call(this,d,function(c){var d=new a(e,c.data);b(d)}.bind(this),c)}.bind(this),c)}.bind(this),c)},c.prototype.readPluralPackets=function(a,b,c){d.call(this,0,a,[],b,c)},c.prototype.writePacket=function(a,b,c){this.socketImpl.write(a,b,c)},c.prototype.incrementSequenceNumber=function(a){this.nextSequenceNumber=a+1,this.nextSequenceNumber>255&&(this.nextSequenceNumber=0)},c.prototype.createPacket=function(b){return new a(this.nextSequenceNumber,b)},c.prototype.resetSequenceNumber=function(){this.nextSequenceNumber=0},c.prototype.establishTls=function(a,b,c,d){this.socketImpl.establishTls(a,b,c,d)},MySQL.communication=new c}(MySQL.Packet,MySQL.types),function(a,b,c){"use strict";var d=function(){},e=function(c,d,e,g,h){a.readPacket(function(a){var i=b.parseInitialHandshakePacket(a);f.call(this,i,c,d,e,g,h)}.bind(this),h)},f=function(c,d,e,f,g,h){var i;i=e?b.generatePasswordHash(c,e):null;var j=b.generateHandshakeResponse(c,d,i,f),k=a.createPacket(j.buffer);a.writePacket(k,function(){a.readPacket(function(a){var d=b.parseOkErrResultPacket(a);g(c,d)}.bind(this),h)}.bind(this),h)},g=function(c,d,e,g,h,i,j){a.readPacket(function(k){var l=b.parseInitialHandshakePacket(k),m=b.generateSSLRequest(l,h),n=a.createPacket(m.buffer);a.writePacket(n,function(){a.establishTls(c,d,function(){a.incrementSequenceNumber(n.sequenceNumber),f.call(this,l,e,g,h,i,j)}.bind(this),j)}.bind(this),j)}.bind(this),j)},h=function(c,d,e){a.readPacket(function(a){var f=b.parseEofPacket(a);if(f)d(c,f);else{var g=b.parseResultsetRowPacket(a);c.push(g),h.call(this,c,d,e)}}.bind(this),e)},i=function(c,d,e,f,g){a.readPluralPackets(c,function(c){for(var e=[],f=0;f=0?e.call(this,f,g,h,i,k):j(a+"("+c.getErrorMessage(a)+")")}.bind(this))},d.prototype.loginWithSSL=function(b,d,e,f,h,i,j,k,l,m){a.connect(b,d,function(a){a>=0?g.call(this,i,j,e,f,h,k,m):l(a+"("+c.getErrorMessage(a)+")")}.bind(this))},d.prototype.logout=function(b){a.disconnect(b)},d.prototype.query=function(b,c,d,e,f){return a.isConnected()?(a.resetSequenceNumber(),void k.call(this,b,c,d,e,f)):void f("Not connected.")},d.prototype.getNextQueryResult=function(b,c,d,e){return a.isConnected()?void j.call(this,b,c,d,e):void e("Not connected.")},d.prototype.getDatabases=function(b,c,d){return a.isConnected()?void this.query("SHOW DATABASES",function(a,c){for(var d=[],e=0;e=0?d:null,c(a)}.bind(this))}.bind(this))},a.prototype.isConnected=function(){return null!==this.socketId},a.prototype.disconnect=function(a){this.socketId&&(chrome.socket.disconnect(this.socketId),chrome.socket.destroy(this.socketId)),this.socketId=null,a&&a()},a.prototype.write=function(a,b,c){chrome.socket.write(this.socketId,a.getArrayBuffer(),function(a){var d=a.bytesWritten;d>0?b(a):(console.log("Error: writeInfo.bytesWritten="+d),c("Sending packet failed: "+d))}.bind(this))},a.prototype.read=function(a,b,c){chrome.socket.read(this.socketId,a,function(a){var d=a.resultCode;d>0?b(a):(console.log("Error: readInfo.resultCode="+d+" data="+a.data),c("Reading packet failed: "+d))}.bind(this))},MySQL.ChromeSocket=a}(),function(){var a=function(){this.socketId=null,this.initialize(),this.callbacks=[],this.buffer=new ArrayBuffer(0),b.call(this),this.host=null,this.ca=null,this.checkCommonName=!1},b=function(){this.tlsRequiredByteLength=0,this.tlsBuffer="",this.tls={open:!1},this.tlsSendCallback=null,this.tlsSendErrorCallback=null},c=function(a){var b=this.buffer.byteLength+a.byteLength,c=new ArrayBuffer(b),d=new Uint8Array(c,0,b);d.set(new Uint8Array(this.buffer,0,this.buffer.byteLength),0),d.set(new Uint8Array(a,0,a.byteLength),this.buffer.byteLength),this.buffer=c,this.fetch()},d=function(a,b){for(var c=new ArrayBuffer(a.length),d=new Uint8Array(c),e=0;e=this.tlsRequiredByteLength&&(this.tlsRequiredByteLength=this.tls.process(this.tlsBuffer),this.tlsBuffer="")}.bind(this))},g=function(a,b,c){chrome.sockets.tcp.send(this.socketId,a,function(a){var d=a.resultCode;0===d?b(a):(console.log("Error: writeInfo.resultCode="+d),c("Sending data failed: "+d))}.bind(this))};a.prototype.initialize=function(){chrome.sockets.tcp.onReceive.addListener(function(a){this.socketId===a.socketId&&this.onReceive(a)}.bind(this)),chrome.sockets.tcp.onReceiveError.addListener(function(a){this.socketId===a.socketId&&this.onReceiveError(a)}.bind(this))},a.prototype.onReceive=function(a){var b=a.data;this.tls.open?f.call(this,b):c.call(this,b)},a.prototype.onReceiveError=function(a){this.raiseError(a)},a.prototype.raiseError=function(a){if(this.callbacks.length>0){var b=this.callbacks[0];b.fatalCallback("Network error occurred: "+a.resultCode),this.callbacks=this.callbacks.slice(1)}},a.prototype.fetch=function(){if(this.callbacks.length>0){var a,b,c,d,e=this.callbacks[0];if(e.length>0){if(this.buffer.byteLength>=e.length){a=new ArrayBuffer(e.length),b=new Uint8Array(a,0,a.byteLength),c=new Uint8Array(this.buffer,0,this.buffer.byteLength),b.set(c.subarray(0,e.length));var f=new ArrayBuffer(this.buffer.byteLength-e.length),g=new Uint8Array(f,0,f.byteLength);g.set(c.subarray(e.length,c.byteLength),0),this.buffer=f,this.callbacks=this.callbacks.slice(1),d={resultCode:0,data:a},e.callback(d),this.fetch()}}else-1===e.length?(a=new ArrayBuffer(this.buffer.byteLength),b=new Uint8Array(a,0,a.byteLength),c=new Uint8Array(this.buffer,0,this.buffer.byteLength),b.set(c.subarray(0,this.buffer.byteLength)),this.buffer=new ArrayBuffer(0),this.callbacks=this.callbacks.slice(1),d={resultCode:0,data:a},e.callback(d),this.fetch()):console.log("Invalid data.length: "+e.length)}},a.prototype.connect=function(a,b,c){var d=null;chrome.sockets.tcp.create({bufferSize:16777215},function(e){d=e.socketId,chrome.sockets.tcp.connect(d,a,b,function(b){b>=0?(this.socketId=d,this.host=a):(this.socketId=null,this.host=null),this.ca=null,c(b)}.bind(this))}.bind(this))},a.prototype.isConnected=function(){return null!==this.socketId},a.prototype.disconnect=function(a){this.socketId&&(this.tls.open&&this.tls.close(),chrome.sockets.tcp.disconnect(this.socketId),chrome.sockets.tcp.close(this.socketId)),this.socketId=null,this.host=null,this.ca=null,this.callbacks=[],this.buffer=new ArrayBuffer(0),b.call(this),a&&a()},a.prototype.write=function(a,b,c){this.tls.open?e.call(this,a.getArrayBuffer(),function(a){this.tlsSendCallback=b,this.tlsSendErrorCallback=c,this.tls.prepare(a)}.bind(this)):g.call(this,a.getArrayBuffer(),b,c)},a.prototype.read=function(a,b,c){this.callbacks.push({length:a,callback:b,fatalCallback:c})},a.prototype.establishTls=function(a,b,c,d){this.ca=a,this.checkCommonName=b,k.call(this,c,d),chrome.sockets.tcp.setPaused(this.socketId,!0,function(){this.tls.handshake(),chrome.sockets.tcp.setPaused(this.socketId,!1)}.bind(this))};var h=function(a,b,c,d){if(!d||!d[0])return!1;if(!i.call(this,d[0],this.host))return!1;if(!this.ca)return!0;var e=forge.pki.certificateFromPem(this.ca);if(!i.call(this,e,this.host))return!1;if(e.verify(d[0]))return!0;var f=forge.pki.getPublicKeyFingerprint(e.publicKey,{encoding:"hex"}),g=forge.pki.getPublicKeyFingerprint(d[0].publicKey,{encoding:"hex"});return f===g?!0:!1},i=function(a,b){var c=a.subject.getField("CN");if(c&&c.value&&j.call(this,c,b))return!0;var d=a.getExtension({name:"subjectAltName"});if(!d||!d.altNames)return!1;for(var e=d.altNames,f=e.length-1;f>=0;f--)if(e[f]&&e[f].value&&j.call(this,e[f],b))return!0;return!1},j=function(a,b){if(this.checkCommonName){var c=new RegExp(a.value.replace(/\./g,"\\.").replace(/\*/g,".*"),"i");return c.test(b)}return!0},k=function(a,b){this.tls=forge.tls.createConnection({server:!1,sessionId:null,caStore:[],sessionCache:null,cipherSuites:[forge.tls.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA,forge.tls.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA],virtualHost:null,verify:function(a,b,c,d){return h.call(this,a,b,c,d)}.bind(this),getCertificate:null,getPrivateKey:null,getSignature:null,deflate:null,inflate:null,connected:function(){a()},tlsDataReady:function(a){var b=a.tlsData.getBytes();b.length>0&&d.call(this,b,function(a){g.call(this,a,function(a){var b=this.tlsSendCallback;this.tlsSendCallback=null,b&&b(a)}.bind(this),function(a){var b=this.tlsSendErrorCallback;this.tlsSendErrorCallback=null,b&&b(a)}.bind(this))}.bind(this))}.bind(this),dataReady:function(a){d.call(this,a.data.getBytes(),function(a){c.call(this,a)}.bind(this))}.bind(this),closed:function(){}.bind(this),error:function(a,c){console.log(c),b(c.message)}.bind(this)})};MySQL.ChromeSocket2=a}(),function(){"use strict";var a=function(a){this.message=a};a.prototype=new Error,a.prototype.name="ParseError",MySQL.ParseError=a -}(),function(a){var b=!1,c="delimiter ",d=function(){this.result=[],this.stateMap={query:this.query.bind(this),lineStart:this.lineStart.bind(this),escapedQuery:this.escapedQuery.bind(this),sharpComment:this.sharpComment.bind(this),maybeDashComment:this.maybeDashComment.bind(this),dashComment:this.dashComment.bind(this),maybeInlineCommentStart:this.maybeInlineCommentStart.bind(this),inlineComment:this.inlineComment.bind(this),maybeInlineCommentEnd:this.maybeInlineCommentEnd.bind(this),maybeDelimiterDef:this.maybeDelimiterDef.bind(this),delimiterDef:this.delimiterDef.bind(this),delimiterDefEnd:this.delimiterDefEnd.bind(this),maybeDelimiter:this.maybeDelimiter.bind(this)},this.currentState=this.stateMap.lineStart,this.buffer=[],this.maybeDashCommentCount=0,this.maybeDelimiterDefBuffer=[],this.maybeDelimiterDefCount=0,this.delimiterDefCandidate=[],this.delimiter=";",this.maybeDelimiterCount=0,this.skipDelimiterCheck=!1},e=function(){var a=this.buffer.join(""),b=f.call(this,a);b&&this.result.push(a),this.buffer=[]},f=function(a){return a.replace(/^[  \t\r\n]+|[  \t\r\n]+$/g,"")};d.prototype.parse=function(b){try{return this.evaluate(b,0),e.call(this),this.result[this.result.length-1]+=this.maybeDelimiterDefBuffer.join(""),{success:!0,result:this.result}}catch(c){if(c instanceof a)return{success:!1,error:c};throw c}},d.prototype.evaluate=function(a,b){if(a.length!==b){var c=a.charAt(b),d=this.currentState(a,c,b);this.evaluate(a,b+d)}},d.prototype.lineStart=function(a,c){return b&&console.log("lineStart: "+c)," "===c?(this.buffer.push(c),1):"d"===c?(this.currentState=this.stateMap.maybeDelimiterDef,this.maybeDelimiterDefBuffer=[c],this.maybeDelimiterDefCount=0,1):(this.currentState=this.stateMap.query,0)},d.prototype.query=function(a,c){b&&console.log("query: "+c+" [delimiter="+this.delimiter+"]");var d=this.skipDelimiterCheck;return this.skipDelimiterCheck=!1,"\\"===c?(this.buffer.push(c),this.currentState=this.stateMap.escapedQuery,1):d||c!==this.delimiter.charAt(0)||1!==this.delimiter.length?d||c!==this.delimiter.charAt(0)?"#"===c?(this.buffer.push(c),this.currentState=this.stateMap.sharpComment,1):"-"===c?(this.buffer.push(c),this.currentState=this.stateMap.maybeDashComment,this.maybeDashCommentCount=0,1):"/"===c?(this.buffer.push(c),this.currentState=this.stateMap.maybeInlineCommentStart,1):"\n"===c?(this.buffer.push(c),this.currentState=this.stateMap.lineStart,1):(this.buffer.push(c),1):(this.currentState=this.stateMap.maybeDelimiter,this.maybeDelimiterCount=0,1):(e.call(this),1)},d.prototype.escapedQuery=function(a,c){return b&&console.log("escapedQuery: "+c),this.buffer.push(c),this.currentState=this.stateMap.query,1},d.prototype.sharpComment=function(a,c){return b&&console.log("sharpComment: "+c),"\n"===c?(this.buffer.push(c),this.currentState=this.stateMap.lineStart,1):(this.buffer.push(c),1)},d.prototype.maybeDashComment=function(a,c){return b&&console.log("maybeDashComment: "+c),0===this.maybeDashCommentCount&&"-"===c?(this.buffer.push(c),this.maybeDashCommentCount++,1):1===this.maybeDashCommentCount&&" "===c?(this.buffer.push(c),this.currentState=this.stateMap.dashComment,1):(this.buffer.push(c),this.currentState=this.stateMap.query,1)},d.prototype.dashComment=function(a,c){return b&&console.log("dashComment: "+c),"\n"===c?(this.buffer.push(c),this.currentState=this.stateMap.lineStart,1):(this.buffer.push(c),1)},d.prototype.maybeInlineCommentStart=function(a,c){return b&&console.log("maybeInlineCommentStart: "+c),"*"===c?(this.buffer.push(c),this.currentState=this.stateMap.inlineComment,1):(this.buffer.push(c),this.currentState=this.stateMap.query,1)},d.prototype.inlineComment=function(a,c){return b&&console.log("inlineComment: "+c),"*"===c?(this.buffer.push(c),this.currentState=this.stateMap.maybeInlineCommentEnd,1):(this.buffer.push(c),1)},d.prototype.maybeInlineCommentEnd=function(a,c){return b&&console.log("maybeInlineCommentEnd: "+c),"*"===c?(this.buffer.push(c),1):"/"===c?(this.buffer.push(c),this.currentState=this.stateMap.query,1):(this.buffer.push(c),this.currentState=this.stateMap.inlineComment,1)},d.prototype.maybeDelimiterDef=function(a,d){return b&&console.log("maybeDelimiterDef: "+d),this.maybeDelimiterDefCount++,d.toLowerCase()===c.charAt(this.maybeDelimiterDefCount).toLowerCase()?this.maybeDelimiterDefCount+1===c.length?(this.currentState=this.stateMap.delimiterDef,this.delimiterDefCandidate=[],this.maybeDelimiterDefBuffer=[],1):(this.maybeDelimiterDefBuffer.push(d),1):(this.buffer=this.buffer.concat(this.maybeDelimiterDefBuffer),this.buffer.push(d),this.currentState=this.stateMap.query,1)},d.prototype.delimiterDef=function(c,d,f){if(b&&console.log("delimiterDef: "+d)," "===d)return 0===this.delimiterDefCandidate.length?1:(this.delimiter=this.delimiterDefCandidate.join(""),this.currentState=this.stateMap.delimiterDefEnd,e.call(this),1);if("\n"===d){if(0===this.delimiterDefCandidate.length)throw new a("Delimiter not defined at "+f);return this.delimiter=this.delimiterDefCandidate.join(""),this.currentState=this.stateMap.lineStart,e.call(this),1}return this.delimiterDefCandidate.push(d),1},d.prototype.delimiterDefEnd=function(a,c){return b&&console.log("delimiterEnd: "+c),"\n"===c?(this.currentState=this.stateMap.lineStart,1):1},d.prototype.maybeDelimiter=function(a,c){return b&&console.log("maybeDelimiter: "+c),this.maybeDelimiterCount++,c===this.delimiter.charAt(this.maybeDelimiterCount)?this.maybeDelimiterCount+1===this.delimiter.length?(e.call(this),this.currentState=this.stateMap.query,1):1:(this.currentState=this.stateMap.query,this.skipDelimiterCheck=!0,-1*this.maybeDelimiterCount)},d.prototype.setDebug=function(a){b=a},MySQL.QueryDivider=d}(MySQL.ParseError); \ No newline at end of file +}(),function(a){var b=!1,c="delimiter ",d=function(){this.result=[],this.stateMap={query:this.query.bind(this),lineStart:this.lineStart.bind(this),escapedQuery:this.escapedQuery.bind(this),sharpComment:this.sharpComment.bind(this),maybeDashComment:this.maybeDashComment.bind(this),dashComment:this.dashComment.bind(this),maybeInlineCommentStart:this.maybeInlineCommentStart.bind(this),inlineComment:this.inlineComment.bind(this),maybeInlineCommentEnd:this.maybeInlineCommentEnd.bind(this),maybeDelimiterDef:this.maybeDelimiterDef.bind(this),delimiterDef:this.delimiterDef.bind(this),delimiterDefEnd:this.delimiterDefEnd.bind(this),maybeDelimiter:this.maybeDelimiter.bind(this)},this.currentState=this.stateMap.lineStart,this.buffer=[],this.maybeDashCommentCount=0,this.maybeDelimiterDefBuffer=[],this.maybeDelimiterDefCount=0,this.delimiterDefCandidate=[],this.delimiter=";",this.maybeDelimiterCount=0,this.skipDelimiterCheck=!1},e=function(){var a=this.buffer.join(""),b=f.call(this,a);b&&this.result.push(a),this.buffer=[]},f=function(a){return a.replace(/^[  \t\r\n]+|[  \t\r\n]+$/g,"")};d.prototype.parse=function(b){try{return this.evaluate(b),e.call(this),this.result[this.result.length-1]+=this.maybeDelimiterDefBuffer.join(""),{success:!0,result:this.result}}catch(c){if(c instanceof a)return{success:!1,error:c};throw c}},d.prototype.evaluate=function(a){for(var b=0;a.length!==b;){var c=a.charAt(b),d=this.currentState(a,c,b);b+=d}},d.prototype.lineStart=function(a,c){return b&&console.log("lineStart: "+c)," "===c?(this.buffer.push(c),1):"d"===c?(this.currentState=this.stateMap.maybeDelimiterDef,this.maybeDelimiterDefBuffer=[c],this.maybeDelimiterDefCount=0,1):(this.currentState=this.stateMap.query,0)},d.prototype.query=function(a,c){b&&console.log("query: "+c+" [delimiter="+this.delimiter+"]");var d=this.skipDelimiterCheck;return this.skipDelimiterCheck=!1,"\\"===c?(this.buffer.push(c),this.currentState=this.stateMap.escapedQuery,1):d||c!==this.delimiter.charAt(0)||1!==this.delimiter.length?d||c!==this.delimiter.charAt(0)?"#"===c?(this.buffer.push(c),this.currentState=this.stateMap.sharpComment,1):"-"===c?(this.buffer.push(c),this.currentState=this.stateMap.maybeDashComment,this.maybeDashCommentCount=0,1):"/"===c?(this.buffer.push(c),this.currentState=this.stateMap.maybeInlineCommentStart,1):"\n"===c?(this.buffer.push(c),this.currentState=this.stateMap.lineStart,1):(this.buffer.push(c),1):(this.currentState=this.stateMap.maybeDelimiter,this.maybeDelimiterCount=0,1):(e.call(this),1)},d.prototype.escapedQuery=function(a,c){return b&&console.log("escapedQuery: "+c),this.buffer.push(c),this.currentState=this.stateMap.query,1},d.prototype.sharpComment=function(a,c){return b&&console.log("sharpComment: "+c),"\n"===c?(this.buffer.push(c),this.currentState=this.stateMap.lineStart,1):(this.buffer.push(c),1)},d.prototype.maybeDashComment=function(a,c){return b&&console.log("maybeDashComment: "+c),0===this.maybeDashCommentCount&&"-"===c?(this.buffer.push(c),this.maybeDashCommentCount++,1):1===this.maybeDashCommentCount&&" "===c?(this.buffer.push(c),this.currentState=this.stateMap.dashComment,1):(this.buffer.push(c),this.currentState=this.stateMap.query,1)},d.prototype.dashComment=function(a,c){return b&&console.log("dashComment: "+c),"\n"===c?(this.buffer.push(c),this.currentState=this.stateMap.lineStart,1):(this.buffer.push(c),1)},d.prototype.maybeInlineCommentStart=function(a,c){return b&&console.log("maybeInlineCommentStart: "+c),"*"===c?(this.buffer.push(c),this.currentState=this.stateMap.inlineComment,1):(this.buffer.push(c),this.currentState=this.stateMap.query,1)},d.prototype.inlineComment=function(a,c){return b&&console.log("inlineComment: "+c),"*"===c?(this.buffer.push(c),this.currentState=this.stateMap.maybeInlineCommentEnd,1):(this.buffer.push(c),1)},d.prototype.maybeInlineCommentEnd=function(a,c){return b&&console.log("maybeInlineCommentEnd: "+c),"*"===c?(this.buffer.push(c),1):"/"===c?(this.buffer.push(c),this.currentState=this.stateMap.query,1):(this.buffer.push(c),this.currentState=this.stateMap.inlineComment,1)},d.prototype.maybeDelimiterDef=function(a,d){return b&&console.log("maybeDelimiterDef: "+d),this.maybeDelimiterDefCount++,d.toLowerCase()===c.charAt(this.maybeDelimiterDefCount).toLowerCase()?this.maybeDelimiterDefCount+1===c.length?(this.currentState=this.stateMap.delimiterDef,this.delimiterDefCandidate=[],this.maybeDelimiterDefBuffer=[],1):(this.maybeDelimiterDefBuffer.push(d),1):(this.buffer=this.buffer.concat(this.maybeDelimiterDefBuffer),this.buffer.push(d),this.currentState=this.stateMap.query,1)},d.prototype.delimiterDef=function(c,d,f){if(b&&console.log("delimiterDef: "+d)," "===d)return 0===this.delimiterDefCandidate.length?1:(this.delimiter=this.delimiterDefCandidate.join(""),this.currentState=this.stateMap.delimiterDefEnd,e.call(this),1);if("\n"===d){if(0===this.delimiterDefCandidate.length)throw new a("Delimiter not defined at "+f);return this.delimiter=this.delimiterDefCandidate.join(""),this.currentState=this.stateMap.lineStart,e.call(this),1}return this.delimiterDefCandidate.push(d),1},d.prototype.delimiterDefEnd=function(a,c){return b&&console.log("delimiterEnd: "+c),"\n"===c?(this.currentState=this.stateMap.lineStart,1):1},d.prototype.maybeDelimiter=function(a,c){return b&&console.log("maybeDelimiter: "+c),this.maybeDelimiterCount++,c===this.delimiter.charAt(this.maybeDelimiterCount)?this.maybeDelimiterCount+1===this.delimiter.length?(e.call(this),this.currentState=this.stateMap.query,1):1:(this.currentState=this.stateMap.query,this.skipDelimiterCheck=!0,-1*this.maybeDelimiterCount)},d.prototype.setDebug=function(a){b=a},MySQL.QueryDivider=d}(MySQL.ParseError); \ No newline at end of file diff --git a/app/window.html b/app/window.html index 786ca27..8a4da13 100644 --- a/app/window.html +++ b/app/window.html @@ -28,7 +28,7 @@ - +