diff --git a/bootstrap.js b/bootstrap.js index 8f8c778..3990e2b 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -39,7 +39,7 @@ var core = { // storage: OS.Path.join(OS.Constants.Path.profileDir, 'jetpack', core.addon.id, 'simple-storage') }, pref_branch: 'extensions.Chrome-Store-Foxified@jetpack.', - cache_key: Math.random() // set to version on release + cache_key: 'v2.0' // set to version on release }, os: { // // name: added by worker @@ -83,10 +83,10 @@ var gInstallListener = { // succesfully installed reason = reasons.SUCCESS; } - console.log('addon install ended', 'name:', aAddon.name, 'id:', aAddon.id, 'reason:', reason); + }, onInstallStarted: function(aInstall) { - console.log('addon install started', 'name:', aInstall.name, 'id:', aInstall.addon.id); + } }; @@ -142,7 +142,7 @@ function startup(aData, aReason) { getDownloadsDir().then( function(os_path_downloads) { core.addon.path.downloads = os_path_downloads; - console.log('core.addon.path.downloads:', core.addon.path.downloads); + startWorker(); } ); @@ -213,7 +213,7 @@ function callInWorker(aArg, aMessageManager, aBrowser, aComm) { // its dead cmm.splice(i, 1); i--; - console.error('browser in position', i, 'is dead! removed!'); + } else { if (cbrowser == aBrowser) { cbrowser_found = true; @@ -226,7 +226,7 @@ function callInWorker(aArg, aMessageManager, aBrowser, aComm) { } if (!cbrowser_found) { mm_for_extid[extid].push(Cu.getWeakReference(aBrowser)); - console.log('ok pushed aBrowser'); + } } @@ -264,15 +264,15 @@ function dispatchInContent(aArg, aComm) { // its dead cmm.splice(i, 1); i--; - console.error('browser in position', i, 'is dead! removed!'); + } else { - console.error('ok sending to browser in position', i, 'messageManager:', cbrowser.messageManager); + gFsComm.transcribeMessage(cbrowser.messageManager, 'callInContent', { method: 'dispatchInContent', arg: aArg, wait: false // i just want to know if return is `undefined` or `NO_WIN_COMM` }, function(aArg, aComm) { - console.log('in callback of dispatchInContent in bootstrap, aArg:', aArg); + }); } } @@ -360,7 +360,7 @@ function browseFile(aArg, aComm) { }// else { // cancelled } if (aOptions.async) { - console.error('async resolving'); + mainDeferred_browseFile.resolve(retFP); } else { return retFP; @@ -405,7 +405,7 @@ function downloadFile(aArg, aComm) { } - }).then(null, console.error); + }); } function installAddonAsTemp(aArg, aComm) { @@ -420,7 +420,7 @@ function installAddonAsTemp(aArg, aComm) { var promise_uninstall = uninstallAddonsByPartial(partial_id); promise_uninstall.then( function(aVal) { - console.log('Fullfilled - promise_uninstall - ', aVal); + install(); }, genericReject.bind(null, 'promise_uninstall', mainDeferred_installAddonAsTemp) @@ -458,7 +458,7 @@ function installAddonAsNormal(aArg, aComm) { var promise_uninstall = uninstallAddonsByPartial(partial_id); promise_uninstall.then( function(aVal) { - console.log('Fullfilled - promise_uninstall - ', aVal); + install(); }, genericReject.bind(null, 'promise_uninstall', mainDeferred_installAddonAsNormal) @@ -520,7 +520,7 @@ function validateOptionsObj(aOptions, aOptionsDefaults) { // ensures no invalid keys are found in aOptions, any key found in aOptions not having a key in aOptionsDefaults causes throw new Error as invalid option for (var aOptKey in aOptions) { if (!(aOptKey in aOptionsDefaults)) { - console.error('aOptKey of ' + aOptKey + ' is an invalid key, as it has no default value, aOptionsDefaults:', aOptionsDefaults, 'aOptions:', aOptions); + throw new Error('aOptKey of ' + aOptKey + ' is an invalid key, as it has no default value'); } } @@ -547,7 +547,7 @@ function genericReject(aPromiseName, aPromiseToReject, aReason) { name: aPromiseName, aReason: aReason }; - console.error('Rejected - ' + aPromiseName + ' - ', rejObj); + if (aPromiseToReject) { aPromiseToReject.reject(rejObj); } @@ -557,7 +557,7 @@ function genericCatch(aPromiseName, aPromiseToReject, aCaught) { name: aPromiseName, aCaught: aCaught }; - console.error('Caught - ' + aPromiseName + ' - ', rejObj); + if (aPromiseToReject) { aPromiseToReject.reject(rejObj); } @@ -606,28 +606,28 @@ function crossprocComm(aChannelId) { receiveMessage: function(e) { var messageManager = e.target.messageManager; if (!messageManager) { - console.error('bootstrap crossprocComm - ignoring this received message as no messageManager for the one i am getting message from, e.target:', e.target, 'messageManager:', messageManager); + return; } var browser = e.target; var payload = e.data; - console.log('bootstrap crossprocComm - incoming, payload:', payload, 'messageManager:', messageManager, 'browser:', browser, 'e:', e); - // console.log('this in receiveMessage bootstrap:', this); + + if (payload.method) { - if (!(payload.method in scope)) { console.error('method of "' + payload.method + '" not in scope'); throw new Error('method of "' + payload.method + '" not in scope') } // dev line remove on prod + var rez_bs_call = scope[payload.method](payload.arg, messageManager, browser, this); // only on bootstrap side, they get extra 2 args if (payload.cbid) { if (rez_bs_call && rez_bs_call.constructor.name == 'Promise') { rez_bs_call.then( function(aVal) { - console.log('Fullfilled - rez_bs_call - ', aVal); + this.transcribeMessage(messageManager, payload.cbid, aVal); }.bind(this), genericReject.bind(null, 'rez_bs_call', 0) ).catch(genericCatch.bind(null, 'rez_bs_call', 0)); } else { - console.log('bootstrap crossprocComm - calling transcribeMessage for callbck with args:', payload.cbid, rez_bs_call); + this.transcribeMessage(messageManager, payload.cbid, rez_bs_call); } } @@ -636,16 +636,16 @@ function crossprocComm(aChannelId) { this.callbackReceptacle[payload.cbid](payload.arg, messageManager, browser, this); delete this.callbackReceptacle[payload.cbid]; } else { - console.error('bootstrap crossprocComm - invalid combination - method:', payload.method, 'cbid:', payload.cbid, 'payload:', payload); + } }.bind(this) }; this.nextcbid = 1; //next callback id this.transcribeMessage = function(aMessageManager, aMethod, aArg, aCallback) { - // console.log('bootstrap sending message to framescript', aMethod, aArg); + // aMethod is a string - the method to call in framescript // aCallback is a function - optional - it will be triggered when aMethod is done calling - console.log('bootstrap crossprocComm - in transcribeMessage:', aMessageManager, aMethod, aArg, aCallback) + var cbid = null; if (typeof(aMethod) == 'number') { // this is a response to a callack waiting in framescript @@ -660,7 +660,7 @@ function crossprocComm(aChannelId) { // return; if (!aMessageManager) { - console.error('bootstrap crossprocComm - how on earth, im in transcribeMessage but no aMessageManager? arguments:', aMessageManager, aMethod, aArg, aCallback); + } aMessageManager.sendAsyncMessage(aChannelId, { method: aMethod, @@ -692,7 +692,7 @@ function contentComm(aContentWindow, aPort1, aPort2, onHandshakeComplete) { this.listener = function(e) { var payload = e.data; - console.log('bootstrap contentComm - incoming, payload:', payload); //, 'e:', e); + if (payload.method) { if (payload.method == 'contentComm_handshake_finalized') { @@ -702,20 +702,20 @@ function contentComm(aContentWindow, aPort1, aPort2, onHandshakeComplete) { } return; } - if (!(payload.method in scope)) { console.error('method of "' + payload.method + '" not in scope'); throw new Error('method of "' + payload.method + '" not in scope') } // dev line remove on prod + var rez_bs_call_for_win = scope[payload.method](payload.arg, this); - console.log('rez_bs_call_for_win:', rez_bs_call_for_win); + if (payload.cbid) { if (rez_bs_call_for_win && rez_bs_call_for_win.constructor.name == 'Promise') { rez_bs_call_for_win.then( function(aVal) { - console.log('Fullfilled - rez_bs_call_for_win - ', aVal); + this.postMessage(payload.cbid, aVal); }.bind(this), genericReject.bind(null, 'rez_bs_call_for_win', 0) ).catch(genericCatch.bind(null, 'rez_bs_call_for_win', 0)); } else { - console.log('calling postMessage for callback with rez_bs_call_for_win:', rez_bs_call_for_win, 'this:', this); + this.postMessage(payload.cbid, rez_bs_call_for_win); } } @@ -887,7 +887,7 @@ function workerComm(aWorkerPath, onBeforeInit, onAfterInit, aWebWorker) { }; this.listener = function(e) { var payload = e.data; - console.log('bootstrap workerComm - incoming, payload:', payload); //, 'e:', e); + if (payload.method) { if (payload.method == 'triggerOnAfterInit') { @@ -896,20 +896,20 @@ function workerComm(aWorkerPath, onBeforeInit, onAfterInit, aWebWorker) { } return; } - if (!(payload.method in scope)) { console.error('method of "' + payload.method + '" not in scope'); throw new Error('method of "' + payload.method + '" not in scope') } // dev line remove on prod + var rez_bs_call_for_worker = scope[payload.method](payload.arg, this); - console.log('rez_bs_call_for_worker:', rez_bs_call_for_worker); + if (payload.cbid) { if (rez_bs_call_for_worker && rez_bs_call_for_worker.constructor.name == 'Promise') { rez_bs_call_for_worker.then( function(aVal) { - console.log('Fullfilled - rez_bs_call_for_worker - ', aVal); + this.postMessage(payload.cbid, aVal); }.bind(this), genericReject.bind(null, 'rez_bs_call_for_worker', 0) ).catch(genericCatch.bind(null, 'rez_bs_call_for_worker', 0)); } else { - console.log('calling postMessage for callback with rez_bs_call_for_worker:', rez_bs_call_for_worker, 'this:', this); + this.postMessage(payload.cbid, rez_bs_call_for_worker); } } @@ -918,7 +918,7 @@ function workerComm(aWorkerPath, onBeforeInit, onAfterInit, aWebWorker) { this.callbackReceptacle[payload.cbid](payload.arg, this); delete this.callbackReceptacle[payload.cbid]; } else { - console.error('bootstrap workerComm - invalid combination'); + throw new Error('bootstrap workerComm - invalid combination'); } }.bind(this); diff --git a/install.rdf b/install.rdf index f59c24a..b21d043 100644 --- a/install.rdf +++ b/install.rdf @@ -5,7 +5,7 @@ Chrome-Store-Foxified@jetpack - 2.0b + 2.0 2 true diff --git a/locale/en-US/bootstrap.properties b/locale/en-US/bootstrap.properties deleted file mode 100644 index 5f88177..0000000 --- a/locale/en-US/bootstrap.properties +++ /dev/null @@ -1,49 +0,0 @@ -addon_name=Chrome Store Foxified -addon_description=Enables the Google Chrome Store for Firefox. Point and click to install Chrome extensions straight into Firefox. - -addon-installed-userdisabled=Add-on was succesfully installed, but you have it set as disabled, please go enable it from Add-ons Manager. -addon-installed-appdisabled=Add-on failed to install because this version of Firefox is not compatible with it. -addon-installed=Add-on was succesfully installed. -addon-install-failed=Add-on failed to install with error code: - -xpi-filename-template=%S - Version %S - Foxified -unsigned-xpi-filename-template=%S - Version %S - Foxified - UNSIGNED - -request-pref-toggle=In order to install unsigned add-ons, the "xpi.signatures.required" preference needs to be set to "false", would you like to allow this? -addon-install-failed-signatures=Add-on faild to install, because it is unsigned, and your preferences disallow installation of unsigned add-ons. - -attn-downloading=Downloading "%S" from Google Chrome Webstore... -attn-downloaded-converting=Converting %S's download into Firefox extension... -attn-signing=Signing "%S"... -attn-signing-submitting=Signing "%S"... Submitting request to addons.mozilla.org (AMO)... -attn-signing-checking=Signing "%S"... Checking if upload has been signed... -attn-signing-check-waiting=Signing "%S"... Not yet signed, will check again in %S seconds... (Attempt %S of %S) -attn-signing-downloading=Signing "%S"... Upload was signed. Downloading signed version... - -attn-installing=Installing "%S"... -attn-installed="%S" was successfully installed - -attn-addon-installed-userdisabled="%S" was successfully updated. You previously had this installed, and had disabled it in the Add-on Manager. -attn-addon-installed-appdisabled="%S" installed but your version of Firefox is not supported by this add-on. -attn-addon-installed-needsrestart="%S" installed but you need to restart your browse. -attn-addon-installed-failed="%S" failed to install - -enable-now=Enable Add-on -attn-enabled="%S" was succesfully enabled -attn-something-went-wrong=Something went wrong while trying to download and install "%S" - see browse console -attn-failed-signing="%S" failed the signing process - -show-failed-json=Show Failed JSON - -install-as-temp=Install as Temporary Add-on -installing-as-temp=Installing extension as a temporary add-on. On browser close, the extensions is automatically uninstalled. -installed-as-temp=Succesfully installed as temporary add-on -install-as-temp-fail=Failed to install as temporary add-on - -requesting-keys=Connecting to addons.mozilla.org to get signing key -attn-failed-signing-not-logged-in=In order to sign the addon, you need to have an account and be logged in at addons.mozilla.org - you are not logged in! -open-amo=Open Login - addons.mozilla.org -retry=Retry -open-agree=Open Agreement - addons.mozilla.org -attn-failed-signing-didnt-agree=In order to sign the addon, you must have agreed to the agreement -attn-failed-signing-time-server=The server from which time is fetched, is currently down \ No newline at end of file diff --git a/locale/en-US/inlay.properties b/locale/en-US/inlay.properties deleted file mode 100644 index c651327..0000000 --- a/locale/en-US/inlay.properties +++ /dev/null @@ -1,7 +0,0 @@ -add_to_firefox=Add to Firefox -starting=Download Started - -failed_isntall=Failed to download and install extension, please report to the addon author. Here is the error, see browser console for more readable version: - -error1=ERROR: Could not find extension id, will not try to install from href -error2=ERROR: Could not find extension id, will not try to install \ No newline at end of file diff --git a/locale/en-US/main.properties b/locale/en-US/main.properties index bb28dcf..42f4630 100644 --- a/locale/en-US/main.properties +++ b/locale/en-US/main.properties @@ -67,8 +67,8 @@ singin_xpi_failed_missing_fields=Signing failed, could not find AMO credentials signing_xpi_failed_xhr=Signing failed, contacting server failed. Status: %S Status Text: %S URL: %S signing_xpi_failed_max_attempts=Signing failed, max attempts reached while waiting for review to complete. The review may have failed. signing_xpi_failed_report_url=Open Validation Report in New Tab +signing_xpi_failed_toolong=Signing failed. Upload took too long and request token expired. This addon will have to be manually signed on AMO. +all_done=All process complete. Choose from any of the actions below. *Note* WebExtensions API is not yet complete by Mozilla so all extensions may not work yet. -all_done=All process complete. Choose from any of the actions below. - -unsigned_installed_warn=Temporarily installed, will be auto-uninstalled when Firefox closes. +unsigned_installed_warn=Temporarily installed, will be auto-uninstalled when Firefox closes. *Note* WebExtensions API is not yet complete by Mozilla so all extensions will not work. diff --git a/locale/en-US/options_inline.dtd b/locale/en-US/options_inline.dtd deleted file mode 100644 index 26bd05f..0000000 --- a/locale/en-US/options_inline.dtd +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/options.xul b/options.xul deleted file mode 100644 index b445689..0000000 --- a/options.xul +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - -