-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lots of various improvements.. #283
Open
warren-bank
wants to merge
36
commits into
privacypass:master
Choose a base branch
from
warren-bank:PR/v3-rc
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
1931272
minor configuration updates
warren-bank a623dee
work in progress..
warren-bank 59e01e2
work in progress..
warren-bank c9b0c40
work in progress..
warren-bank 6af07f7
work in progress..
warren-bank 4b7beb1
work in progress..
warren-bank 70ec3f1
work in progress..
warren-bank 06222cc
work in progress..
warren-bank a4e23fb
work in progress..
warren-bank 00cba76
v3.3.0 w/ Cloudflare and hCaptcha providers
warren-bank 6fe4c6c
update jest configs for testing and fix all tests to pass
warren-bank 578a97b
v3.3.1 w/ minified ES5
warren-bank 929cabd
v3.3.2 w/ minified ES5
warren-bank b9df538
minor configuration updates
warren-bank cf7144c
refactor and improve the dist/.bin build scripts
warren-bank 2f3fad0
work in progress..
warren-bank e101fc7
hCaptcha sends issuing requests from 'onCompleted' hook function
warren-bank 615f189
minor css tweak to popup window
warren-bank 37a5271
minor updates to the 'dist/.bin' build scripts
warren-bank 706a9e7
minor updates to the 'dist/.bin' build scripts
warren-bank baa5e80
add popup menu buttons to backup and restore tokens in local storage
warren-bank b889333
minor updates to the 'dist/.bin' build scripts
warren-bank 8d57b84
fix hCaptcha redemption
warren-bank 1f84b01
minor refactoring
warren-bank bf6d1ae
address race-condition: delay blocking async code by next-tick timer
warren-bank 48f5e14
revert hCaptcha and refactor Cloudflare
warren-bank 71e4b54
detect and fix incorrect requests on Cloudflare issuing domain
warren-bank 3e39527
fix: use feature detection so browser compatability isn't reduced
warren-bank 84ea20b
fix a conditional statement that may effect Cloudflare token issuing
warren-bank 29febe8
minor refactoring
warren-bank 8283f46
add static helper method: "getNormalizedFormData"
warren-bank 0ab56ce
fix the ability to restore tokens from a JSON text file
warren-bank 7057859
add i18n translations using IBM Watson Language Translator service
warren-bank 6ee36f8
minor html/css tweak to popup window
warren-bank 333f32b
accomodate for changes to Cloudflare provider backend
warren-bank ad517dd
CF: normalize name of querystring parameter in request to issue tokens
warren-bank File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* text=auto | ||
|
||
*.cmd text eol=crlf | ||
*.bat text eol=crlf | ||
*.sh text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
/node_modules/ | ||
/lib/ | ||
|
||
/dist/lib/ | ||
/dist/PrivacyPass/ | ||
/dist/PrivacyPass.pem | ||
/dist/PrivacyPass.crx* | ||
/dist/PrivacyPass.xpi | ||
/dist/.bin/**/temp/ | ||
|
||
/public/_locales/debug.en.txt | ||
|
||
*.swp | ||
/node_modules | ||
/dist | ||
/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Copyright (c) 2017-2020, Privacy Pass Team, Cloudflare, Inc., and other contributors. All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors | ||
may be used to endorse or promote products derived from this software without | ||
specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@echo off | ||
|
||
set ZIP7_HOME=C:\PortableApps\7-Zip\16.02\App\7-Zip64 | ||
|
||
set PATH=%ZIP7_HOME%;%PATH% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@echo off | ||
|
||
set PERL_HOME=C:\PortableApps\perl\5.10.1 | ||
set MAKE_HOME=C:\PortableApps\make | ||
|
||
set PATH=%PERL_HOME%;%MAKE_HOME%;%PATH% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
PERL_HOME='/c/PortableApps/perl/5.10.1' | ||
MAKE_HOME='/c/PortableApps/make' | ||
|
||
export PATH="${PERL_HOME}:${MAKE_HOME}:${PATH}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@echo off | ||
|
||
set NODE_ENV=development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
export NODE_ENV='development' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@echo off | ||
|
||
set NODE_ENV=production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
export NODE_ENV='production' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@echo off | ||
|
||
rem :: =============================== | ||
rem :: version of Chrome < 64.0.3242.0 | ||
rem :: =============================== | ||
rem :: https://sourceforge.net/projects/portableapps/files/Iron%20Portable/ | ||
rem :: https://sourceforge.net/projects/portableapps/files/Iron%20Portable/IronPortable_61.0.3200.0.paf.exe/download | ||
set CHROME_HOME=C:\PortableApps\SRWare Iron\61.0.3200.0\App\Iron | ||
|
||
set PATH=%CHROME_HOME%;%PATH% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
# =============================== | ||
# version of Chrome < 64.0.3242.0 | ||
# =============================== | ||
# https://sourceforge.net/projects/portableapps/files/Iron%20Portable/ | ||
# https://sourceforge.net/projects/portableapps/files/Iron%20Portable/IronPortable_61.0.3200.0.paf.exe/download | ||
CHROME_HOME='/c/PortableApps/SRWare Iron/61.0.3200.0/App/Iron' | ||
|
||
export PATH="${CHROME_HOME}:${PATH}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@echo off | ||
|
||
rem :: ================================ | ||
rem :: version of Chrome >= 64.0.3242.0 | ||
rem :: ================================ | ||
rem :: https://sourceforge.net/projects/portableapps/files/Google%20Chrome%20Portable/ | ||
rem :: https://sourceforge.net/projects/portableapps/files/Google%20Chrome%20Portable/GoogleChromePortable64_97.0.4692.71_online.paf.exe/download | ||
set CHROME_HOME=C:\PortableApps\Google Chrome\97.0.4692.71\App\Chrome-bin | ||
rem :: https://sourceforge.net/projects/portableapps/files/Iron%20Portable/ | ||
rem :: https://sourceforge.net/projects/portableapps/files/Iron%20Portable/IronPortable_85.0.4350.0.paf.exe/download | ||
set CHROME_HOME=C:\PortableApps\SRWare Iron\85.0.4350.0\App\Iron | ||
rem :: http://download1.srware.net/old/ | ||
rem :: http://download1.srware.net/old/iron/win/85/IronPortable64.exe | ||
set CHROME_HOME=C:\PortableApps\SRWare Iron\85.0.4350.0\Iron | ||
|
||
set PATH=%CHROME_HOME%;%PATH% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
# ================================ | ||
# version of Chrome >= 64.0.3242.0 | ||
# ================================ | ||
# https://sourceforge.net/projects/portableapps/files/Google%20Chrome%20Portable/ | ||
# https://sourceforge.net/projects/portableapps/files/Google%20Chrome%20Portable/GoogleChromePortable64_97.0.4692.71_online.paf.exe/download | ||
CHROME_HOME='/c/PortableApps/Google Chrome/97.0.4692.71/App/Chrome-bin' | ||
# https://sourceforge.net/projects/portableapps/files/Iron%20Portable/ | ||
# https://sourceforge.net/projects/portableapps/files/Iron%20Portable/IronPortable_85.0.4350.0.paf.exe/download | ||
CHROME_HOME='/c/PortableApps/SRWare Iron/85.0.4350.0/App/Iron' | ||
# http://download1.srware.net/old/ | ||
# http://download1.srware.net/old/iron/win/85/IronPortable64.exe | ||
CHROME_HOME='/c/PortableApps/SRWare Iron/85.0.4350.0/Iron' | ||
|
||
export PATH="${CHROME_HOME}:${PATH}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@echo off | ||
|
||
set ext_name=PrivacyPass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
export ext_name='PrivacyPass' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
OPENSSL_HOME='/c/PortableApps/OpenSSL/1.1.0' | ||
|
||
export PATH="${OPENSSL_HOME}:${PATH}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@echo off | ||
|
||
call "%~dp0..\.env\%~nx0" | ||
|
||
cd /D "%~dp0..\..\.." | ||
|
||
call npm run build | ||
|
||
if not defined BUILD_ALL ( | ||
echo. | ||
pause | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
source "${DIR}/../.env/build.sh" | ||
|
||
cd "${DIR}/../../.." | ||
|
||
npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@echo off | ||
|
||
call "%~dp0..\.env\%~nx0" | ||
call "%~dp0.\build.bat" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
source "${DIR}/../.env/build_development.sh" | ||
source "${DIR}/build.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@echo off | ||
|
||
call "%~dp0..\.env\%~nx0" | ||
call "%~dp0.\build.bat" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
source "${DIR}/../.env/build_production.sh" | ||
source "${DIR}/build.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@echo off | ||
|
||
set BUILD_ALL=1 | ||
|
||
call "%~dp0.\build\build.bat" | ||
call "%~dp0.\pack extensions\chromium\crx3\pack_crx3_with_chrome.bat" | ||
call "%~dp0.\pack extensions\firefox\pack_xpi_with_7zip.bat" | ||
|
||
call "%~dp0.\inject ES6 polyfills\inject_es6_polyfills.bat" | ||
call "%~dp0.\pack extensions\chromium\crx2\pack_crx2_with_chrome.bat" | ||
|
||
echo. | ||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
# ------------------------------------------------------------------------------ | ||
# configuration | ||
|
||
# 'USE_OPENSSL' determines how CRX2 and CRX3 extensions are built | ||
# - any non-empty value will use: | ||
# OpenSSL | ||
# - an empty value will use: | ||
# 2x different versions of Chrome | ||
# 1x older for CRX2: < 64.0.3242.0 | ||
# 1x newer for CRX3: >= 64.0.3242.0 | ||
USE_OPENSSL='1' | ||
|
||
# ------------------------------------------------------------------------------ | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
"${DIR}/build/build.sh" | ||
if [ -n "$USE_OPENSSL" ];then | ||
"${DIR}/pack extensions/chromium/crx3/pack_crx3_with_openssl.sh" | ||
else | ||
"${DIR}/pack extensions/chromium/crx3/pack_crx3_with_chrome.sh" | ||
fi | ||
"${DIR}/pack extensions/firefox/pack_xpi_with_zip.sh" | ||
|
||
"${DIR}/inject ES6 polyfills/inject_es6_polyfills.sh" | ||
if [ -n "$USE_OPENSSL" ];then | ||
"${DIR}/pack extensions/chromium/crx2/pack_crx2_with_openssl.sh" | ||
else | ||
"${DIR}/pack extensions/chromium/crx2/pack_crx2_with_chrome.sh" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@echo off | ||
|
||
call "%~dp0.\.env\build_development.bat" | ||
call "%~dp0.\build_all.bat" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
source "${DIR}/.env/build_development.sh" | ||
source "${DIR}/build_all.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@echo off | ||
|
||
call "%~dp0.\.env\build_production.bat" | ||
call "%~dp0.\build_all.bat" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
source "${DIR}/.env/build_production.sh" | ||
source "${DIR}/build_all.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
### ES6 Polyfills | ||
|
||
* adds [core-js](https://github.com/zloirock/core-js) to both the [background](../../../public/manifest.json) and [popup](../../../public/popup.html) pages | ||
- using a local copy of a recent browser build, which was saved from [cdnjs](https://cdnjs.com/libraries/core-js) | ||
* only needed to add support for very old browsers, which do not understand features that have since been added to the javascript (aka: ecmascript) scripting language | ||
- for Chrome, this is only recommended for extensions packed in CRX2 format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
@echo off | ||
setlocal enabledelayedexpansion | ||
|
||
call "%~dp0..\.env\constants.bat" | ||
call "%~dp0..\.env\build.bat" | ||
|
||
if not defined ext_name ( | ||
echo script configuration is invalid: | ||
echo missing name of browser extension | ||
exit /b 1 | ||
) | ||
|
||
set ext_dir="%~dp0..\..\%ext_name%" | ||
|
||
if not exist %ext_dir% ( | ||
echo Extension directory does not exist. | ||
echo Perhaps the Typescript compiler build failed? | ||
echo Quitting without making any changes. | ||
exit /b 1 | ||
) | ||
|
||
cd /D %ext_dir% | ||
|
||
if exist "%cd%\lib" ( | ||
echo "lib" directory already exists in extension directory. | ||
echo Has polyfill has already been injected? | ||
echo Quitting without making any changes. | ||
exit /b 1 | ||
) | ||
|
||
xcopy /E /I /Q "%~dp0.\lib" "lib" | ||
|
||
set filepath=manifest.json | ||
set "old_text="background.js"" | ||
set "new_text="lib/core-js.js", "background.js"" | ||
set flags= | ||
call :perform_file_search_replace "%filepath%" "!old_text!" "!new_text!" "%flags%" | ||
|
||
set filepath=popup.html | ||
set "old_text=<script" | ||
set "new_text=<script src="lib/core-js.js"></script><script" | ||
set flags= | ||
call :perform_file_search_replace "%filepath%" "!old_text!" "!new_text!" "%flags%" | ||
|
||
goto :done | ||
|
||
:perform_file_search_replace | ||
set filepath=%~1 | ||
set old_text=%2 | ||
set new_text=%3 | ||
set flags=%~4 | ||
|
||
rem :: trim double-quotes from text without using shell because ~N variable expansion breaks when string contains certain special characters | ||
set old_text=!old_text:~1,-1! | ||
set new_text=!new_text:~1,-1! | ||
|
||
rem :: https://stackoverflow.com/a/1258256 | ||
rem :: add backslash to escape double-quotes in text, or perl won't see them | ||
set old_text=!old_text:"=\"! | ||
set new_text=!new_text:"=\"! | ||
|
||
perl -pi.bak -e "s|!old_text!|!new_text!|%flags%" "%filepath%" | ||
|
||
if exist "%filepath%.bak" del "%filepath%.bak" | ||
goto :eof | ||
|
||
:done | ||
|
||
if not defined BUILD_ALL ( | ||
echo. | ||
pause | ||
) | ||
|
||
endlocal |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change the name to
PrivacyPass
? I think the namePrivacyPass
doesn't indicate that the files in the directory are generated files.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because when Chrome is used to pack an extension, both the name of the .crx and the .pem are expected to be the same as the input directory (all siblings)..
.gitignore
allows the .pem to be permanently homed where Chrome expects it to be.. without ever being commit to version control.. and likewise, the generated .crx and .xpi files won't eitherthis naming convention is associated with the scripts in the
.bin
directory.. if you already have tools that you use to package your extensions, then.. you:.bin
directoryThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another option.. which might be preferable.. would be to:
.bin
directory todist/.bin
dist/PrivacyPass
.gitignore
to exclude:dist/PrivacyPass
anddist/PrivacyPass.[pem|crx|xpi]
so all output.. and my scripts to pack the output into extensions.. would be confined under
dist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update:
That last suggestion seemed (to me) as a much cleaner option.. so I just pushed a commit to make those changes.