From f2e22d8a5ff480e776b2d6f5bcae2de662dc6c70 Mon Sep 17 00:00:00 2001 From: NateN1222 Date: Sat, 27 Jan 2018 11:29:55 -0600 Subject: Created a basic build script mostly to serve as an example of what files actually get uploaded to Mozilla. --- README | 4 ++++ build.sh | 26 ++++++++++++++++++++++++++ bundle.js | 2 +- main_background.js | 2 +- 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100755 build.sh diff --git a/README b/README index 3bd0cb7..78f0c3a 100644 --- a/README +++ b/README @@ -16,6 +16,10 @@ To build the extension run this: browserify main_background.js -o bundle.js +To create an XPI file that can be uploaded to Mozilla run build.sh. + +Note: this build script relies on no new source files being created. + To debug this add-on on Firefox, go to the special URL "about:debugging", enable add-on debugging load the manifest.json. Chrome should work eventually but I haven't tested it lately. To debug the add-on on Chrome it's basically the same except you load it from "chrome://extensions" diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..2f3ebd9 --- /dev/null +++ b/build.sh @@ -0,0 +1,26 @@ +# Build the main file +browserify main_background.js -o bundle.js + +# Create a temp directory +mkdir ./build_temp + +# Move source files to temp directory +cp -r icons ./build_temp +cp -r ./html ./build_temp +cp manifest.json ./build_temp +cp contact_finder.js ./build_temp +cp bundle.js ./build_temp + +# build zip file from temp directory +cd ./build_temp +zip -r librejs.zip * +# remove old file +rm ../librejs.xpi || true +# move new zip file +mv librejs.zip ../ +# go back to source dir and remove temp directory +cd ../ +rm -r ./build_temp +# change the zip file to a xpi file that can be uploaded +mv librejs.zip librejs.xpi + diff --git a/bundle.js b/bundle.js index da46d29..67011db 100644 --- a/bundle.js +++ b/bundle.js @@ -1969,7 +1969,7 @@ function get_script(response,url,tabid,wl,index=-1){ } function block_ga(a){ console.log(a.url); - // This is actually just an HTML page + // This is just an HTML page if(a.url == 'https://www.google.com/analytics/#?modal_active=none'){ return; } diff --git a/main_background.js b/main_background.js index bf7feff..81905b2 100644 --- a/main_background.js +++ b/main_background.js @@ -1968,7 +1968,7 @@ function get_script(response,url,tabid,wl,index=-1){ } function block_ga(a){ console.log(a.url); - // This is actually just an HTML page + // This is just an HTML page if(a.url == 'https://www.google.com/analytics/#?modal_active=none'){ return; } -- cgit v1.2.3