From 21b42304fe7368aedf3585d2eff407740c6d3201 Mon Sep 17 00:00:00 2001 From: Deathamns Date: Thu, 29 Jan 2015 14:12:21 +0100 Subject: [PATCH] Firefox: get the version number from the fragment --- platform/firefox/bootstrap.js | 16 +++++++++------- platform/firefox/install.rdf | 13 +++++++++++-- platform/firefox/vapi-background.js | 3 +-- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/platform/firefox/bootstrap.js b/platform/firefox/bootstrap.js index 38f2b4716..74c54a525 100644 --- a/platform/firefox/bootstrap.js +++ b/platform/firefox/bootstrap.js @@ -60,7 +60,7 @@ function startup(data, reason) { ); bgProcess.setAttribute( 'src', - 'chrome://' + hostName + '/content/background.html' + 'chrome://' + hostName + '/content/background.html#' + data.version ); restartListener.messageManager.addMessageListener( @@ -104,13 +104,15 @@ function shutdown(data, reason) { bgProcess.parentNode.removeChild(bgProcess); - // Remove the restartObserver only when the extension is being disabled - if ( data !== undefined ) { - restartListener.messageManager.removeMessageListener( - hostName + '-restart', - restartListener - ); + if ( data === undefined ) { + return; } + + // Remove the restartObserver only when the extension is being disabled + restartListener.messageManager.removeMessageListener( + hostName + '-restart', + restartListener + ); } /******************************************************************************/ diff --git a/platform/firefox/install.rdf b/platform/firefox/install.rdf index 2607c1433..e186b5b53 100644 --- a/platform/firefox/install.rdf +++ b/platform/firefox/install.rdf @@ -19,7 +19,7 @@ {{ec8030f7-c20a-464f-9b0e-13a3a9e97384}} 24.0 - 38.0 + 39.0 @@ -28,8 +28,17 @@ {{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}} 2.21 - 2.35 + 2.36 + + diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index a9820432e..18836a0d7 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -43,10 +43,9 @@ vAPI.firefox = true; /******************************************************************************/ -// TODO: read these data from somewhere... vAPI.app = { name: 'µBlock', - version: '0.8.6.0' + version: location.hash.slice(1) }; /******************************************************************************/