From 0d26416a906935f984bf2515d50f1362afa625ec Mon Sep 17 00:00:00 2001 From: Noitidart Date: Sat, 23 Jan 2016 00:12:40 -0800 Subject: [PATCH] 1.5b-initial * Restored dev cache key and console logs * No longer nightly, now on beta because I'm confident in it now --- app/js/app_main.js | 2 +- app/js/app_options.js | 2 +- bootstrap.js | 42 ++++++++++++++++----------------- install.rdf | 2 +- resources/scripts/fs_twitter.js | 8 +++---- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/app/js/app_main.js b/app/js/app_main.js index 9a79084..a0d2744 100644 --- a/app/js/app_main.js +++ b/app/js/app_main.js @@ -18,7 +18,7 @@ const core = { resources: 'chrome://nativeshot/content/resources/', images: 'chrome://nativeshot/content/resources/images/' }, - cache_key: 'v1.4-real' + cache_key: Math.random() }, os: { name: OS.Constants.Sys.Name.toLowerCase(), diff --git a/app/js/app_options.js b/app/js/app_options.js index 8e76868..954c2b0 100644 --- a/app/js/app_options.js +++ b/app/js/app_options.js @@ -19,7 +19,7 @@ const core = { resources: 'chrome://nativeshot/content/resources/', images: 'chrome://nativeshot/content/resources/images/' }, - cache_key: 'v1.4-real' + cache_key: Math.random() }, os: { name: OS.Constants.Sys.Name.toLowerCase(), diff --git a/bootstrap.js b/bootstrap.js index 474ab9d..8bbefe0 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -29,7 +29,7 @@ const core = { scripts: 'chrome://nativeshot/content/resources/scripts/', styles: 'chrome://nativeshot/content/resources/styles/', }, - cache_key: 'v1.4-real' // set to version on release + cache_key: Math.random() // set to version on release }, os: { name: OS.Constants.Sys.Name.toLowerCase(), @@ -1667,12 +1667,12 @@ var gEditor = { (this.canComp.toBlobHD || this.canComp.toBlob).call(this.canComp, function(b) { gEditor.closeOutEditor(e); // as i cant close out yet as i need this.canComp see line above this one: `(this.canComp.toBlobHD || this.canComp.toBlob).call(this.canComp, function(b) {` link374748304 // let file = new FileUtils.File('C:\\Users\\Vayeate\\Pictures\\imglogo.jpg'); - + console.log('blob ready:', b); var fileReader = Cc['@mozilla.org/files/filereader;1'].createInstance(Ci.nsIDOMFileReader); fileReader.addEventListener('load', function (event) { var buffer = event.target.result; - + // console.error('buffer ready:', buffer.constructor.name); var pathToRevImg = OS.Path.join(OS.Constants.Path.tmpDir, 'nativeshot_revsearch-' + Date.now() + '.png'); var promise_writeRevImg = OS.File.writeAtomic(pathToRevImg, new Uint8Array(buffer)); @@ -1713,7 +1713,7 @@ var gEditor = { name: 'promise_writeRevImg', aReason: aReason }; - + console.error(rejObj); } ).catch( function(aCaught) { @@ -1721,7 +1721,7 @@ var gEditor = { name: 'promise_writeRevImg', aCaught: aCaught }; - + console.error(rejObj); } ); @@ -1768,7 +1768,7 @@ var gEditor = { }; var cImgData = this.ctxComp.getImageData(0, 0, this.canComp.width, this.canComp.height); - + console.log('cImgData:', cImgData); gEditor.closeOutEditor(e); var promiseAllArr_ocr = []; @@ -1786,7 +1786,7 @@ var gEditor = { var promiseAll_ocr = Promise.all(promiseAllArr_ocr); promiseAll_ocr.then( function(aTxtArr) { - + console.log('Fullfilled - promiseAll_ocr - ', aTxtArr); cImgData = undefined; // when do all, we dont transfer, so it doesnt get neutered, so lets just do this, it might help it gc var alertStrArr = []; for (var i=0; i= 2 && aVal[aVal.length-1] == SIC_TRANS_WORD && Array.isArray(aVal[aVal.length-2])) { // to transfer in callback, set last element in arr to SIC_TRANS_WORD and 2nd to last element an array of the transferables // cannot transfer on promise reject, well can, but i didnt set it up as probably makes sense not to - + console.error('doing transferrrrr'); aVal.pop(); bootstrap[workerScopeName].postMessage([callbackPendingId, aVal], aVal.pop()); } else { @@ -3486,12 +3486,12 @@ function SICWorker(workerScopeName, aPath, aFuncExecScope=bootstrap, aCore=core) } }, function(aReason) { - + console.error('aReject:', aReason); bootstrap[workerScopeName].postMessage([callbackPendingId, ['promise_rejected', aReason]]); } ).catch( function(aCatch) { - + console.error('aCatch:', aCatch); bootstrap[workerScopeName].postMessage([callbackPendingId, ['promise_rejected', aCatch]]); } ); @@ -3507,7 +3507,7 @@ function SICWorker(workerScopeName, aPath, aFuncExecScope=bootstrap, aCore=core) } } } - + else { console.warn('funcName', funcName, 'not in scope of aFuncExecScope') } // else is intentionally on same line with console. so on finde replace all console. lines on release it will take this out }; @@ -3531,11 +3531,11 @@ function SICWorker(workerScopeName, aPath, aFuncExecScope=bootstrap, aCore=core) var thisCallbackId = SIC_CB_PREFIX + sic_last_cb_id; // + lastCallbackId; // link8888881 aFuncExecScope[thisCallbackId] = function() { delete aFuncExecScope[thisCallbackId]; - + // console.log('in mainthread callback trigger wrap, will apply aCB with these arguments:', arguments, 'turned into array:', Array.prototype.slice.call(arguments)); aCB.apply(null, arguments[0]); }; aPostMessageArr.push(thisCallbackId); - + // console.log('aPostMessageArr:', aPostMessageArr); bootstrap[workerScopeName].postMessage(aPostMessageArr, aPostMessageTransferList); }; @@ -4051,7 +4051,7 @@ function encodeFormData(data, charset, forArrBuf_nameDotExt, forArrBuf_mimeType) var mime = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService); ctype = mime.getTypeFromFile(v) || ctype; } catch (ex) { - + console.warn("failed to get type", ex); } item += "Content-Type: " + ctype + "\r\n\r\n"; @@ -4064,7 +4064,7 @@ function encodeFormData(data, charset, forArrBuf_nameDotExt, forArrBuf_mimeType) item = ""; } else { - + console.error('in else'); item += "Content-Disposition: form-data; name=\"" + encode(k, true) + "\"\r\n\r\n"; item += encode(v); @@ -4089,7 +4089,7 @@ function genericReject(aPromiseName, aPromiseToReject, aReason) { name: aPromiseName, aReason: aReason }; - + console.error('Rejected - ' + aPromiseName + ' - ', rejObj); if (aPromiseToReject) { aPromiseToReject.reject(rejObj); } @@ -4099,7 +4099,7 @@ function genericCatch(aPromiseName, aPromiseToReject, aCaught) { name: aPromiseName, aCaught: aCaught }; - + console.error('Caught - ' + aPromiseName + ' - ', rejObj); if (aPromiseToReject) { aPromiseToReject.reject(rejObj); } diff --git a/install.rdf b/install.rdf index df38a5d..4ed42f9 100644 --- a/install.rdf +++ b/install.rdf @@ -5,7 +5,7 @@ NativeShot@jetpack - 1.4 + 1.5b 2 true 3 diff --git a/resources/scripts/fs_twitter.js b/resources/scripts/fs_twitter.js index 8e55378..1a28915 100644 --- a/resources/scripts/fs_twitter.js +++ b/resources/scripts/fs_twitter.js @@ -10,7 +10,7 @@ var core = { content_accessible: 'chrome://nativeshot-accessible/content/', scripts: 'chrome://nativeshot/content/resources/scripts/' }, - cache_key: 'v1.4-real' // set to version on release + cache_key: Math.random() // set to version on release } }; const gContentFrameMessageManager = this; @@ -169,14 +169,14 @@ function on_nativeShot_notifyDataTweetSuccess(aEvent) { var parser = Cc['@mozilla.org/xmlextras/domparser;1'].createInstance(Ci.nsIDOMParser); var parsedDocument = parser.parseFromString(refDetails.tweet_html, 'text/html'); - + console.error('refDetails.tweet_html:', refDetails.tweet_html); var photos = []; var pattPhotoUrl = /data-(?:image-url|img-src)=["']?([^"' >]+)/g; // https://github.com/Noitidart/NativeShot/wiki/Twitter-Response-HTML var matchPhotoUrl; - + console.log('ok looping'); while (matchPhotoUrl = pattPhotoUrl.exec(refDetails.tweet_html)) { - + console.log('matchPhotoUrl:', matchPhotoUrl); photos.push(matchPhotoUrl[1]); }